[2.2.1] Merge different codes between 2.2 and 3.0
[platform/framework/native/appfw.git] / src / base / FBaseSys.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 8c7ab5a..a560d93
@@ -81,7 +81,7 @@ static bool envPlatformInfoEnabled = false;
 #define WEB_RESERVED(X) NID_WEB+X
 #define SHELL_RESERVED(X) NID_SHELL+X
 
-LogInfo logInfo =
+static LogInfo logInfo =
 {
        {
                //OSP Namespace ID ===============================================================
@@ -482,7 +482,7 @@ SysLogInternal(unsigned long nid, const char* pFunction, int lineNumber, const c
 {
        va_list args;
 
-       if (!envLoaded)
+       if (unlikely(!envLoaded))
        {
                int ret = access("/home/developer/.platforminfologgingmode", F_OK);
                if (ret == 0)
@@ -538,7 +538,7 @@ SysLogTagInternal(unsigned long nid, const char* pTag, const char* pFunction, in
 {
        va_list args;
 
-       if (!envLoaded)
+       if (unlikely(!envLoaded))
        {
                int ret = access("/home/developer/.platforminfologgingmode", F_OK);
                if (ret == 0)
@@ -695,7 +695,7 @@ SysTryReturnResultInternal(unsigned long id, result r, const char* pFunction, in
 void
 __PrintLog(_LogType type, const char* pFunction, int lineNumber, const char* pFormat, va_list args)
 {
-       if (!iniLoaded)
+       if (unlikely(!iniLoaded))
        {
                __InitializeLogInfo();
        }
@@ -706,7 +706,7 @@ __PrintLog(_LogType type, const char* pFunction, int lineNumber, const char* pFo
 
        char logTag[LOG_MODULE_NAME_LEN_MAX];
 
-       if (!appNameLoaded)
+       if (unlikely(!appNameLoaded))
        {
                appNameLoaded = true;
                char* pAppName = _StringConverter::CopyToCharArrayN(_AppInfo::GetAppExecutableName());
@@ -744,7 +744,7 @@ __PrintLog(_LogType type, const char* pFunction, int lineNumber, const char* pFo
 void
 __PrintLogTag(const char* pTag, _LogType type, const char* pFunction, int lineNumber, const char* pFormat, va_list args)
 {
-       if (!iniLoaded)
+       if (unlikely(!iniLoaded))
        {
                __InitializeLogInfo();
        }
@@ -786,7 +786,7 @@ __PrintLogTag(const char* pTag, _LogType type, const char* pFunction, int lineNu
 void
 __PrintSysLog(_LogType type, LogID id, const char* pFunction, int lineNumber, const char* pFormat, va_list args)
 {
-       if (!iniLoaded)
+       if (unlikely(!iniLoaded))
        {
                __InitializeLogInfo();
        }
@@ -832,7 +832,7 @@ __PrintSysLog(_LogType type, LogID id, const char* pFunction, int lineNumber, co
 void
 __PrintSysLogTag(const char* pTag, _LogType type, LogID id, const char* pFunction, int lineNumber, const char* pFormat, va_list args)
 {
-       if (!iniLoaded)
+       if (unlikely(!iniLoaded))
        {
                __InitializeLogInfo();
        }
@@ -875,7 +875,7 @@ __PrintSysLogTag(const char* pTag, _LogType type, LogID id, const char* pFunctio
        }
 }
 
-char*
+const char*
 __GetModuleName(LogID id)
 {
        return logInfo.logTable[id].logModuleName;
@@ -913,14 +913,14 @@ __InitializeLogInfo()
 void
 __InitializeLogLevel(const Registry& reg)
 {
-       String sectApp(L"Application");
-       String sectPlatform(L"Platform");
+       const String sectApp(L"Application");
+       const String sectPlatform(L"Platform");
 
-       String entryInfo(L"INFO");
-       String entryDebug(L"DEBUG");
-       String entryException(L"EXCEPTION");
+       const String entryInfo(L"INFO");
+       const String entryDebug(L"DEBUG");
+       const String entryException(L"EXCEPTION");
 
-       String strYes(L"YES");
+       const String strYes(L"YES");
        String retString;
 
        result r;
@@ -974,10 +974,10 @@ __InitializeLogLevel(const Registry& reg)
 void
 __InitializePlatformModule(const Registry& reg)
 {
-       String strYes(L"YES");
+       const String strYes(L"YES");
        String retString;
 
-       String sectModule(L"PlatformModules");
+       const String sectModule(L"PlatformModules");
 
        result r;