From c1dea1433608c57798b2f202082d6667b933e71f Mon Sep 17 00:00:00 2001 From: Jeonghoon Park Date: Thu, 21 Jun 2018 17:48:25 +0900 Subject: [PATCH] fix build failure Change-Id: Id73b55f89105bb8eeb895b0d521d45f7eff58c20 --- lib/things-service/CMakeLists.txt | 1 + lib/things-service/src/things-service.c | 21 ++++++++------------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/things-service/CMakeLists.txt b/lib/things-service/CMakeLists.txt index 17291b8..8581190 100644 --- a/lib/things-service/CMakeLists.txt +++ b/lib/things-service/CMakeLists.txt @@ -11,6 +11,7 @@ pkg_check_modules(LIB_TTS_PKGS REQUIRED gio-unix-2.0 capi-appfw-app-common dlog + json-c ) FOREACH (flag ${LIB_TTS_PKGS_CFLAGS}) diff --git a/lib/things-service/src/things-service.c b/lib/things-service/src/things-service.c index 8771cae..4835eb3 100644 --- a/lib/things-service/src/things-service.c +++ b/lib/things-service/src/things-service.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "log-private.h" #include "things-service.h" #include "common-app-inf.h" @@ -76,9 +77,9 @@ __add_timebased_int_to_json_object(gpointer data, gpointer user_data) ret_if(!a_obj); obj = json_object_new_object(); - retv_if(!obj); + ret_if(!obj); - time_o = json_object_new_int64(tb_int->time); + time_o = json_object_new_int64(tb_int->i_time); goto_if(!time_o, ERROR); json_object_object_add(obj, "x", time_o); @@ -103,13 +104,13 @@ __add_timebased_double_to_json_object(gpointer data, gpointer user_data) struct json_object *value_o = NULL; struct json_object *time_o = NULL; - ret_if(!tb_int); + ret_if(!tb_double); ret_if(!a_obj); obj = json_object_new_object(); - retv_if(!obj, NULL); + ret_if(!obj); - time_o = json_object_new_int64(tb_double->time); + time_o = json_object_new_int64(tb_double->i_time); goto_if(!time_o, ERROR); json_object_object_add(obj, "x", time_o); @@ -131,8 +132,6 @@ static char *__timebased_data_to_json(timebased_data *tb_data) struct json_object *obj = NULL; struct json_object *a_obj = NULL; char *json_str = NULL; - int i = 0; - GList *temp_l = NULL; retv_if(!tb_data, NULL); retvm_if(!((tb_data->type == TS_VALUE_TYPE_INT) || @@ -157,7 +156,7 @@ static char *__timebased_data_to_json(timebased_data *tb_data) break; default: _E("invalid type [%d]", tb_data->type); - goto ERROR: + goto ERROR; break; } @@ -538,11 +537,7 @@ void thing_service_timebased_data_free(timebased_data *tb_data) { ret_if(!tb_data); - t_data = g_try_malloc0(sizeof(timebased_data)); - if (!t_data) - return NULL; - - if (t_data->v_list) + if (tb_data->v_list) g_list_free_full(tb_data->v_list, __timebase_value_free); g_free(tb_data); -- 2.7.4