code cleaning 91/10491/2
authorjy910.yun <jy910.yun@samsung.com>
Wed, 2 Oct 2013 12:10:40 +0000 (21:10 +0900)
committerjy910.yun <jy910.yun@samsung.com>
Wed, 2 Oct 2013 12:19:07 +0000 (21:19 +0900)
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>
12 files changed:
CMakeLists.txt
include/common.h [new file with mode: 0644]
include/feedback-internal.h [deleted file]
include/feedback-log.h [deleted file]
include/feedback-str.h [deleted file]
include/log.h [new file with mode: 0644]
src/devices.c
src/feedback.c
src/sound.c
src/str.c [new file with mode: 0644]
src/vibrator.c
src/xmlparser.c

index 3bcfaa4c68fd2e2530ea483c1e8f031ffc81e7e8..69fe1c2ccc12b48e4540a56cb0ba3705c238235d 100644 (file)
@@ -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/common.h b/include/common.h
new file mode 100644 (file)
index 0000000..0113c02
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __COMMON_H__
+#define __COMMON_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file common.h
+ * @brief This file contains the common information
+ */
+
+#define FEEDBACK_DATA_DIR                      "/opt/usr/share/feedback"
+#define FEEDBACK_ORIGIN_DATA_DIR       "/usr/share/feedback"
+
+#define FEEDBACK_RETRY_CNT       1
+
+extern int callstatus;
+
+extern const char *str_type[];
+extern const char *str_pattern[];
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/feedback-internal.h b/include/feedback-internal.h
deleted file mode 100644 (file)
index a4f34bd..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * libfeedback
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __FEEDBACK_INTERNAL_H__
-#define __FEEDBACK_INTERNAL_H__
-
-#include "feedback-ids.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file feedback-internal.h
- * @brief This file contains the common information
- */
-
-#define FEEDBACK_DATA_DIR                      "/opt/usr/share/feedback"
-#define FEEDBACK_ORIGIN_DATA_DIR       "/usr/share/feedback"
-
-#define FEEDBACK_RETRY_CNT       1
-
-extern int callstatus;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //__FEEDBACK_INTERNAL_H__
diff --git a/include/feedback-log.h b/include/feedback-log.h
deleted file mode 100644 (file)
index f11dfbd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * libfeedback
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __FEEDBACK_LOG_H__
-#define __FEEDBACK_LOG_H__
-
-#define FEATURE_FEEDBACK_DLOG
-
-#ifdef FEATURE_FEEDBACK_DLOG
-       #define LOG_TAG "FEEDBACK"
-       #include <dlog.h>
-       #define FEEDBACK_LOG(fmt, args...)       SLOGD(fmt, ##args)
-       #define FEEDBACK_ERROR(fmt, args...)     SLOGE(fmt, ##args)
-#else
-       #define FEEDBACK_LOG(x, ...)
-       #define FEEDBACK_ERROR(x, ...)
-#endif
-
-#endif //__FEEDBACK_LOG_H__
diff --git a/include/feedback-str.h b/include/feedback-str.h
deleted file mode 100644 (file)
index 0e41857..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * libfeedback
- * Copyright (c) 2012 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __FEEDBACK_STR_H__
-#define __FEEDBACK_STR_H__
-
-static const char *str_type[] =
-{
-       "FEEDBACK_TYPE_NONE",
-       "FEEDBACK_TYPE_SOUND",
-       "FEEDBACK_TYPE_VIBRATION",
-       "FEEDBACK_TYPE_END",
-};
-
-static const char *str_pattern[] =
-{
-       "FEEDBACK_PATTERN_TAP",
-       "FEEDBACK_PATTERN_SIP",
-       "FEEDBACK_PATTERN_SIP_BACKSPACE",
-       "FEEDBACK_PATTERN_MAX_CHARACTER",
-       "FEEDBACK_PATTERN_KEY0",
-       "FEEDBACK_PATTERN_KEY1",
-       "FEEDBACK_PATTERN_KEY2",
-       "FEEDBACK_PATTERN_KEY3",
-       "FEEDBACK_PATTERN_KEY4",
-       "FEEDBACK_PATTERN_KEY5",
-       "FEEDBACK_PATTERN_KEY6",
-       "FEEDBACK_PATTERN_KEY7",
-       "FEEDBACK_PATTERN_KEY8",
-       "FEEDBACK_PATTERN_KEY9",
-       "FEEDBACK_PATTERN_KEY_STAR",
-       "FEEDBACK_PATTERN_KEY_SHARP",
-       "FEEDBACK_PATTERN_HOLD",
-       "FEEDBACK_PATTERN_MULTI_TAP",
-       "FEEDBACK_PATTERN_HW_TAP",
-       "FEEDBACK_PATTERN_HW_HOLD",
-       "FEEDBACK_PATTERN_MESSAGE",
-       "FEEDBACK_PATTERN_MESSAGE_ON_CALL",
-       "FEEDBACK_PATTERN_EMAIL",
-       "FEEDBACK_PATTERN_EMAIL_ON_CALL",
-       "FEEDBACK_PATTERN_WAKEUP",
-       "FEEDBACK_PATTERN_WAKEUP_ON_CALL",
-       "FEEDBACK_PATTERN_SCHEDULE",
-       "FEEDBACK_PATTERN_SCHEDULE_ON_CALL",
-       "FEEDBACK_PATTERN_TIMER",
-       "FEEDBACK_PATTERN_TIMER_ON_CALL",
-       "FEEDBACK_PATTERN_GENERAL",
-       "FEEDBACK_PATTERN_GENERAL_ON_CALL",
-       "FEEDBACK_PATTERN_POWERON",
-       "FEEDBACK_PATTERN_POWEROFF",
-       "FEEDBACK_PATTERN_CHARGERCONN",
-       "FEEDBACK_PATTERN_CHARGERCONN_ON_CALL",
-       "FEEDBACK_PATTERN_FULLCHARGED",
-       "FEEDBACK_PATTERN_FULLCHARGED_ON_CALL",
-       "FEEDBACK_PATTERN_LOWBATT",
-       "FEEDBACK_PATTERN_LOWBATT_ON_CALL",
-       "FEEDBACK_PATTERN_LOCK",
-       "FEEDBACK_PATTERN_UNLOCK",
-       "FEEDBACK_PATTERN_CALLCONNECT",
-       "FEEDBACK_PATTERN_DISCALLCONNECT",
-       "FEEDBACK_PATTERN_MINUTEMINDER",
-       "FEEDBACK_PATTERN_VIBRATION",
-       "FEEDBACK_PATTERN_SHUTTER",
-       "FEEDBACK_PATTERN_LIST_REORDER",
-       "FEEDBACK_PATTERN_SLIDER_SWEEP",
-       "FEEDBACK_PATTERN_VOLUME_KEY",
-};
-
-#endif //__FEEDBACK_STR_H__
diff --git a/include/log.h b/include/log.h
new file mode 100644 (file)
index 0000000..7237f82
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __LOG_H__
+#define __LOG_H__
+
+#define FEATURE_FEEDBACK_DLOG
+
+#ifdef FEATURE_FEEDBACK_DLOG
+       #define LOG_TAG "FEEDBACK"
+       #include <dlog.h>
+       #define FEEDBACK_LOG(fmt, args...)       SLOGD(fmt, ##args)
+       #define FEEDBACK_ERROR(fmt, args...)     SLOGE(fmt, ##args)
+#else
+       #define FEEDBACK_LOG(x, ...)
+       #define FEEDBACK_ERROR(x, ...)
+#endif
+
+#endif //__LOG_H__
index ac7fbbfbf7412ebd7892cf4b85248b9cfc04cd16..970de55ddb183af2c7afb146fa7f75760a994d8e 100644 (file)
@@ -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)
index 1ef742ee93caedd9f85523983643e3e4479ca50e..5243924b18e6c26a8851d28770f5b20aba99c425 100644 (file)
@@ -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;
 
