aboutsummaryrefslogtreecommitdiffstats
path: root/src/AllCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-04 23:48:01 +0200
committerMax Kellermann <max@duempel.org>2013-08-04 23:48:01 +0200
commit85b77b81caa40f8bcd03921380246cb5863d5d21 (patch)
treecf4bc60a6760c52bcbd642a253b45f3bc5ad8775 /src/AllCommands.cxx
parent5bf2ec5a74bb1247a8cc84e90577eecbee116c62 (diff)
downloadmpd-85b77b81caa40f8bcd03921380246cb5863d5d21.tar.gz
mpd-85b77b81caa40f8bcd03921380246cb5863d5d21.tar.xz
mpd-85b77b81caa40f8bcd03921380246cb5863d5d21.zip
*: use gcc.h macros instead of GLib
Diffstat (limited to '')
-rw-r--r--src/AllCommands.cxx19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/AllCommands.cxx b/src/AllCommands.cxx
index cd06c323b..88eee150e 100644
--- a/src/AllCommands.cxx
+++ b/src/AllCommands.cxx
@@ -60,12 +60,10 @@ struct command {
/* don't be fooled, this is the command handler for "commands" command */
static enum command_return
-handle_commands(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[]);
+handle_commands(Client *client, int argc, char *argv[]);
static enum command_return
-handle_not_commands(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[]);
+handle_not_commands(Client *client, int argc, char *argv[]);
/**
* The command registry.
@@ -168,7 +166,7 @@ static const struct command commands[] = {
static const unsigned num_commands = sizeof(commands) / sizeof(commands[0]);
static bool
-command_available(G_GNUC_UNUSED const struct command *cmd)
+command_available(gcc_unused const struct command *cmd)
{
#ifdef ENABLE_SQLITE
if (strcmp(cmd->cmd, "sticker") == 0)
@@ -181,7 +179,7 @@ command_available(G_GNUC_UNUSED const struct command *cmd)
/* don't be fooled, this is the command handler for "commands" command */
static enum command_return
handle_commands(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
const unsigned permission = client_get_permission(client);
const struct command *cmd;
@@ -199,7 +197,7 @@ handle_commands(Client *client,
static enum command_return
handle_not_commands(Client *client,
- G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[])
+ gcc_unused int argc, gcc_unused char *argv[])
{
const unsigned permission = client_get_permission(client);
const struct command *cmd;
@@ -318,7 +316,6 @@ enum command_return
command_process(Client *client, unsigned num, char *line)
{
GError *error = NULL;
- int argc;
char *argv[COMMAND_ARGV_MAX] = { NULL };
const struct command *cmd;
enum command_return ret = COMMAND_RETURN_ERROR;
@@ -344,11 +341,11 @@ command_process(Client *client, unsigned num, char *line)
return COMMAND_RETURN_ERROR;
}
- argc = 1;
+ unsigned argc = 1;
/* now parse the arguments (quoted or unquoted) */
- while (argc < (int)G_N_ELEMENTS(argv) &&
+ while (argc < COMMAND_ARGV_MAX &&
(argv[argc] =
tokenizer.NextParam(&error)) != NULL)
++argc;
@@ -358,7 +355,7 @@ command_process(Client *client, unsigned num, char *line)
current_command = argv[0];
- if (argc >= (int)G_N_ELEMENTS(argv)) {
+ if (argc >= COMMAND_ARGV_MAX) {
command_error(client, ACK_ERROR_ARG, "Too many arguments");
current_command = NULL;
return COMMAND_RETURN_ERROR;