command/{Queue,Other}: eliminate local "bool" variable
This commit is contained in:
@@ -308,8 +308,6 @@ CommandResult
|
|||||||
handle_setvol(Client &client, ConstBuffer<const char *> args)
|
handle_setvol(Client &client, ConstBuffer<const char *> args)
|
||||||
{
|
{
|
||||||
unsigned level;
|
unsigned level;
|
||||||
bool success;
|
|
||||||
|
|
||||||
if (!check_unsigned(client, &level, args.front()))
|
if (!check_unsigned(client, &level, args.front()))
|
||||||
return CommandResult::ERROR;
|
return CommandResult::ERROR;
|
||||||
|
|
||||||
@@ -318,8 +316,7 @@ handle_setvol(Client &client, ConstBuffer<const char *> args)
|
|||||||
return CommandResult::ERROR;
|
return CommandResult::ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
success = volume_level_change(client.partition.outputs, level);
|
if (!volume_level_change(client.partition.outputs, level)) {
|
||||||
if (!success) {
|
|
||||||
command_error(client, ACK_ERROR_SYSTEM,
|
command_error(client, ACK_ERROR_SYSTEM,
|
||||||
"problems setting volume");
|
"problems setting volume");
|
||||||
return CommandResult::ERROR;
|
return CommandResult::ERROR;
|
||||||
|
@@ -249,13 +249,11 @@ CommandResult
|
|||||||
handle_playlistinfo(Client &client, ConstBuffer<const char *> args)
|
handle_playlistinfo(Client &client, ConstBuffer<const char *> args)
|
||||||
{
|
{
|
||||||
unsigned start = 0, end = std::numeric_limits<unsigned>::max();
|
unsigned start = 0, end = std::numeric_limits<unsigned>::max();
|
||||||
bool ret;
|
|
||||||
|
|
||||||
if (args.size == 1 && !check_range(client, &start, &end, args.front()))
|
if (args.size == 1 && !check_range(client, &start, &end, args.front()))
|
||||||
return CommandResult::ERROR;
|
return CommandResult::ERROR;
|
||||||
|
|
||||||
ret = playlist_print_info(client, client.playlist, start, end);
|
if (!playlist_print_info(client, client.playlist, start, end))
|
||||||
if (!ret)
|
|
||||||
return print_playlist_result(client,
|
return print_playlist_result(client,
|
||||||
PlaylistResult::BAD_RANGE);
|
PlaylistResult::BAD_RANGE);
|
||||||
|
|
||||||
|
@@ -166,17 +166,15 @@ handle_sticker_song(Client &client, ConstBuffer<const char *> args)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool success;
|
|
||||||
struct sticker_song_find_data data = {
|
struct sticker_song_find_data data = {
|
||||||
client,
|
client,
|
||||||
args[3],
|
args[3],
|
||||||
};
|
};
|
||||||
|
|
||||||
success = sticker_song_find(*db, base_uri, data.name,
|
if (!sticker_song_find(*db, base_uri, data.name,
|
||||||
op, value,
|
op, value,
|
||||||
sticker_song_find_print_cb, &data,
|
sticker_song_find_print_cb, &data,
|
||||||
error);
|
error)) {
|
||||||
if (!success) {
|
|
||||||
if (error.IsDefined())
|
if (error.IsDefined())
|
||||||
return print_error(client, error);
|
return print_error(client, error);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user