index 39d9b4b0107233c0f7856bb114d12a76a51234f2..d903e3aa377c94992b42ac5cf31c08adfdbd6289 100644 (file)
 #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/src/str.c b/src/str.c
new file mode 100644 (file)
index 0000000..fb70365
--- /dev/null
+++ b/src/str.c
@@ -0,0 +1,81 @@
+/*
+ * libfeedback
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <stdio.h>
+
+const char *str_type[] =
+{
+       "FEEDBACK_TYPE_NONE",
+       "FEEDBACK_TYPE_SOUND",
+       "FEEDBACK_TYPE_VIBRATION",
+       "FEEDBACK_TYPE_END",
+};
+
+const char *str_pattern[] =
+{
+       "FEEDBACK_PATTERN_TAP",
+       "FEEDBACK_PATTERN_SIP",
+       "FEEDBACK_PATTERN_SIP_BACKSPACE",
+       "FEEDBACK_PATTERN_MAX_CHARACTER",
+       "FEEDBACK_PATTERN_KEY0",
+       "FEEDBACK_PATTERN_KEY1",
+       "FEEDBACK_PATTERN_KEY2",
+       "FEEDBACK_PATTERN_KEY3",
+       "FEEDBACK_PATTERN_KEY4",
+       "FEEDBACK_PATTERN_KEY5",
+       "FEEDBACK_PATTERN_KEY6",
+       "FEEDBACK_PATTERN_KEY7",
+       "FEEDBACK_PATTERN_KEY8",
+       "FEEDBACK_PATTERN_KEY9",
+       "FEEDBACK_PATTERN_KEY_STAR",
+       "FEEDBACK_PATTERN_KEY_SHARP",
+       "FEEDBACK_PATTERN_HOLD",
+       "FEEDBACK_PATTERN_MULTI_TAP",
+       "FEEDBACK_PATTERN_HW_TAP",
+       "FEEDBACK_PATTERN_HW_HOLD",
+       "FEEDBACK_PATTERN_MESSAGE",
+       "FEEDBACK_PATTERN_MESSAGE_ON_CALL",
+       "FEEDBACK_PATTERN_EMAIL",
+       "FEEDBACK_PATTERN_EMAIL_ON_CALL",
+       "FEEDBACK_PATTERN_WAKEUP",
+       "FEEDBACK_PATTERN_WAKEUP_ON_CALL",
+       "FEEDBACK_PATTERN_SCHEDULE",
+       "FEEDBACK_PATTERN_SCHEDULE_ON_CALL",
+       "FEEDBACK_PATTERN_TIMER",
+       "FEEDBACK_PATTERN_TIMER_ON_CALL",
+       "FEEDBACK_PATTERN_GENERAL",
+       "FEEDBACK_PATTERN_GENERAL_ON_CALL",
+       "FEEDBACK_PATTERN_POWERON",
+       "FEEDBACK_PATTERN_POWEROFF",
+       "FEEDBACK_PATTERN_CHARGERCONN",
+       "FEEDBACK_PATTERN_CHARGERCONN_ON_CALL",
+       "FEEDBACK_PATTERN_FULLCHARGED",
+       "FEEDBACK_PATTERN_FULLCHARGED_ON_CALL",
+       "FEEDBACK_PATTERN_LOWBATT",
+       "FEEDBACK_PATTERN_LOWBATT_ON_CALL",
+       "FEEDBACK_PATTERN_LOCK",
+       "FEEDBACK_PATTERN_UNLOCK",
+       "FEEDBACK_PATTERN_CALLCONNECT",
+       "FEEDBACK_PATTERN_DISCALLCONNECT",
+       "FEEDBACK_PATTERN_MINUTEMINDER",
+       "FEEDBACK_PATTERN_VIBRATION",
+       "FEEDBACK_PATTERN_SHUTTER",
+       "FEEDBACK_PATTERN_LIST_REORDER",
+       "FEEDBACK_PATTERN_SLIDER_SWEEP",
+       "FEEDBACK_PATTERN_VOLUME_KEY",
+};
index 815145dd642a75fda98006b8dab93e56b29d3202..2e8cfdf6eb9845ac46879545ae4c703e788d7953 100644 (file)
 #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"
index d7d183731e1b49e66b0a4165ac94f469f078747e..39a7666f31326f3eeba3b2b472a69290eb530eb9 100644 (file)
@@ -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);