protocol/ArgParser: overload as ParseCommandArg(), pass references

This commit is contained in:
Max Kellermann
2015-08-11 22:34:22 +02:00
parent 0f92d021a1
commit 9231f420c1
8 changed files with 56 additions and 71 deletions

View File

@@ -309,7 +309,7 @@ CommandResult
handle_setvol(Client &client, Request args)
{
unsigned level;
if (!check_unsigned(client, &level, args.front()))
if (!ParseCommandArg(client, level, args.front()))
return CommandResult::ERROR;
if (level > 100) {
@@ -330,7 +330,7 @@ CommandResult
handle_volume(Client &client, Request args)
{
int relative;
if (!check_int(client, &relative, args.front()))
if (!ParseCommandArg(client, relative, args.front()))
return CommandResult::ERROR;
if (relative < -100 || relative > 100) {