mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 19:52:25 +01:00
- some code cleanup related to vc++ posix naming warnings
This commit is contained in:
parent
0b67911199
commit
ab706e1762
@ -202,7 +202,11 @@ void MenuStateKeysetup::mouseClick(int x, int y, MouseButton mouseButton){
|
||||
|
||||
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
|
||||
string userKeysFile = configKeys.getFileName(true);
|
||||
#ifdef WIN32
|
||||
int result = _unlink(userKeysFile.c_str());
|
||||
#else
|
||||
int result = unlink(userKeysFile.c_str());
|
||||
#endif
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] delete file [%s] returned %d\n",__FILE__,__FUNCTION__,__LINE__,userKeysFile.c_str(),result);
|
||||
configKeys.reload();
|
||||
|
||||
|
@ -351,7 +351,12 @@ void removeFolder(const string path) {
|
||||
string item = results[i];
|
||||
if(isdir(item.c_str()) == false) {
|
||||
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] file item [%s]\n",__FILE__,__FUNCTION__,__LINE__,item.c_str());
|
||||
|
||||
#ifdef WIN32
|
||||
int result = _unlink(item.c_str());
|
||||
#else
|
||||
int result = unlink(item.c_str());
|
||||
#endif
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] fileitem [%s] result = %d\n",__FILE__,__FUNCTION__,__LINE__,item.c_str(),result);
|
||||
}
|
||||
}
|
||||
@ -363,12 +368,21 @@ void removeFolder(const string path) {
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] item [%s] isdir(item.c_str()) = %d\n",__FILE__,__FUNCTION__,__LINE__,item.c_str(), isdir(item.c_str()));
|
||||
if(isdir(item.c_str()) == true) {
|
||||
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] item [%s]\n",__FILE__,__FUNCTION__,__LINE__,item.c_str());
|
||||
#ifdef WIN32
|
||||
int result = _rmdir(item.c_str());
|
||||
#else
|
||||
int result = rmdir(item.c_str());
|
||||
#endif
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] item [%s] result = %d\n",__FILE__,__FUNCTION__,__LINE__,item.c_str(),result);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
int result = _rmdir(path.c_str());
|
||||
#else
|
||||
int result = rmdir(path.c_str());
|
||||
#endif
|
||||
|
||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path [%s] result = %d\n",__FILE__,__FUNCTION__,__LINE__,path.c_str(),result);
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,11 @@ static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) {
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("===> FTP Client thread CANCELLED, deleting file for writing [%s]\n",fullFilePath.c_str());
|
||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"===> FTP Client thread CANCELLED, deleting file for writing [%s]\n",fullFilePath.c_str());
|
||||
|
||||
#ifdef WIN32
|
||||
_unlink(fullFilePath.c_str());
|
||||
#else
|
||||
unlink(fullFilePath.c_str());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -299,7 +303,11 @@ FTP_Client_ResultType FTPClientThread::getMapFromServer(string mapFileName, stri
|
||||
ftpfile.stream = NULL;
|
||||
}
|
||||
if(result != ftp_crt_SUCCESS) {
|
||||
#ifdef WIN32
|
||||
_unlink(destFile.c_str());
|
||||
#else
|
||||
unlink(destFile.c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -470,7 +478,6 @@ FTP_Client_ResultType FTPClientThread::getTilesetFromServer(string tileSetName,
|
||||
}
|
||||
|
||||
if(destRootFolder != "") {
|
||||
//unlink(destRootFolder.c_str());
|
||||
removeFolder(destRootFolder);
|
||||
}
|
||||
}
|
||||
@ -502,7 +509,6 @@ FTP_Client_ResultType FTPClientThread::getTilesetFromServer(string tileSetName,
|
||||
result = getTilesetFromServer(tileSetName, tileSetNameSubfolder, ftpUser, ftpUserPassword, false);
|
||||
if(result != ftp_crt_SUCCESS) {
|
||||
if(destRootFolder != "") {
|
||||
//unlink(destRootFolder.c_str());
|
||||
removeFolder(destRootFolder);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user