From d893b09863d808bf4127a011f3e76f8ae7433082 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Tue, 22 Sep 2009 22:51:43 +0300 Subject: avoid some more warnings in orkbasecxx mainly constifications --- orkbasecxx/ConfigManager.cpp | 12 ++++++------ orkbasecxx/LogManager.cpp | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/orkbasecxx/ConfigManager.cpp b/orkbasecxx/ConfigManager.cpp index 85ad41e..1ae39fc 100644 --- a/orkbasecxx/ConfigManager.cpp +++ b/orkbasecxx/ConfigManager.cpp @@ -10,7 +10,7 @@ * Please refer to http://www.gnu.org/copyleft/gpl.html * */ -#pragma warning( disable: 4786 ) // disables truncated symbols in browse-info warning +//#pragma warning( disable: 4786 ) // disables truncated symbols in browse-info warning #define _WINSOCKAPI_ // prevents the inclusion of winsock.h @@ -48,8 +48,8 @@ void ConfigManager::Initialize() try { - char* cfgFilename = ""; - char* cfgEnvPath = ""; + char* cfgFilename = NULL; + const char* cfgEnvPath = ""; int cfgAlloc = 0; cfgEnvPath = ACE_OS::getenv("ORKAUDIO_CONFIG_PATH"); @@ -69,19 +69,19 @@ void ConfigManager::Initialize() } } - if(!cfgFilename || !strlen(cfgFilename)) { + if(!cfgFilename) { FILE* file = ACE_OS::fopen(CONFIG_FILE_NAME, "r"); if(file) { // config.xml exists in the current directory - cfgFilename = CONFIG_FILE_NAME; + cfgFilename = (char*)CONFIG_FILE_NAME; fclose(file); } else { // config.xml could not be found in the current // directory, try to find it in system configuration directory - cfgFilename = ETC_CONFIG_FILE_NAME; + cfgFilename = (char*)ETC_CONFIG_FILE_NAME; } } diff --git a/orkbasecxx/LogManager.cpp b/orkbasecxx/LogManager.cpp index 6259a70..552d1eb 100644 --- a/orkbasecxx/LogManager.cpp +++ b/orkbasecxx/LogManager.cpp @@ -30,8 +30,8 @@ void OrkLogManager::Initialize() { BasicConfigurator::configure(); - char* logCfgFilename = ""; - char* cfgEnvPath = ""; + char* logCfgFilename = NULL; + const char* cfgEnvPath = ""; int cfgAlloc = 0; cfgEnvPath = ACE_OS::getenv("ORKAUDIO_CONFIG_PATH"); @@ -51,19 +51,19 @@ void OrkLogManager::Initialize() } } - if(!logCfgFilename || !strlen(logCfgFilename)) { + if(!logCfgFilename) { FILE* file = ACE_OS::fopen("logging.properties", "r"); if(file) { // logging.properties exists in the current directory - logCfgFilename = "logging.properties"; + logCfgFilename = (char*)"logging.properties"; fclose(file); } else { // logging.properties could not be found in the current // directory, try to find it in system configuration directory - logCfgFilename = "/etc/orkaudio/logging.properties"; + logCfgFilename = (char*)"/etc/orkaudio/logging.properties"; } } -- cgit v1.2.3