From 2957fa6d7ce60e2e7faec6a86702ad2c960f0bf6 Mon Sep 17 00:00:00 2001 From: Hyunil Date: Tue, 11 Feb 2020 10:21:14 +0900 Subject: [PATCH] Change iniparser api return type by iniparser version upgrade Change-Id: If6c0ee230fc88c1e69f1cda1d543ae96e3728ad6 Signed-off-by: Hyunil --- packaging/capi-media-streamer.spec | 2 +- src/media_streamer_util.c | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/packaging/capi-media-streamer.spec b/packaging/capi-media-streamer.spec index e20326f..efff068 100644 --- a/packaging/capi-media-streamer.spec +++ b/packaging/capi-media-streamer.spec @@ -1,6 +1,6 @@ Name: capi-media-streamer Summary: A Media Streamer API -Version: 0.1.24 +Version: 0.1.25 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/media_streamer_util.c b/src/media_streamer_util.c index 3969ba9..5208632 100644 --- a/src/media_streamer_util.c +++ b/src/media_streamer_util.c @@ -91,21 +91,16 @@ static void __ms_check_ini_status(void); gchar *__ms_ini_get_string(const char *ini_path, char *default_str) { - gchar *result_str = NULL; + const char *result_str = default_str; ms_debug_fenter(); ms_retvm_if(ini_path == NULL, NULL, "Invalid ini path"); - if (__ms_get_ini_instance() == NULL) { - result_str = default_str; - } else { - gchar *str = NULL; - str = iniparser_getstring(__ms_get_ini_instance(), ini_path, default_str); + if (__ms_get_ini_instance()) { + const char *str = iniparser_getstring(__ms_get_ini_instance(), ini_path, default_str); if (str && (strlen(str) > 0) && (strlen(str) < INI_MAX_STRLEN)) result_str = str; - else - result_str = default_str; } ms_debug_fleave(); @@ -140,7 +135,7 @@ dictionary *__ms_get_ini_instance(void) void __ms_ini_read_list(const char *key, gchar ***list) { - char *str; + const gchar *str; ms_debug_fenter(); @@ -172,7 +167,7 @@ void __ms_load_ini_settings(media_streamer_ini_t *ini) /* general */ ini->generate_dot = iniparser_getboolean(__ms_get_ini_instance(), "general:generate dot", DEFAULT_GENERATE_DOT); if (ini->generate_dot == TRUE) { - gchar *dot_path = iniparser_getstring(__ms_get_ini_instance(), "general:dot dir", MEDIA_STREAMER_DEFAULT_DOT_DIR); + const gchar *dot_path = iniparser_getstring(__ms_get_ini_instance(), "general:dot dir", MEDIA_STREAMER_DEFAULT_DOT_DIR); ms_debug("generate_dot is TRUE, dot file will be stored into %s", dot_path); g_setenv("GST_DEBUG_DUMP_DOT_DIR", dot_path, FALSE); } -- 2.7.4