diff options
author | jy910.yun <jy910.yun@samsung.com> | 2013-10-02 21:10:40 +0900 |
---|---|---|
committer | jy910.yun <jy910.yun@samsung.com> | 2013-10-02 21:19:07 +0900 |
commit | c69625b8c85ade044959d5385f70ba4823d1b217 (patch) | |
tree | 49b8fe011f83b942505a99f910cd90a2b4c0f867 | |
parent | f71c50c7273bfe7e3bcf78ca3f795f66a7587258 (diff) | |
download | libsvi-c69625b8c85ade044959d5385f70ba4823d1b217.tar.gz libsvi-c69625b8c85ade044959d5385f70ba4823d1b217.tar.bz2 libsvi-c69625b8c85ade044959d5385f70ba4823d1b217.zip |
code cleaning
change the internal header file name to make it simple
revise warning issues
Change-Id: Icea301ae95781a5fa73966cf49e17ee2f71c447b
Signed-off-by: jy910.yun <jy910.yun@samsung.com>
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | include/common.h (renamed from include/feedback-internal.h) | 13 | ||||
-rw-r--r-- | include/log.h (renamed from include/feedback-log.h) | 6 | ||||
-rw-r--r-- | src/devices.c | 4 | ||||
-rw-r--r-- | src/feedback.c | 7 | ||||
-rw-r--r-- | src/sound.c | 7 | ||||
-rw-r--r-- | src/str.c (renamed from include/feedback-str.h) | 9 | ||||
-rw-r--r-- | src/vibrator.c | 9 | ||||
-rw-r--r-- | src/xmlparser.c | 12 |
9 files changed, 32 insertions, 38 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bcfaa4..69fe1c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,8 @@ SET(SRCS src/sound.c src/vibrator.c src/xmlparser.c - src/feedback.c) + src/feedback.c + src/str.c) SET(HEADERS SLP_FEEDBACK_PG.h diff --git a/include/feedback-internal.h b/include/common.h index a4f34bd..0113c02 100644 --- a/include/feedback-internal.h +++ b/include/common.h @@ -16,17 +16,15 @@ */ -#ifndef __FEEDBACK_INTERNAL_H__ -#define __FEEDBACK_INTERNAL_H__ - -#include "feedback-ids.h" +#ifndef __COMMON_H__ +#define __COMMON_H__ #ifdef __cplusplus extern "C" { #endif /** - * @file feedback-internal.h + * @file common.h * @brief This file contains the common information */ @@ -37,8 +35,11 @@ extern "C" { extern int callstatus; +extern const char *str_type[]; +extern const char *str_pattern[]; + #ifdef __cplusplus } #endif -#endif //__FEEDBACK_INTERNAL_H__ +#endif diff --git a/include/feedback-log.h b/include/log.h index f11dfbd..7237f82 100644 --- a/include/feedback-log.h +++ b/include/log.h @@ -16,8 +16,8 @@ */ -#ifndef __FEEDBACK_LOG_H__ -#define __FEEDBACK_LOG_H__ +#ifndef __LOG_H__ +#define __LOG_H__ #define FEATURE_FEEDBACK_DLOG @@ -31,4 +31,4 @@ #define FEEDBACK_ERROR(x, ...) #endif -#endif //__FEEDBACK_LOG_H__ +#endif //__LOG_H__ diff --git a/src/devices.c b/src/devices.c index ac7fbbf..970de55 100644 --- a/src/devices.c +++ b/src/devices.c @@ -21,8 +21,8 @@ #include <glib.h> #include "devices.h" -#include "feedback-str.h" -#include "feedback-log.h" +#include "common.h" +#include "log.h" #define DD_LIST_PREPEND(a, b) \ a = g_list_prepend(a, b) diff --git a/src/feedback.c b/src/feedback.c index 1ef742e..5243924 100644 --- a/src/feedback.c +++ b/src/feedback.c @@ -23,9 +23,8 @@ #include <vconf.h> #include "feedback.h" -#include "feedback-internal.h" -#include "feedback-str.h" -#include "feedback-log.h" +#include "common.h" +#include "log.h" #include "devices.h" #ifndef API @@ -63,8 +62,6 @@ static feedback_pattern_e get_alert_on_call_key(feedback_pattern_e pattern) API int feedback_initialize() { - int err = -1; - if (binit) return FEEDBACK_ERROR_NONE; diff --git a/src/sound.c b/src/sound.c index 39d9b4b..d903e3a 100644 --- a/src/sound.c +++ b/src/sound.c @@ -27,10 +27,9 @@ #include <vconf.h> #include <mm_sound_private.h> -#include "feedback.h" -#include "feedback-internal.h" -#include "feedback-str.h" -#include "feedback-log.h" +#include "feedback-ids.h" +#include "common.h" +#include "log.h" #include "devices.h" #define FEEDBACK_SOUND_DIR FEEDBACK_DATA_DIR"/sound" diff --git a/include/feedback-str.h b/src/str.c index 0e41857..fb70365 100644 --- a/include/feedback-str.h +++ b/src/str.c @@ -16,10 +16,9 @@ */ -#ifndef __FEEDBACK_STR_H__ -#define __FEEDBACK_STR_H__ +#include <stdio.h> -static const char *str_type[] = +const char *str_type[] = { "FEEDBACK_TYPE_NONE", "FEEDBACK_TYPE_SOUND", @@ -27,7 +26,7 @@ static const char *str_type[] = "FEEDBACK_TYPE_END", }; -static const char *str_pattern[] = +const char *str_pattern[] = { "FEEDBACK_PATTERN_TAP", "FEEDBACK_PATTERN_SIP", @@ -80,5 +79,3 @@ static const char *str_pattern[] = "FEEDBACK_PATTERN_SLIDER_SWEEP", "FEEDBACK_PATTERN_VOLUME_KEY", }; - -#endif //__FEEDBACK_STR_H__ diff --git a/src/vibrator.c b/src/vibrator.c index 815145d..2e8cfdf 100644 --- a/src/vibrator.c +++ b/src/vibrator.c @@ -27,12 +27,11 @@ #include <vconf.h> #include <haptic.h> -#include "feedback.h" -#include "feedback-internal.h" -#include "feedback-str.h" -#include "feedback-log.h" -#include "xmlparser.h" +#include "feedback-ids.h" +#include "common.h" +#include "log.h" #include "devices.h" +#include "xmlparser.h" #define FEEDBACK_HAPTIC_DIR FEEDBACK_DATA_DIR"/haptic" #define FEEDBACK_HAPTIC_TOUCH_DIR FEEDBACK_HAPTIC_DIR"/touch" diff --git a/src/xmlparser.c b/src/xmlparser.c index d7d1837..39a7666 100644 --- a/src/xmlparser.c +++ b/src/xmlparser.c @@ -21,9 +21,9 @@ #include <glib.h> #include "xmlparser.h" -#include "feedback-log.h" +#include "log.h" -static const xmlChar* data_str[] = { +static const char* data_str[] = { [XML_LABEL] = "label", [XML_DATA] = "data", }; @@ -57,7 +57,7 @@ static int xml_compare(xmlDocPtr doc, xmlNodePtr cur, const xmlChar* expr) assert(expr); for (node = cur->children; node != NULL; node = node->next) { - if (xmlStrcmp(node->name, data_str[XML_LABEL])) + if (xmlStrcmp(node->name, (const xmlChar*)data_str[XML_LABEL])) continue; key = xmlNodeListGetString(doc, node->children, 1); @@ -105,7 +105,7 @@ struct xmlData *xml_parse(xmlDocPtr doc, xmlNodePtr cur) xmlNodePtr node; struct xmlData *data; char *b64_data; - int len; + unsigned int len; assert(doc); assert(cur); @@ -118,10 +118,10 @@ struct xmlData *xml_parse(xmlDocPtr doc, xmlNodePtr cur) memset(data, 0, sizeof(struct xmlData)); for (node = cur->children; node != NULL; node = node->next) { - if (!xmlStrcmp(node->name, data_str[XML_LABEL])) { + if (!xmlStrcmp(node->name, (const xmlChar*)data_str[XML_LABEL])) { data->label = (char*)xmlNodeListGetString(doc, node->children, 1); FEEDBACK_LOG("label : %s", data->label); - } else if (!xmlStrcmp(node->name, data_str[XML_DATA])) { + } else if (!xmlStrcmp(node->name, (const xmlChar*)data_str[XML_DATA])) { b64_data = (char *)xmlNodeListGetString(doc, node->children, 1); if (b64_data != NULL) { FEEDBACK_LOG("b64_data : %s", b64_data); |