From f2f5d6d9079506f31cf64fbd99697ba6f99b429e Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Mon, 17 Jun 2019 13:04:06 -0700 Subject: binding: bluetooth: fix conversion compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove follow warnings by switching from int to size_t warning: conversion from ‘size_t’ {aka ‘long unsigned int’} to ‘int’ may change value [-Wconversion] Bug-AGL: SPEC-2535 Change-Id: I28330f92097adc6aa03480078d168d37a60fc051 Signed-off-by: Matt Ranostay --- binding/bluetooth-util.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/binding/bluetooth-util.c b/binding/bluetooth-util.c index f07e5ed..a70de5d 100644 --- a/binding/bluetooth-util.c +++ b/binding/bluetooth-util.c @@ -68,7 +68,8 @@ int str2boolean(const char *value) json_object *json_object_copy(json_object *jval) { json_object *jobj; - int i, len; + size_t len; + int i; /* handle NULL */ if (!jval) @@ -682,7 +683,8 @@ GVariant *property_json_to_gvariant( double d; const char *jvalstr, *str; char c; - int i, len; + size_t len; + int i; gboolean is_config; if (!fmt) @@ -922,7 +924,8 @@ GVariant *property_json_to_gvariant( json_object *get_property_collect(json_object *jreqprop, json_object *jprop, GError **error) { - int i, len; + size_t len; + int i; json_object *jkey, *jval, *jobj = NULL, *jobjval; const char *key; @@ -1067,7 +1070,7 @@ gchar *return_bluez_path(afb_req_t request) { gchar **json_array_to_strv(json_object *jobj) { - int len = json_object_array_length(jobj); + size_t len = json_object_array_length(jobj); gchar **val = g_malloc0(sizeof(gchar *) * (len + 1)); int i; -- cgit 1.2.3-korg