red_channel_client_test_remote_cap() returns bool

Both _test_remote_cap() and _test_remote_common_cap() are used as
boolean values, so change the return type from int to bool to follow our
coding standard.
This commit is contained in:
Jonathon Jongsma 2017-04-06 11:21:09 -05:00
parent 332ad52143
commit 9b0824bae4
5 changed files with 12 additions and 12 deletions

View File

@ -620,8 +620,8 @@ gboolean main_channel_client_migrate_src_complete(MainChannelClient *mcc,
gboolean ret = FALSE;
RedChannelClient *rcc = RED_CHANNEL_CLIENT(mcc);
RedClient *client = red_channel_client_get_client(rcc);
int semi_seamless_support = red_channel_client_test_remote_cap(rcc,
SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE);
bool semi_seamless_support = red_channel_client_test_remote_cap(rcc,
SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE);
if (semi_seamless_support && mcc->priv->mig_connect_ok) {
if (success) {
spice_printerr("client %p MIGRATE_END", client);

View File

@ -664,14 +664,14 @@ static gboolean red_channel_client_pipe_remove(RedChannelClient *rcc, RedPipeIte
return g_queue_remove(&rcc->priv->pipe, item);
}
int red_channel_client_test_remote_common_cap(RedChannelClient *rcc, uint32_t cap)
bool red_channel_client_test_remote_common_cap(RedChannelClient *rcc, uint32_t cap)
{
return test_capability(rcc->priv->remote_caps.common_caps,
rcc->priv->remote_caps.num_common_caps,
cap);
}
int red_channel_client_test_remote_cap(RedChannelClient *rcc, uint32_t cap)
bool red_channel_client_test_remote_cap(RedChannelClient *rcc, uint32_t cap)
{
return test_capability(rcc->priv->remote_caps.caps,
rcc->priv->remote_caps.num_caps,

View File

@ -51,8 +51,8 @@ gboolean red_channel_client_is_connected(RedChannelClient *rcc);
void red_channel_client_default_migrate(RedChannelClient *rcc);
bool red_channel_client_is_waiting_for_migrate_data(RedChannelClient *rcc);
void red_channel_client_destroy(RedChannelClient *rcc);
int red_channel_client_test_remote_common_cap(RedChannelClient *rcc, uint32_t cap);
int red_channel_client_test_remote_cap(RedChannelClient *rcc, uint32_t cap);
bool red_channel_client_test_remote_common_cap(RedChannelClient *rcc, uint32_t cap);
bool red_channel_client_test_remote_cap(RedChannelClient *rcc, uint32_t cap);
/* shutdown is the only safe thing to do out of the client/channel
* thread. It will not touch the rings, just shutdown the socket.
* It should be followed by some way to guarantee a disconnection. */

View File

@ -1044,9 +1044,9 @@ playback_channel_client_constructed(GObject *object)
SND_CHANNEL_CLIENT(playback_client)->on_message_done = snd_playback_on_message_done;
RedChannelClient *rcc = RED_CHANNEL_CLIENT(playback_client);
int client_can_celt = red_channel_client_test_remote_cap(rcc,
bool client_can_celt = red_channel_client_test_remote_cap(rcc,
SPICE_PLAYBACK_CAP_CELT_0_5_1);
int client_can_opus = red_channel_client_test_remote_cap(rcc,
bool client_can_opus = red_channel_client_test_remote_cap(rcc,
SPICE_PLAYBACK_CAP_OPUS);
bool playback_compression =
reds_config_get_playback_compression(red_channel_get_server(red_channel));
@ -1192,7 +1192,7 @@ SPICE_GNUC_VISIBLE uint32_t spice_server_record_get_samples(SpiceRecordInstance
static uint32_t snd_get_best_rate(SndChannelClient *client, uint32_t cap_opus)
{
int client_can_opus = TRUE;
bool client_can_opus = TRUE;
if (client) {
client_can_opus = red_channel_client_test_remote_cap(RED_CHANNEL_CLIENT(client), cap_opus);
}
@ -1460,9 +1460,9 @@ void snd_set_playback_compression(bool on)
if (type == SPICE_CHANNEL_PLAYBACK && now->connection) {
PlaybackChannelClient* playback = (PlaybackChannelClient*)now->connection;
RedChannelClient *rcc = RED_CHANNEL_CLIENT(playback);
int client_can_celt = red_channel_client_test_remote_cap(rcc,
bool client_can_celt = red_channel_client_test_remote_cap(rcc,
SPICE_PLAYBACK_CAP_CELT_0_5_1);
int client_can_opus = red_channel_client_test_remote_cap(rcc,
bool client_can_opus = red_channel_client_test_remote_cap(rcc,
SPICE_PLAYBACK_CAP_OPUS);
int desired_mode = snd_desired_audio_mode(on, now->frequency,
client_can_opus, client_can_celt);

View File

@ -689,7 +689,7 @@ static VideoEncoder* dcc_create_video_encoder(DisplayChannelClient *dcc,
VideoEncoderRateControlCbs *cbs)
{
RedChannelClient *rcc = RED_CHANNEL_CLIENT(dcc);
int client_has_multi_codec = red_channel_client_test_remote_cap(rcc, SPICE_DISPLAY_CAP_MULTI_CODEC);
bool client_has_multi_codec = red_channel_client_test_remote_cap(rcc, SPICE_DISPLAY_CAP_MULTI_CODEC);
int i;
GArray *video_codecs;