aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/TagCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-06 00:08:08 +0100
committerMax Kellermann <max@duempel.org>2014-12-08 13:30:35 +0100
commit6edfc56c9df7b212c65a5a40e9d0f132429578ea (patch)
tree32817169cad14212606f3e9234283bf6671e924a /src/command/TagCommands.cxx
parent5837a6394256f10b16d9a1fbc19be686ef2da2b6 (diff)
downloadmpd-6edfc56c9df7b212c65a5a40e9d0f132429578ea.tar.gz
mpd-6edfc56c9df7b212c65a5a40e9d0f132429578ea.tar.xz
mpd-6edfc56c9df7b212c65a5a40e9d0f132429578ea.zip
command: use ConstBuffer<const char *> for argument list
Diffstat (limited to 'src/command/TagCommands.cxx')
-rw-r--r--src/command/TagCommands.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/command/TagCommands.cxx b/src/command/TagCommands.cxx
index 2d537671c..6f821f451 100644
--- a/src/command/TagCommands.cxx
+++ b/src/command/TagCommands.cxx
@@ -25,15 +25,16 @@
#include "protocol/Result.hxx"
#include "tag/Tag.hxx"
#include "Partition.hxx"
+#include "util/ConstBuffer.hxx"
CommandResult
-handle_addtagid(Client &client, gcc_unused unsigned argc, char *argv[])
+handle_addtagid(Client &client, ConstBuffer<const char *> args)
{
unsigned song_id;
- if (!check_unsigned(client, &song_id, argv[1]))
+ if (!check_unsigned(client, &song_id, args.front()))
return CommandResult::ERROR;
- const char *const tag_name = argv[2];
+ const char *const tag_name = args[1];
const TagType tag_type = tag_name_parse_i(tag_name);
if (tag_type == TAG_NUM_OF_ITEM_TYPES) {
command_error(client, ACK_ERROR_ARG,
@@ -41,7 +42,7 @@ handle_addtagid(Client &client, gcc_unused unsigned argc, char *argv[])
return CommandResult::ERROR;
}
- const char *const value = argv[3];
+ const char *const value = args[2];
Error error;
if (!client.partition.playlist.AddSongIdTag(song_id, tag_type, value,
@@ -52,15 +53,15 @@ handle_addtagid(Client &client, gcc_unused unsigned argc, char *argv[])
}
CommandResult
-handle_cleartagid(Client &client, unsigned argc, char *argv[])
+handle_cleartagid(Client &client, ConstBuffer<const char *> args)
{
unsigned song_id;
- if (!check_unsigned(client, &song_id, argv[1]))
+ if (!check_unsigned(client, &song_id, args.front()))
return CommandResult::ERROR;
TagType tag_type = TAG_NUM_OF_ITEM_TYPES;
- if (argc >= 3) {
- const char *const tag_name = argv[2];
+ if (args.size >= 2) {
+ const char *const tag_name = args[1];
tag_type = tag_name_parse_i(tag_name);
if (tag_type == TAG_NUM_OF_ITEM_TYPES) {
command_error(client, ACK_ERROR_ARG,