[PATCH 2/2] cli, nas: fix constant out of range issue in comparison

Aleksander Morgado aleksander at aleksander.es
Thu May 29 23:44:10 PDT 2014


On 30/05/14 07:25, Ben Chan wrote:
> This patch fixes a constant out of range issue in the following comparison:
> 
> qmicli-nas.c:2407:24: error: comparison of constant 4294967295 with expression of type 'guint16' (aka 'unsigned short')
>       is always false [-Werror,-Wtautological-constant-out-of-range-compare]
>         if (cell_id_16 == 0xFFFFFFFF)
>             ~~~~~~~~~~ ^  ~~~~~~~~~~

Pushed to git master, thanks.

> ---
>  src/qmicli/qmicli-nas.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qmicli/qmicli-nas.c b/src/qmicli/qmicli-nas.c
> index 015ff71..fb0c803 100644
> --- a/src/qmicli/qmicli-nas.c
> +++ b/src/qmicli/qmicli-nas.c
> @@ -2404,7 +2404,7 @@ get_cell_location_info_ready (QmiClientNas *client,
>          gchar *plmn;
>  
>          g_print ("UMTS Info\n");
> -        if (cell_id_16 == 0xFFFFFFFF)
> +        if (cell_id_16 == 0xFFFF)
>              g_print ("\tCell ID: 'unavailable'\n");
>          else
>              g_print ("\tCell ID: '%" G_GUINT16_FORMAT"'\n", cell_id_16);
> 


-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list