revise global variables 55/239255/1 accepted/tizen/unified/20200729.031026 submit/tizen/20200728.054611
authorYoungjae Shin <yj99.shin@samsung.com>
Thu, 23 Jul 2020 06:37:24 +0000 (15:37 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Thu, 23 Jul 2020 06:37:24 +0000 (15:37 +0900)
Change-Id: Ifadccfd91d57ec15f2a9271e0035c71afca80f59

AUTHORS [deleted file]
include/log.h [changed mode: 0755->0644]
src/core_object/co_sat.c
src/mux.c
src/util.c

diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644 (file)
index 0e9faa9..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,6 +0,0 @@
-Jongman Park <jman.park@samsung.com>
-Ja-young Gu <jygu@samsung.com>
-Kyeongchul Kim <kyeongchul.kim@samsung.com>
-DongHoo Park <donghoo.park@samsung.>
-Youngman Park <youngman.park@samsung.com>
-Inho Oh <inho48.oh@samsung.com>
old mode 100755 (executable)
new mode 100644 (file)
index aa6bf1e..397e073
 extern "C" {
 #endif
 
-__BEGIN_DECLS
-
 #include <glib.h>
-extern gboolean tcore_debug;
+gboolean tcore_debug();
 
 #ifdef FEATURE_DLOG_DEBUG
 
@@ -38,9 +36,9 @@ extern gboolean tcore_debug;
 #define TCORE_LOG_TAG "UNKNOWN"
 #endif
 
-#define info(fmt,args...)  do { if(tcore_debug) RLOG(LOG_INFO, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
-#define msg(fmt,args...)  do { if(tcore_debug) RLOG(LOG_DEBUG, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
-#define dbg(fmt,args...)  do { if(tcore_debug) RLOG(LOG_DEBUG, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
+#define info(fmt,args...)  do { if(tcore_debug()) RLOG(LOG_INFO, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
+#define msg(fmt,args...)  do { if(tcore_debug()) RLOG(LOG_DEBUG, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
+#define dbg(fmt,args...)  do { if(tcore_debug()) RLOG(LOG_DEBUG, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
 #define warn(fmt,args...)  do { RLOG(LOG_WARN, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
 #define err(fmt,args...)  do { RLOG(LOG_ERROR, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
 #define fatal(fmt,args...)  do { RLOG(LOG_FATAL, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
@@ -76,16 +74,16 @@ enum tcore_log_priority {
  */
 void tcore_log(enum tcore_log_type type, enum tcore_log_priority priority, const char *tag, const char *fmt, ...);
 
-#define info(fmt,args...)  do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
-#define msg(fmt,args...)  do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
-#define dbg(fmt,args...)  do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_DEBUG, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define info(fmt,args...)  do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define msg(fmt,args...)  do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
+#define dbg(fmt,args...)  do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_DEBUG, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
 #define warn(fmt,args...)  do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_WARN, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
 #define err(fmt,args...)  do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_ERROR, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
 #define fatal(fmt,args...)  do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_FATAL, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
 
-#define info_ex(tag,fmt,args...)  do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
-#define msg_ex(tag,fmt,args...)  do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, tag, fmt "\n", ##args); } while (0)
-#define dbg_ex(tag,fmt,args...)  do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_DEBUG, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define info_ex(tag,fmt,args...)  do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define msg_ex(tag,fmt,args...)  do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, tag, fmt "\n", ##args); } while (0)
+#define dbg_ex(tag,fmt,args...)  do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_DEBUG, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
 #define warn_ex(tag,fmt,args...)  do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_WARN, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
 #define err_ex(tag,fmt,args...)  do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_ERROR, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
 #define fatal_ex(tag,fmt,args...)  do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_FATAL, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
@@ -122,17 +120,15 @@ void tcore_log(enum tcore_log_type type, enum tcore_log_priority priority, const
 #define TCORE_LOG_FUNC fprintf
 #endif
 
-#define info(fmt,args...) do { if(tcore_debug) TCORE_LOG_FUNC(TCORE_LOG_FILE, fmt "\n", ##args); fflush(TCORE_LOG_FILE);} while (0)
-#define msg(fmt,args...) do { if(tcore_debug) TCORE_LOG_FUNC(TCORE_LOG_FILE, fmt "\n", ##args); fflush(TCORE_LOG_FILE);} while (0)
-#define dbg(fmt,args...) do { if(tcore_debug) TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_LIGHTGRAY "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);} while (0)
+#define info(fmt,args...) do { if(tcore_debug()) TCORE_LOG_FUNC(TCORE_LOG_FILE, fmt "\n", ##args); fflush(TCORE_LOG_FILE);} while (0)
+#define msg(fmt,args...) do { if(tcore_debug()) TCORE_LOG_FUNC(TCORE_LOG_FILE, fmt "\n", ##args); fflush(TCORE_LOG_FILE);} while (0)
+#define dbg(fmt,args...) do { if(tcore_debug()) TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_LIGHTGRAY "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);} while (0)
 #define warn(fmt,args...) do {TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_YELLOW "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);} while (0)
 #define err(fmt,args...)  do {TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_LIGHTRED "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);} while (0)
 #define fatal(fmt,args...)  do {TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_LIGHTRED "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);} while (0)
 
 #endif
 
-__END_DECLS
-
 #ifdef __cplusplus
 }
 #endif
index 9f6fdef5562bffb2153064dfc95388484aa41f22..b4162afdde8758be99214ae9ec9f7fbafe6c01e2 100644 (file)
@@ -134,7 +134,7 @@ struct private_object_data {
        struct tcore_sat_operations *ops[TCORE_OPS_TYPE_MAX];
 };
 
-gboolean b_comprehensive = FALSE;
+static gboolean b_comprehensive = FALSE;
 
 static TReturn _dispatcher(CoreObject *o, UserRequest *ur, enum tcore_ops_type ops_type)
 {
index 708fe99b163119a1e9a30c9a07509f37d13eba73..6a07d9b75aca3e0945f715611b213027117547a5 100644 (file)
--- a/src/mux.c
+++ b/src/mux.c
@@ -110,7 +110,7 @@ typedef enum {
 } while (0)
 
 /*================= CRC TABLE=========================*/
-const unsigned char crc_table[256] = { /* reversed, 8-bit, poly=0x07 */
+static const unsigned char crc_table[256] = {  /* reversed, 8-bit, poly=0x07 */
        0x00, 0x91, 0xE3, 0x72, 0x07, 0x96, 0xE4, 0x75,
        0x0E, 0x9F, 0xED, 0x7C, 0x09, 0x98, 0xEA, 0x7B,
        0x1C, 0x8D, 0xFF, 0x6E, 0x1B, 0x8A, 0xF8, 0x69,
index 31c8e7dfb282612b66781b8597fc0c6ec46f03bf..08c0c61e1fdb2fc08c665e24fa997793d4b14d71 100644 (file)
 #define TAB_SPACE      "  "
 #define MAX_BUF_SIZE 255
 
-gboolean tcore_debug = TRUE;
+static gboolean _tcore_debug = TRUE;
+
+gboolean tcore_debug()
+{
+       return _tcore_debug;
+}
 
 static gboolean _find_gsm_code_exception_table(unsigned short src);
 static int _get_gsm_code_size(unsigned short *src, int src_len);
@@ -60,13 +65,13 @@ typedef struct {
        unsigned short unicode;
 } GsmUniTable;
 
-const GsmUniTable gsm_unicode2_table[] = {
+static const GsmUniTable gsm_unicode2_table[] = {
        {0x14, 0x005E}, {0x28, 0x007B}, {0x29, 0x007D}, {0x2F, 0x005C},
        {0x3C, 0x005B}, {0x3D, 0x007E}, {0x3E, 0x005D}, {0x40, 0x007C},
        {0x65, 0x20AC}
 };
 
-const GsmUniTable gsm_unicode_table[] = {
+static const GsmUniTable gsm_unicode_table[] = {
        {0x00, 0x0040}, {0x01, 0x00A3}, {0x02, 0x0024}, {0x03, 0x00A5},
        {0x04, 0x00E8}, {0x05, 0x00E9}, {0x06, 0x00F9}, {0x07, 0x00EC}, {0x08, 0x00F2},
        {0x09, 0x00E7}, {0x0B, 0x00D8}, {0x0C, 0x00F8}, {0x0E, 0x00C5}, {0x0F, 0x00E5},
@@ -2097,7 +2102,7 @@ char *tcore_util_get_version(void)
 
 void tcore_util_set_log(gboolean enable)
 {
-       tcore_debug = enable;
+       _tcore_debug = enable;
 }
 
 gboolean tcore_util_is_country_NA(char *plmn)