diff options
author | Pablo Barciela <[email protected]> | 2019-12-09 12:05:16 +0100 |
---|---|---|
committer | lukefromdc <[email protected]> | 2019-12-10 18:39:02 +0000 |
commit | 004f668b29549a4b4c041f6d27b15898a9d7acc5 (patch) | |
tree | 35e5e5936f1089e427fc0156ed0a679f7c8de36b | |
parent | 8138877b8f12881deec7e40aad9ebbf39e8826a8 (diff) | |
download | libmatemixer-004f668b29549a4b4c041f6d27b15898a9d7acc5.tar.bz2 libmatemixer-004f668b29549a4b4c041f6d27b15898a9d7acc5.tar.xz |
Fix cppcheck [syntaxError] warnings
30 files changed, 105 insertions, 105 deletions
diff --git a/backends/alsa/alsa-device.c b/backends/alsa/alsa-device.c index 34612b9..50509cf 100644 --- a/backends/alsa/alsa-device.c +++ b/backends/alsa/alsa-device.c @@ -563,7 +563,7 @@ add_switch (AlsaDevice *device, AlsaStream *stream, snd_mixer_elem_t *el) MateMixerStreamSwitchRole role; count = snd_mixer_selem_get_enum_items (el); - if G_UNLIKELY (count <= 0) { + if (G_UNLIKELY (count <= 0)) { g_debug ("Skipping mixer switch %s with %d items", snd_mixer_selem_get_name (el), count); @@ -573,7 +573,7 @@ add_switch (AlsaDevice *device, AlsaStream *stream, snd_mixer_elem_t *el) for (i = 0; i < count; i++) { gint ret = snd_mixer_selem_get_enum_item_name (el, i, sizeof (item), item); - if G_LIKELY (ret == 0) { + if (G_LIKELY (ret == 0)) { gint j; AlsaSwitchOption *option = NULL; @@ -594,7 +594,7 @@ add_switch (AlsaDevice *device, AlsaStream *stream, snd_mixer_elem_t *el) g_warning ("Failed to read switch item name: %s", snd_strerror (ret)); } - if G_UNLIKELY (options == NULL) + if (G_UNLIKELY (options == NULL)) return; get_switch_info (el, &name, &label, &role); diff --git a/backends/alsa/alsa-stream-control.c b/backends/alsa/alsa-stream-control.c index f39e9f9..ea067f4 100644 --- a/backends/alsa/alsa-stream-control.c +++ b/backends/alsa/alsa-stream-control.c @@ -396,7 +396,7 @@ alsa_stream_control_has_channel_position (MateMixerStreamControl *mmsc, control = ALSA_STREAM_CONTROL (mmsc); - if MATE_MIXER_CHANNEL_MASK_HAS_CHANNEL (control->priv->channel_mask, position) + if (MATE_MIXER_CHANNEL_MASK_HAS_CHANNEL (control->priv->channel_mask, position)) return TRUE; else return FALSE; @@ -455,7 +455,7 @@ alsa_stream_control_set_channel_volume (MateMixerStreamControl *mmsc, guint chan /* Convert channel index to ALSA channel position and make sure it is valid */ snd_mixer_selem_channel_id_t c = alsa_channel_map_to[control->priv->data.c[channel]]; - if G_UNLIKELY (c == SND_MIXER_SCHN_UNKNOWN) { + if (G_UNLIKELY (c == SND_MIXER_SCHN_UNKNOWN)) { g_warn_if_reached (); return FALSE; } @@ -682,11 +682,11 @@ control_data_get_average_left_right (AlsaControlData *data, guint *left, guint * guint channel; for (channel = 0; channel < data->channels; channel++) - if MATE_MIXER_IS_LEFT_CHANNEL (data->c[channel]) { + if (MATE_MIXER_IS_LEFT_CHANNEL (data->c[channel])) { l += data->v[channel]; nl++; } - else if MATE_MIXER_IS_RIGHT_CHANNEL (data->c[channel]) { + else if (MATE_MIXER_IS_RIGHT_CHANNEL (data->c[channel])) { r += data->v[channel]; nr++; } @@ -705,11 +705,11 @@ control_data_get_average_front_back (AlsaControlData *data, guint *front, guint guint channel; for (channel = 0; channel < data->channels; channel++) - if MATE_MIXER_IS_FRONT_CHANNEL (data->c[channel]) { + if (MATE_MIXER_IS_FRONT_CHANNEL (data->c[channel])) { f += data->v[channel]; nf++; } - else if MATE_MIXER_IS_BACK_CHANNEL (data->c[channel]) { + else if (MATE_MIXER_IS_BACK_CHANNEL (data->c[channel])) { b += data->v[channel]; nb++; } diff --git a/backends/alsa/alsa-stream-input-control.c b/backends/alsa/alsa-stream-input-control.c index 103d2a7..eb7dc10 100644 --- a/backends/alsa/alsa-stream-input-control.c +++ b/backends/alsa/alsa-stream-input-control.c @@ -102,11 +102,11 @@ alsa_stream_input_control_load (AlsaStreamControl *control) g_return_val_if_fail (ALSA_IS_STREAM_INPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; - if G_UNLIKELY (snd_mixer_selem_has_capture_volume (el) == 0 && - snd_mixer_selem_has_common_volume (el) == 0) { + if (G_UNLIKELY (snd_mixer_selem_has_capture_volume (el) == 0 && + snd_mixer_selem_has_common_volume (el) == 0)) { g_warn_if_reached (); return FALSE; } @@ -139,7 +139,7 @@ alsa_stream_input_control_set_mute (AlsaStreamControl *control, gboolean mute) g_return_val_if_fail (ALSA_IS_STREAM_INPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; /* Set the switch for all channels */ @@ -160,7 +160,7 @@ alsa_stream_input_control_set_volume (AlsaStreamControl *control, guint volume) g_return_val_if_fail (ALSA_IS_STREAM_INPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; /* Set the volume for all channels */ @@ -183,7 +183,7 @@ alsa_stream_input_control_set_channel_volume (AlsaStreamControl *contr g_return_val_if_fail (ALSA_IS_STREAM_INPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; /* Set the volume for a single channel */ @@ -208,7 +208,7 @@ alsa_stream_input_control_get_volume_from_decibel (AlsaStreamControl *control, g_return_val_if_fail (ALSA_IS_STREAM_INPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; ret = snd_mixer_selem_ask_capture_dB_vol (el, (glong) (decibel * 100), 0, &value); @@ -237,7 +237,7 @@ alsa_stream_input_control_get_decibel_from_volume (AlsaStreamControl *control, g_return_val_if_fail (ALSA_IS_STREAM_INPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; ret = snd_mixer_selem_ask_capture_vol_dB (el, (glong) volume, &value); @@ -264,7 +264,7 @@ read_volume_data (snd_mixer_elem_t *el, AlsaControlData *data) /* Read volume ranges, this call should never fail on valid input */ #if SND_LIB_VERSION >= ALSA_PACK_VERSION (1, 0, 10) ret = snd_mixer_selem_get_capture_volume_range (el, &min, &max); - if G_UNLIKELY (ret < 0) { + if (G_UNLIKELY (ret < 0)) { g_warning ("Failed to read capture volume range: %s", snd_strerror (ret)); return; } @@ -311,7 +311,7 @@ read_volume_data (snd_mixer_elem_t *el, AlsaControlData *data) gint value; ret = snd_mixer_selem_get_capture_switch (el, SND_MIXER_SCHN_MONO, &value); - if G_LIKELY (ret == 0) + if (G_LIKELY (ret == 0)) data->m[0] = !value; } } else { diff --git a/backends/alsa/alsa-stream-output-control.c b/backends/alsa/alsa-stream-output-control.c index 362a247..8b5d385 100644 --- a/backends/alsa/alsa-stream-output-control.c +++ b/backends/alsa/alsa-stream-output-control.c @@ -101,11 +101,11 @@ alsa_stream_output_control_load (AlsaStreamControl *control) g_return_val_if_fail (ALSA_IS_STREAM_OUTPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; - if G_UNLIKELY (snd_mixer_selem_has_playback_volume (el) == 0 && - snd_mixer_selem_has_common_volume (el) == 0) { + if (G_UNLIKELY (snd_mixer_selem_has_playback_volume (el) == 0 && + snd_mixer_selem_has_common_volume (el) == 0)) { g_warn_if_reached (); return FALSE; } @@ -138,7 +138,7 @@ alsa_stream_output_control_set_mute (AlsaStreamControl *control, gboolean mute) g_return_val_if_fail (ALSA_IS_STREAM_OUTPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; /* Set the switch for all channels */ @@ -159,7 +159,7 @@ alsa_stream_output_control_set_volume (AlsaStreamControl *control, guint volume) g_return_val_if_fail (ALSA_IS_STREAM_OUTPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; /* Set the volume for all channels */ @@ -182,7 +182,7 @@ alsa_stream_output_control_set_channel_volume (AlsaStreamControl *cont g_return_val_if_fail (ALSA_IS_STREAM_OUTPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; /* Set the volume for a single channel */ @@ -207,7 +207,7 @@ alsa_stream_output_control_get_volume_from_decibel (AlsaStreamControl *control, g_return_val_if_fail (ALSA_IS_STREAM_OUTPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; ret = snd_mixer_selem_ask_playback_dB_vol (el, (glong) (decibel * 100), 0, &value); @@ -236,7 +236,7 @@ alsa_stream_output_control_get_decibel_from_volume (AlsaStreamControl *control, g_return_val_if_fail (ALSA_IS_STREAM_OUTPUT_CONTROL (control), FALSE); el = alsa_element_get_snd_element (ALSA_ELEMENT (control)); - if G_UNLIKELY (el == NULL) + if (G_UNLIKELY (el == NULL)) return FALSE; ret = snd_mixer_selem_ask_playback_vol_dB (el, (glong) volume, &value); @@ -263,7 +263,7 @@ read_volume_data (snd_mixer_elem_t *el, AlsaControlData *data) /* Read volume ranges, this call should never fail on valid input */ #if SND_LIB_VERSION >= ALSA_PACK_VERSION (1, 0, 10) ret = snd_mixer_selem_get_playback_volume_range (el, &min, &max); - if G_UNLIKELY (ret < 0) { + if (G_UNLIKELY (ret < 0)) { g_warning ("Failed to read playback volume range: %s", snd_strerror (ret)); return; } @@ -310,7 +310,7 @@ read_volume_data (snd_mixer_elem_t *el, AlsaControlData *data) gint value; ret = snd_mixer_selem_get_playback_switch (el, SND_MIXER_SCHN_MONO, &value); - if G_LIKELY (ret == 0) + if (G_LIKELY (ret == 0)) data->m[0] = !value; } } else { diff --git a/backends/alsa/alsa-switch.c b/backends/alsa/alsa-switch.c index 1f5f92f..a1dfeea 100644 --- a/backends/alsa/alsa-switch.c +++ b/backends/alsa/alsa-switch.c @@ -136,12 +136,12 @@ alsa_switch_set_active_option (MateMixerSwitch *mms, MateMixerSwitchOption *mmso swtch = ALSA_SWITCH (mms); - if G_UNLIKELY (swtch->priv->element == NULL) + if (G_UNLIKELY (swtch->priv->element == NULL)) return FALSE; /* The channel mask is created when reading the active option the first * time, so a successful load must be done before changing the option */ - if G_UNLIKELY (swtch->priv->channel_mask == 0) { + if (G_UNLIKELY (swtch->priv->channel_mask == 0)) { g_debug ("Not setting active switch option, channel mask unknown"); return FALSE; } @@ -203,7 +203,7 @@ alsa_switch_load (AlsaElement *element) swtch = ALSA_SWITCH (element); - if G_UNLIKELY (swtch->priv->element == NULL) + if (G_UNLIKELY (swtch->priv->element == NULL)) return FALSE; /* When reading the first time we try all the channels, otherwise only the diff --git a/backends/alsa/alsa-toggle.c b/backends/alsa/alsa-toggle.c index d7dd46e..9c15885 100644 --- a/backends/alsa/alsa-toggle.c +++ b/backends/alsa/alsa-toggle.c @@ -115,14 +115,14 @@ alsa_toggle_set_active_option (MateMixerSwitch *mms, MateMixerSwitchOption *mmso toggle = ALSA_TOGGLE (mms); - if G_UNLIKELY (toggle->priv->element == NULL) + if (G_UNLIKELY (toggle->priv->element == NULL)) return FALSE; /* For toggles the 0/1 value is stored as the switch option id, there is not really * a need to validate that the option belong to the switch, just make sure it * contains the value 0 or 1 */ value = alsa_switch_option_get_id (ALSA_SWITCH_OPTION (mmso)); - if G_UNLIKELY (value != 0 && value != 1) { + if (G_UNLIKELY (value != 0 && value != 1)) { g_warn_if_reached (); return FALSE; } @@ -170,7 +170,7 @@ alsa_toggle_load (AlsaElement *element) toggle = ALSA_TOGGLE (element); - if G_UNLIKELY (toggle->priv->element == NULL) + if (G_UNLIKELY (toggle->priv->element == NULL)) return FALSE; /* When reading the first time we try all the channels, otherwise only the diff --git a/backends/oss/oss-backend.c b/backends/oss/oss-backend.c index 792367e..9dcfa19 100644 --- a/backends/oss/oss-backend.c +++ b/backends/oss/oss-backend.c @@ -358,7 +358,7 @@ read_device (OssBackend *oss, const gchar *path, gboolean *added) close (fd); - if G_LIKELY (device != NULL) { + if (G_LIKELY (device != NULL)) { *added = oss_device_open (device); if (*added == TRUE) add_device (oss, device); @@ -591,7 +591,7 @@ get_default_device (OssBackend *oss) item = g_list_find_custom (oss->priv->devices, oss->priv->default_device, compare_device_path); - if G_LIKELY (item != NULL) + if (G_LIKELY (item != NULL)) return OSS_DEVICE (item->data); return NULL; diff --git a/backends/oss/oss-device.c b/backends/oss/oss-device.c index c660de2..6c07fd5 100644 --- a/backends/oss/oss-device.c +++ b/backends/oss/oss-device.c @@ -588,7 +588,7 @@ read_mixer_devices (OssDevice *device) device->priv->fd, i, stereo); - if G_UNLIKELY (control == NULL) + if (G_UNLIKELY (control == NULL)) continue; if (oss_stream_has_controls (stream) == FALSE) { @@ -638,7 +638,7 @@ read_mixer_switch (OssDevice *device) options = g_list_prepend (options, option); } - if G_LIKELY (options != NULL) + if (G_LIKELY (options != NULL)) oss_stream_set_switch_data (device->priv->input, device->priv->fd, g_list_reverse (options)); @@ -649,7 +649,7 @@ poll_mixer (OssDevice *device) { gboolean load = TRUE; - if G_UNLIKELY (device->priv->fd == -1) + if (G_UNLIKELY (device->priv->fd == -1)) return G_SOURCE_REMOVE; #ifdef SOUND_MIXER_INFO @@ -707,7 +707,7 @@ poll_mixer (OssDevice *device) static gboolean poll_mixer_restore (OssDevice *device) { - if G_LIKELY (device->priv->poll_mode == OSS_POLL_RAPID) { + if (G_LIKELY (device->priv->poll_mode == OSS_POLL_RAPID)) { /* Remove the current rapid source */ g_source_remove (device->priv->poll_tag); diff --git a/backends/oss/oss-stream-control.c b/backends/oss/oss-stream-control.c index 6a78866..2e0b327 100644 --- a/backends/oss/oss-stream-control.c +++ b/backends/oss/oss-stream-control.c @@ -189,7 +189,7 @@ oss_stream_control_load (OssStreamControl *control) g_return_if_fail (OSS_IS_STREAM_CONTROL (control)); - if G_UNLIKELY (control->priv->fd == -1) + if (G_UNLIKELY (control->priv->fd == -1)) return; ret = ioctl (control->priv->fd, MIXER_READ (control->priv->devnum), &v); @@ -244,7 +244,7 @@ oss_stream_control_set_volume (MateMixerStreamControl *mmsc, guint volume) control = OSS_STREAM_CONTROL (mmsc); - if G_UNLIKELY (control->priv->fd == -1) + if (G_UNLIKELY (control->priv->fd == -1)) return FALSE; return write_and_store_volume (control, OSS_VOLUME_JOIN_SAME (CLAMP (volume, 0, 100))); @@ -281,7 +281,7 @@ oss_stream_control_set_channel_volume (MateMixerStreamControl *mmsc, control = OSS_STREAM_CONTROL (mmsc); - if G_UNLIKELY (control->priv->fd == -1) + if (G_UNLIKELY (control->priv->fd == -1)) return FALSE; if (channel != LEFT_CHANNEL && @@ -345,7 +345,7 @@ oss_stream_control_set_balance (MateMixerStreamControl *mmsc, gfloat balance) control = OSS_STREAM_CONTROL (mmsc); - if G_UNLIKELY (control->priv->fd == -1) + if (G_UNLIKELY (control->priv->fd == -1)) return FALSE; max = MAX (control->priv->volume[LEFT_CHANNEL], diff --git a/backends/oss/oss-stream.c b/backends/oss/oss-stream.c index d82032e..40d1515 100644 --- a/backends/oss/oss-stream.c +++ b/backends/oss/oss-stream.c @@ -199,7 +199,7 @@ oss_stream_set_switch_data (OssStream *stream, gint fd, GList *options) g_return_if_fail (options != NULL); /* Function may only be called once */ - if G_UNLIKELY (stream->priv->swtch != NULL) { + if (G_UNLIKELY (stream->priv->swtch != NULL)) { g_warn_if_reached (); return; } @@ -210,7 +210,7 @@ oss_stream_set_switch_data (OssStream *stream, gint fd, GList *options) _("Connector"), fd, options); - if G_UNLIKELY (stream->priv->swtch == NULL) + if (G_UNLIKELY (stream->priv->swtch == NULL)) return; /* Read the active selection */ diff --git a/backends/oss/oss-switch.c b/backends/oss/oss-switch.c index 0805d33..54c3e02 100644 --- a/backends/oss/oss-switch.c +++ b/backends/oss/oss-switch.c @@ -140,7 +140,7 @@ oss_switch_load (OssSwitch *swtch) g_return_if_fail (OSS_IS_SWITCH (swtch)); - if G_UNLIKELY (swtch->priv->fd == -1) + if (G_UNLIKELY (swtch->priv->fd == -1)) return; /* Recsrc contains a bitmask of currently enabled recording sources */ @@ -222,7 +222,7 @@ oss_switch_set_active_option (MateMixerSwitch *mms, MateMixerSwitchOption *mmso) swtch = OSS_SWITCH (mms); - if G_UNLIKELY (swtch->priv->fd == -1) + if (G_UNLIKELY (swtch->priv->fd == -1)) return FALSE; recsrc = 1 << oss_switch_option_get_devnum (OSS_SWITCH_OPTION (mmso)); diff --git a/backends/pulse/pulse-backend.c b/backends/pulse/pulse-backend.c index 34195f7..1707b89 100644 --- a/backends/pulse/pulse-backend.c +++ b/backends/pulse/pulse-backend.c @@ -346,7 +346,7 @@ pulse_backend_open (MateMixerBackend *backend) pulse = PULSE_BACKEND (backend); - if G_UNLIKELY (pulse->priv->connection != NULL) { + if (G_UNLIKELY (pulse->priv->connection != NULL)) { g_warn_if_reached (); return TRUE; } @@ -360,7 +360,7 @@ pulse_backend_open (MateMixerBackend *backend) /* No connection attempt is made during the construction of the connection, * but it sets up the PulseAudio structures, which might fail in an * unlikely case */ - if G_UNLIKELY (connection == NULL) { + if (G_UNLIKELY (connection == NULL)) { PULSE_CHANGE_STATE (pulse, MATE_MIXER_STATE_FAILED); return FALSE; } @@ -628,7 +628,7 @@ on_connection_state_notify (PulseConnection *connection, * is reached. */ PULSE_CHANGE_STATE (pulse, MATE_MIXER_STATE_CONNECTING); - if G_UNLIKELY (pulse->priv->connect_tag != 0) + if (G_UNLIKELY (pulse->priv->connect_tag != 0)) break; if (pulse_connection_connect (connection, TRUE) == FALSE) { @@ -785,7 +785,7 @@ on_connection_card_removed (PulseConnection *connection, gchar *name; device = g_hash_table_lookup (pulse->priv->devices, GUINT_TO_POINTER (index)); - if G_UNLIKELY (device == NULL) + if (G_UNLIKELY (device == NULL)) return; name = g_strdup (mate_mixer_device_get_name (MATE_MIXER_DEVICE (device))); @@ -848,7 +848,7 @@ on_connection_sink_removed (PulseConnection *connection, PulseDevice *device; stream = g_hash_table_lookup (pulse->priv->sinks, GUINT_TO_POINTER (idx)); - if G_UNLIKELY (stream == NULL) + if (G_UNLIKELY (stream == NULL)) return; g_object_ref (stream); @@ -887,10 +887,10 @@ on_connection_sink_input_info (PulseConnection *connection, PulseSink *sink = NULL; PulseSink *prev; - if G_LIKELY (info->sink != PA_INVALID_INDEX) + if (G_LIKELY (info->sink != PA_INVALID_INDEX)) sink = g_hash_table_lookup (pulse->priv->sinks, GUINT_TO_POINTER (info->sink)); - if G_UNLIKELY (sink == NULL) { + if (G_UNLIKELY (sink == NULL)) { prev = g_hash_table_lookup (pulse->priv->sink_input_map, GUINT_TO_POINTER (info->index)); if (prev != NULL) { g_debug ("Sink input %u moved from sink %s to an unknown sink %u, removing", @@ -930,7 +930,7 @@ on_connection_sink_input_removed (PulseConnection *connection, PulseSink *sink; sink = g_hash_table_lookup (pulse->priv->sink_input_map, GUINT_TO_POINTER (idx)); - if G_UNLIKELY (sink == NULL) + if (G_UNLIKELY (sink == NULL)) return; remove_sink_input (pulse, sink, idx); @@ -985,7 +985,7 @@ on_connection_source_removed (PulseConnection *connection, PulseStream *stream; stream = g_hash_table_lookup (pulse->priv->sources, GUINT_TO_POINTER (idx)); - if G_UNLIKELY (stream == NULL) + if (G_UNLIKELY (stream == NULL)) return; g_object_ref (stream); @@ -1024,10 +1024,10 @@ on_connection_source_output_info (PulseConnection *connection, PulseSource *source = NULL; PulseSource *prev; - if G_LIKELY (info->source != PA_INVALID_INDEX) + if (G_LIKELY (info->source != PA_INVALID_INDEX)) source = g_hash_table_lookup (pulse->priv->sources, GUINT_TO_POINTER (info->source)); - if G_UNLIKELY (source == NULL) { + if (G_UNLIKELY (source == NULL)) { prev = g_hash_table_lookup (pulse->priv->source_output_map, GUINT_TO_POINTER (info->index)); if (prev != NULL) { g_debug ("Source output %u moved from source %s to an unknown source %u, removing", @@ -1067,7 +1067,7 @@ on_connection_source_output_removed (PulseConnection *connection, PulseSource *source; source = g_hash_table_lookup (pulse->priv->source_output_map, GUINT_TO_POINTER (idx)); - if G_UNLIKELY (source == NULL) + if (G_UNLIKELY (source == NULL)) return; remove_source_output (pulse, source, idx); diff --git a/backends/pulse/pulse-connection.c b/backends/pulse/pulse-connection.c index 0b429ef..b8ca8c5 100644 --- a/backends/pulse/pulse-connection.c +++ b/backends/pulse/pulse-connection.c @@ -410,7 +410,7 @@ pulse_connection_new (const gchar *app_name, PulseConnection *connection; mainloop = pa_glib_mainloop_new (g_main_context_get_thread_default ()); - if G_UNLIKELY (mainloop == NULL) { + if (G_UNLIKELY (mainloop == NULL)) { g_warning ("Failed to create PulseAudio main loop"); return NULL; } @@ -461,7 +461,7 @@ pulse_connection_connect (PulseConnection *connection, gboolean wait_for_daemon) context = pa_context_new_with_proplist (mainloop, NULL, connection->priv->proplist); - if G_UNLIKELY (context == NULL) { + if (G_UNLIKELY (context == NULL)) { g_warning ("Failed to create PulseAudio context"); return FALSE; } @@ -1224,7 +1224,7 @@ load_lists (PulseConnection *connection) GSList *ops = NULL; pa_operation *op; - if G_UNLIKELY (connection->priv->outstanding > 0) { + if (G_UNLIKELY (connection->priv->outstanding > 0)) { g_warn_if_reached (); return FALSE; } @@ -1232,7 +1232,7 @@ load_lists (PulseConnection *connection) op = pa_context_get_card_info_list (connection->priv->context, pulse_card_info_cb, connection); - if G_UNLIKELY (op == NULL) + if (G_UNLIKELY (op == NULL)) goto error; ops = g_slist_prepend (ops, op); @@ -1240,7 +1240,7 @@ load_lists (PulseConnection *connection) op = pa_context_get_sink_info_list (connection->priv->context, pulse_sink_info_cb, connection); - if G_UNLIKELY (op == NULL) + if (G_UNLIKELY (op == NULL)) goto error; ops = g_slist_prepend (ops, op); @@ -1248,7 +1248,7 @@ load_lists (PulseConnection *connection) op = pa_context_get_sink_input_info_list (connection->priv->context, pulse_sink_input_info_cb, connection); - if G_UNLIKELY (op == NULL) + if (G_UNLIKELY (op == NULL)) goto error; ops = g_slist_prepend (ops, op); @@ -1256,7 +1256,7 @@ load_lists (PulseConnection *connection) op = pa_context_get_source_info_list (connection->priv->context, pulse_source_info_cb, connection); - if G_UNLIKELY (op == NULL) + if (G_UNLIKELY (op == NULL)) goto error; ops = g_slist_prepend (ops, op); @@ -1264,7 +1264,7 @@ load_lists (PulseConnection *connection) op = pa_context_get_source_output_info_list (connection->priv->context, pulse_source_output_info_cb, connection); - if G_UNLIKELY (op == NULL) + if (G_UNLIKELY (op == NULL)) goto error; ops = g_slist_prepend (ops, op); @@ -1300,7 +1300,7 @@ load_list_finished (PulseConnection *connection) * as the final step in the connection process */ connection->priv->outstanding--; - if G_UNLIKELY (connection->priv->outstanding < 0) { + if (G_UNLIKELY (connection->priv->outstanding < 0)) { g_warn_if_reached (); connection->priv->outstanding = 0; } @@ -1308,7 +1308,7 @@ load_list_finished (PulseConnection *connection) if (connection->priv->outstanding == 0) { gboolean ret = pulse_connection_load_server_info (connection); - if G_UNLIKELY (ret == FALSE) { + if (G_UNLIKELY (ret == FALSE)) { pulse_connection_disconnect (connection); return FALSE; } @@ -1637,7 +1637,7 @@ change_state (PulseConnection *connection, PulseConnectionState state) static gboolean process_pulse_operation (PulseConnection *connection, pa_operation *op) { - if G_UNLIKELY (op == NULL) { + if (G_UNLIKELY (op == NULL)) { g_warning ("PulseAudio operation failed: %s", pa_strerror (pa_context_errno (connection->priv->context))); return FALSE; diff --git a/backends/pulse/pulse-device-switch.c b/backends/pulse/pulse-device-switch.c index 5e82e1f..2d4c7c0 100644 --- a/backends/pulse/pulse-device-switch.c +++ b/backends/pulse/pulse-device-switch.c @@ -126,7 +126,7 @@ pulse_device_switch_set_active_profile_by_name (PulseDeviceSwitch *swtch, const g_return_if_fail (name != NULL); item = g_list_find_custom (swtch->priv->profiles, name, compare_profile_name); - if G_UNLIKELY (item == NULL) { + if (G_UNLIKELY (item == NULL)) { g_debug ("Invalid device switch profile name %s", name); return; } @@ -144,7 +144,7 @@ pulse_device_switch_set_active_option (MateMixerSwitch *mms, MateMixerSwitchOpti g_return_val_if_fail (PULSE_IS_DEVICE_PROFILE (mmso), FALSE); device = mate_mixer_device_switch_get_device (MATE_MIXER_DEVICE_SWITCH (mms)); - if G_UNLIKELY (device == NULL) + if (G_UNLIKELY (device == NULL)) return FALSE; device_name = mate_mixer_device_get_name (device); diff --git a/backends/pulse/pulse-device.c b/backends/pulse/pulse-device.c index 0f11949..6f75c39 100644 --- a/backends/pulse/pulse-device.c +++ b/backends/pulse/pulse-device.c @@ -225,11 +225,11 @@ pulse_device_new (PulseConnection *connection, const pa_card_info *info) g_return_val_if_fail (info != NULL, NULL); label = pa_proplist_gets (info->proplist, PA_PROP_DEVICE_DESCRIPTION); - if G_UNLIKELY (label == NULL) + if (G_UNLIKELY (label == NULL)) label = info->name; icon = pa_proplist_gets (info->proplist, PA_PROP_DEVICE_ICON_NAME); - if G_UNLIKELY (icon == NULL) + if (G_UNLIKELY (icon == NULL)) icon = "audio-card"; /* Consider the device index as unchanging parameter */ @@ -253,7 +253,7 @@ pulse_device_update (PulseDevice *device, const pa_card_info *info) g_return_if_fail (PULSE_IS_DEVICE (device)); g_return_if_fail (info != NULL); - if G_LIKELY (info->active_profile2 != NULL) + if (G_LIKELY (info->active_profile2 != NULL)) pulse_device_switch_set_active_profile_by_name (device->priv->pswitch, info->active_profile2->name); } diff --git a/backends/pulse/pulse-ext-stream.c b/backends/pulse/pulse-ext-stream.c index 39f8f1e..beefe1a 100644 --- a/backends/pulse/pulse-ext-stream.c +++ b/backends/pulse/pulse-ext-stream.c @@ -279,7 +279,7 @@ pulse_ext_stream_new (PulseConnection *connection, suffix++; if (strstr (info->name, "-by-media-role:")) { - if G_LIKELY (suffix != NULL) + if (G_LIKELY (suffix != NULL)) media_role = pulse_convert_media_role_name (suffix); } else if (strstr (info->name, "-by-application-name:")) { @@ -291,7 +291,7 @@ pulse_ext_stream_new (PulseConnection *connection, if (app_info == NULL) app_info = _mate_mixer_app_info_new (); - if G_LIKELY (suffix != NULL) + if (G_LIKELY (suffix != NULL)) _mate_mixer_app_info_set_name (app_info, suffix); } else if (strstr (info->name, "-by-application-id:")) { @@ -303,7 +303,7 @@ pulse_ext_stream_new (PulseConnection *connection, if (app_info == NULL) app_info = _mate_mixer_app_info_new (); - if G_LIKELY (suffix != NULL) + if (G_LIKELY (suffix != NULL)) _mate_mixer_app_info_set_id (app_info, suffix); } diff --git a/backends/pulse/pulse-port-switch.c b/backends/pulse/pulse-port-switch.c index 46871a0..549c961 100644 --- a/backends/pulse/pulse-port-switch.c +++ b/backends/pulse/pulse-port-switch.c @@ -118,7 +118,7 @@ pulse_port_switch_set_active_port_by_name (PulsePortSwitch *swtch, const gchar * g_return_if_fail (name != NULL); item = g_list_find_custom (swtch->priv->ports, name, compare_port_name); - if G_UNLIKELY (item == NULL) { + if (G_UNLIKELY (item == NULL)) { g_debug ("Invalid switch port name %s", name); return; } diff --git a/backends/pulse/pulse-sink-control.c b/backends/pulse/pulse-sink-control.c index 674e09f..c5696bf 100644 --- a/backends/pulse/pulse-sink-control.c +++ b/backends/pulse/pulse-sink-control.c @@ -149,7 +149,7 @@ pulse_sink_control_create_monitor (PulseStreamControl *psc) sink = PULSE_SINK (mate_mixer_stream_control_get_stream (MATE_MIXER_STREAM_CONTROL (psc))); index = pulse_sink_get_index_monitor (sink); - if G_UNLIKELY (index == PA_INVALID_INDEX) { + if (G_UNLIKELY (index == PA_INVALID_INDEX)) { g_debug ("Monitor of stream control %s is not available", mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (psc))); return NULL; diff --git a/backends/pulse/pulse-sink-input.c b/backends/pulse/pulse-sink-input.c index c37502f..addff14 100644 --- a/backends/pulse/pulse-sink-input.c +++ b/backends/pulse/pulse-sink-input.c @@ -225,7 +225,7 @@ pulse_sink_input_create_monitor (PulseStreamControl *psc) sink = PULSE_SINK (mate_mixer_stream_control_get_stream (MATE_MIXER_STREAM_CONTROL (psc))); index = pulse_sink_get_index_monitor (sink); - if G_UNLIKELY (index == PA_INVALID_INDEX) { + if (G_UNLIKELY (index == PA_INVALID_INDEX)) { g_debug ("Monitor of stream control %s is not available", mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (psc))); return NULL; diff --git a/backends/pulse/pulse-sink.c b/backends/pulse/pulse-sink.c index c882aa0..6d05b26 100644 --- a/backends/pulse/pulse-sink.c +++ b/backends/pulse/pulse-sink.c @@ -224,7 +224,7 @@ pulse_sink_remove_input (PulseSink *sink, guint32 index) g_return_if_fail (PULSE_IS_SINK (sink)); input = g_hash_table_lookup (sink->priv->inputs, GUINT_TO_POINTER (index)); - if G_UNLIKELY (input == NULL) + if (G_UNLIKELY (input == NULL)) return; name = g_strdup (mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (input))); diff --git a/backends/pulse/pulse-source-control.c b/backends/pulse/pulse-source-control.c index 57c0b21..68e149f 100644 --- a/backends/pulse/pulse-source-control.c +++ b/backends/pulse/pulse-source-control.c @@ -142,7 +142,7 @@ pulse_source_control_create_monitor (PulseStreamControl *psc) g_return_val_if_fail (PULSE_IS_SOURCE_CONTROL (psc), NULL); index = pulse_stream_control_get_stream_index (psc); - if G_UNLIKELY (index == PA_INVALID_INDEX) { + if (G_UNLIKELY (index == PA_INVALID_INDEX)) { g_debug ("Monitor of stream control %s is not available", mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (psc))); return NULL; diff --git a/backends/pulse/pulse-source.c b/backends/pulse/pulse-source.c index 4275f9a..8b1b562 100644 --- a/backends/pulse/pulse-source.c +++ b/backends/pulse/pulse-source.c @@ -220,7 +220,7 @@ pulse_source_remove_output (PulseSource *source, guint32 index) g_return_if_fail (PULSE_IS_SOURCE (source)); output = g_hash_table_lookup (source->priv->outputs, GUINT_TO_POINTER (index)); - if G_UNLIKELY (output == NULL) + if (G_UNLIKELY (output == NULL)) return; name = g_strdup (mate_mixer_stream_control_get_name (MATE_MIXER_STREAM_CONTROL (output))); diff --git a/backends/pulse/pulse-stream-control.c b/backends/pulse/pulse-stream-control.c index f0625f3..5c3b631 100644 --- a/backends/pulse/pulse-stream-control.c +++ b/backends/pulse/pulse-stream-control.c @@ -277,7 +277,7 @@ pulse_stream_control_get_stream_index (PulseStreamControl *control) g_return_val_if_fail (PULSE_IS_STREAM_CONTROL (control), PA_INVALID_INDEX); stream = mate_mixer_stream_control_get_stream (MATE_MIXER_STREAM_CONTROL (control)); - if G_UNLIKELY (stream == NULL) + if (G_UNLIKELY (stream == NULL)) return PA_INVALID_INDEX; return pulse_stream_get_index (PULSE_STREAM (stream)); @@ -322,7 +322,7 @@ pulse_stream_control_set_app_info (PulseStreamControl *control, { g_return_if_fail (PULSE_IS_STREAM_CONTROL (control)); - if G_UNLIKELY (control->priv->app_info != NULL) + if (G_UNLIKELY (control->priv->app_info != NULL)) _mate_mixer_app_info_free (control->priv->app_info); if (take == TRUE) @@ -653,7 +653,7 @@ pulse_stream_control_set_monitor_enabled (MateMixerStreamControl *mmsc, gboolean control->priv->monitor = PULSE_STREAM_CONTROL_GET_CLASS (control)->create_monitor (control); - if G_UNLIKELY (control->priv->monitor == NULL) + if (G_UNLIKELY (control->priv->monitor == NULL)) return FALSE; g_signal_connect (G_OBJECT (control->priv->monitor), diff --git a/libmatemixer/matemixer-backend-module.c b/libmatemixer/matemixer-backend-module.c index ce88f6d..3f419c5 100644 --- a/libmatemixer/matemixer-backend-module.c +++ b/libmatemixer/matemixer-backend-module.c @@ -257,7 +257,7 @@ backend_module_load (GTypeModule *type_module) /* Make sure get_info() returns something, so we can avoid checking it * in other parts of the library */ - if G_UNLIKELY (module->priv->get_info () == NULL) { + if (G_UNLIKELY (module->priv->get_info () == NULL)) { g_critical ("Backend module %s does not provide module information", module->priv->path); diff --git a/libmatemixer/matemixer-backend.c b/libmatemixer/matemixer-backend.c index d6e78d2..db33b06 100644 --- a/libmatemixer/matemixer-backend.c +++ b/libmatemixer/matemixer-backend.c @@ -529,7 +529,7 @@ device_added (MateMixerBackend *backend, const gchar *name) MateMixerDevice *device; device = mate_mixer_backend_get_device (backend, name); - if G_UNLIKELY (device == NULL) { + if (G_UNLIKELY (device == NULL)) { g_warn_if_reached (); return; } @@ -558,7 +558,7 @@ device_removed (MateMixerBackend *backend, const gchar *name) MateMixerDevice *device; device = g_hash_table_lookup (backend->priv->devices, name); - if G_UNLIKELY (device == NULL) { + if (G_UNLIKELY (device == NULL)) { g_warn_if_reached (); return; } diff --git a/libmatemixer/matemixer-context.c b/libmatemixer/matemixer-context.c index 5cf2926..fd727d7 100644 --- a/libmatemixer/matemixer-context.c +++ b/libmatemixer/matemixer-context.c @@ -866,8 +866,8 @@ mate_mixer_context_open (MateMixerContext *context) state = mate_mixer_backend_get_state (context->priv->backend); - if G_UNLIKELY (state != MATE_MIXER_STATE_READY && - state != MATE_MIXER_STATE_CONNECTING) { + if (G_UNLIKELY (state != MATE_MIXER_STATE_READY && + state != MATE_MIXER_STATE_CONNECTING)) { /* This would be a backend bug */ g_warn_if_reached (); @@ -1377,8 +1377,8 @@ try_next_backend (MateMixerContext *context) state = mate_mixer_backend_get_state (context->priv->backend); - if G_UNLIKELY (state != MATE_MIXER_STATE_READY && - state != MATE_MIXER_STATE_CONNECTING) { + if (G_UNLIKELY (state != MATE_MIXER_STATE_READY && + state != MATE_MIXER_STATE_CONNECTING)) { /* This would be a backend bug */ g_warn_if_reached (); diff --git a/libmatemixer/matemixer-device.c b/libmatemixer/matemixer-device.c index a53aa98..6ef3e34 100644 --- a/libmatemixer/matemixer-device.c +++ b/libmatemixer/matemixer-device.c @@ -427,7 +427,7 @@ mate_mixer_device_list_streams (MateMixerDevice *device) klass = MATE_MIXER_DEVICE_GET_CLASS (device); - if G_LIKELY (klass->list_streams != NULL) + if (G_LIKELY (klass->list_streams != NULL)) return klass->list_streams (device); return NULL; @@ -461,7 +461,7 @@ mate_mixer_device_list_switches (MateMixerDevice *device) klass = MATE_MIXER_DEVICE_GET_CLASS (device); - if G_LIKELY (klass->list_switches != NULL) + if (G_LIKELY (klass->list_switches != NULL)) return klass->list_switches (device); return NULL; diff --git a/libmatemixer/matemixer-stream-toggle.c b/libmatemixer/matemixer-stream-toggle.c index 6a948d6..af79c7a 100644 --- a/libmatemixer/matemixer-stream-toggle.c +++ b/libmatemixer/matemixer-stream-toggle.c @@ -220,7 +220,7 @@ mate_mixer_stream_toggle_get_state (MateMixerStreamToggle *toggle) g_return_val_if_fail (MATE_MIXER_IS_STREAM_TOGGLE (toggle), FALSE); active = mate_mixer_switch_get_active_option (MATE_MIXER_SWITCH (toggle)); - if G_UNLIKELY (active == NULL) + if (G_UNLIKELY (active == NULL)) return FALSE; if (active == toggle->priv->on) @@ -273,7 +273,7 @@ mate_mixer_stream_toggle_set_state (MateMixerStreamToggle *toggle, gboolean stat else active = toggle->priv->off; - if G_UNLIKELY (active == NULL) + if (G_UNLIKELY (active == NULL)) return FALSE; return mate_mixer_switch_set_active_option (MATE_MIXER_SWITCH (toggle), active); @@ -307,10 +307,10 @@ mate_mixer_stream_toggle_list_options (MateMixerSwitch *swtch) toggle = MATE_MIXER_STREAM_TOGGLE (swtch); if (toggle->priv->options == NULL) { - if G_LIKELY (toggle->priv->off != NULL) + if (G_LIKELY (toggle->priv->off != NULL)) toggle->priv->options = g_list_prepend (toggle->priv->options, toggle->priv->off); - if G_LIKELY (toggle->priv->on != NULL) + if (G_LIKELY (toggle->priv->on != NULL)) toggle->priv->options = g_list_prepend (toggle->priv->options, toggle->priv->on); } diff --git a/libmatemixer/matemixer-stream.c b/libmatemixer/matemixer-stream.c index 591e286..ca7bc81 100644 --- a/libmatemixer/matemixer-stream.c +++ b/libmatemixer/matemixer-stream.c @@ -414,7 +414,7 @@ mate_mixer_stream_list_controls (MateMixerStream *stream) klass = MATE_MIXER_STREAM_GET_CLASS (stream); - if G_LIKELY (klass->list_controls != NULL) + if (G_LIKELY (klass->list_controls != NULL)) return klass->list_controls (stream); return NULL; @@ -433,7 +433,7 @@ mate_mixer_stream_list_switches (MateMixerStream *stream) klass = MATE_MIXER_STREAM_GET_CLASS (stream); - if G_LIKELY (klass->list_switches != NULL) + if (G_LIKELY (klass->list_switches != NULL)) return klass->list_switches (stream); return NULL; diff --git a/libmatemixer/matemixer.c b/libmatemixer/matemixer.c index 1c09c7b..e32569b 100644 --- a/libmatemixer/matemixer.c +++ b/libmatemixer/matemixer.c @@ -149,7 +149,7 @@ load_modules (void) if (loaded == TRUE) return; - if G_LIKELY (g_module_supported () == TRUE) { + if (G_LIKELY (g_module_supported () == TRUE)) { GDir *dir; GError *error = NULL; |