From cf84be0ed0b23f4b938218cec4819b841aaf65e7 Mon Sep 17 00:00:00 2001 From: Yunhee Seo Date: Thu, 30 Nov 2023 10:06:49 +0900 Subject: [PATCH] sound: Relocate macro related to parse With the sound-parser separated out, there was no need to place macros on sound.c It is correct to place conf file path in sound-parser that actually uses the path. Furthermore, unnecessary function parameter pass has also been deleted. Change-Id: Ib9e66f01261e51152a6a5d0b41231922ae2d1f1d Signed-off-by: Yunhee Seo --- src/sound-parser.c | 6 ++++-- src/sound-parser.h | 2 +- src/sound.c | 4 +--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sound-parser.c b/src/sound-parser.c index 7a367e3..ba3c865 100644 --- a/src/sound-parser.c +++ b/src/sound-parser.c @@ -28,6 +28,8 @@ #include "sound-theme-manager.h" #define INITIAL_DEFAULT_SOUND_THEME_ID -1 +#define SOUND_CONF_FILE FEEDBACK_SYS_RO_SHARE"/feedback/sound.conf" + static int default_sound_theme_id = INITIAL_DEFAULT_SOUND_THEME_ID; static GHashTable *g_hash_table_to_check_id_duplicated; @@ -136,14 +138,14 @@ out_parsing_fail: return -EPERM; } -int sound_parser_init(const char* sound_file_path) +int sound_parser_init(void) { int ret = 0; g_hash_table_to_check_id_duplicated = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, g_free); - ret = syscommon_config_parse_by_section(sound_file_path, parse_sound_theme_section, NULL); + ret = syscommon_config_parse_by_section(SOUND_CONF_FILE, parse_sound_theme_section, NULL); if (!is_default_theme_id_set()) { _E("Failed to parse sound conf file. There is no default sound theme id"); diff --git a/src/sound-parser.h b/src/sound-parser.h index f72791d..b54fcf7 100644 --- a/src/sound-parser.h +++ b/src/sound-parser.h @@ -18,7 +18,7 @@ #ifndef __SOUND_PARSER_H__ #define __SOUND_PARSER_H__ -int sound_parser_init(const char* sound_file_path); +int sound_parser_init(void); void sound_parser_exit(void); #endif \ No newline at end of file diff --git a/src/sound.c b/src/sound.c index d73f423..1f6d33d 100644 --- a/src/sound.c +++ b/src/sound.c @@ -40,8 +40,6 @@ #include "sound-parser.h" #include "sound-theme-manager.h" -#define SOUND_CONF_FILE FEEDBACK_SYS_RO_SHARE"/feedback/sound.conf" -#define SOUND_NAME "Sound" /* Temporary keys */ #ifndef VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL #define VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL "db/setting/sound/button_sounds" @@ -149,7 +147,7 @@ static void sound_init(void) sound_thememan_exit(); } - ret = sound_parser_init(SOUND_CONF_FILE); + ret = sound_parser_init(); if (ret < 0) { _E("Failed to parsing sound config file(%d)", ret); sound_thememan_exit(); -- 2.34.1