[pulseaudio-discuss] [PATCH] switch-on-port-available: Silence gcc warning.

David Henningsson david.henningsson at canonical.com
Mon Apr 29 06:52:45 PDT 2013


On 04/19/2013 04:35 PM, poljar (Damir Jelić) wrote:
> This silences this gcc warning:
> module-switch-on-port-available.c:111:12: warning:
>      'good' may be used uninitialized in this function
> ---
>   src/modules/module-switch-on-port-available.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c
> index 82ccb12..1c40295 100644
> --- a/src/modules/module-switch-on-port-available.c
> +++ b/src/modules/module-switch-on-port-available.c
> @@ -92,7 +92,7 @@ static int try_to_switch_profile(pa_device_port *port) {
>       pa_log_debug("Finding best profile");
>
>       PA_HASHMAP_FOREACH(profile, port->profiles, state) {
> -        bool good;
> +        bool good = false;
>
>           if (best_profile && best_profile->priority >= profile->priority)
>               continue;
>

Applied, thanks. I'd probably have added "switch default" instead, but 
that's bikeshedding.


-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


More information about the pulseaudio-discuss mailing list