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

Ben Chan benchan at chromium.org
Thu May 29 22:25:39 PDT 2014


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)
            ~~~~~~~~~~ ^  ~~~~~~~~~~
---
 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);
-- 
1.9.1.423.g4596e3a



More information about the libqmi-devel mailing list