From 42dae33e054afb0da85d4376f8ae66bb4867cf99 Mon Sep 17 00:00:00 2001 From: Li Xiaoming Date: Wed, 4 Sep 2019 13:52:55 +0800 Subject: fix(network-util.c): Remove -Woverflow warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit agl-service-network/binding/network-util.c:160:14: warning: integer overflow in expression ‘-2147483648’ of type ‘long int’ results in ‘-2147483648’ [-Woverflow] if (i64 >= -(1L << 31) && i64 < (1L << 31)) Bug-AGL: SPEC-2422 Change-Id: I3bdc78527b1fff44917561ea49dcfefa7a4d83a2 Signed-off-by: Li Xiaoming --- binding/network-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binding/network-util.c b/binding/network-util.c index 0dab808..3bb1b99 100644 --- a/binding/network-util.c +++ b/binding/network-util.c @@ -157,7 +157,7 @@ json_object *simple_gvariant_to_json(GVariant *var, json_object *parent, break; case G_VARIANT_CLASS_INT64: i64 = g_variant_get_int64(var); - if (i64 >= -(1L << 31) && i64 < (1L << 31)) + if (i64 >= -(1LL << 31) && i64 < (1LL << 31)) obj = json_object_new_int((int)i64); else obj = json_object_new_int64(i64); -- cgit 1.2.3-korg