From bfb32b811d3f9125c8f7eb9ff3e3cd0f39c3df24 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 20 Feb 2016 18:09:24 +0100 Subject: [PATCH] Removed useless comments/commented code --- code/nel/include/nel/misc/path.h | 1 - code/nel/src/3d/landscapeig_manager.cpp | 5 -- code/nel/src/ligo/stdligo.h | 1 - code/nel/src/misc/async_file_manager.cpp | 18 ++---- code/nel/src/misc/bitmap.cpp | 7 --- code/nel/src/misc/displayer.cpp | 60 ------------------- code/nel/src/misc/path.cpp | 3 - code/nel/src/net/service.cpp | 1 - code/ryzom/client/src/login.cpp | 12 +--- .../game_share/file_description_container.cpp | 20 ------- code/ryzom/common/src/game_share/utils.h | 15 +---- 11 files changed, 6 insertions(+), 137 deletions(-) diff --git a/code/nel/include/nel/misc/path.h b/code/nel/include/nel/misc/path.h index 1fa049fa5..a16b03f15 100644 --- a/code/nel/include/nel/misc/path.h +++ b/code/nel/include/nel/misc/path.h @@ -722,7 +722,6 @@ struct CFile /** Try to set the file access to read/write if not already set. * return true if the file doesn't exist or if the file already have RW access. - * Work actually only on Windows and returns always true on other platforms. * \return true if RW access is granted */ static bool setRWAccess(const std::string &filename); diff --git a/code/nel/src/3d/landscapeig_manager.cpp b/code/nel/src/3d/landscapeig_manager.cpp index d69ba3166..f4388f9fa 100644 --- a/code/nel/src/3d/landscapeig_manager.cpp +++ b/code/nel/src/3d/landscapeig_manager.cpp @@ -26,9 +26,6 @@ #include "nel/misc/file.h" #include "nel/misc/hierarchical_timer.h" -// std. -#include - using namespace NLMISC; using namespace std; @@ -85,8 +82,6 @@ void CLandscapeIGManager::initIG(UScene *scene, const std::string &igDesc, UDriv string igFile = CPath::lookup(igDesc); - //ifstream file(igFile.c_str(), ios::in); - CIFile file; // Shape to add should be empty ! diff --git a/code/nel/src/ligo/stdligo.h b/code/nel/src/ligo/stdligo.h index c8f4e2a9a..85e7a2120 100644 --- a/code/nel/src/ligo/stdligo.h +++ b/code/nel/src/ligo/stdligo.h @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/code/nel/src/misc/async_file_manager.cpp b/code/nel/src/misc/async_file_manager.cpp index d1653e6ce..e8f6414e4 100644 --- a/code/nel/src/misc/async_file_manager.cpp +++ b/code/nel/src/misc/async_file_manager.cpp @@ -210,13 +210,8 @@ void CAsyncFileManager::CFileLoad::run (void) FILE *f = nlfopen (_FileName, "rb"); if (f != NULL) { - uint8 *ptr; - long filesize=CFile::getFileSize (f); - //fseek (f, 0, SEEK_END); - //long filesize = ftell (f); - //nlSleep(5); - //fseek (f, 0, SEEK_SET); - ptr = new uint8[filesize]; + uint32 filesize=CFile::getFileSize (f); + uint8 *ptr = new uint8[filesize]; if (fread (ptr, filesize, 1, f) != 1) nlwarning("AFM: Couldn't read '%s'", _FileName.c_str()); fclose (f); @@ -256,13 +251,8 @@ void CAsyncFileManager::CMultipleFileLoad::run (void) FILE *f = nlfopen (_FileNames[i], "rb"); if (f != NULL) { - uint8 *ptr; - long filesize=CFile::getFileSize (f); - //fseek (f, 0, SEEK_END); - //long filesize = ftell (f); - //nlSleep(5); - //fseek (f, 0, SEEK_SET); - ptr = new uint8[filesize]; + uint32 filesize=CFile::getFileSize (f); + uint8 *ptr = new uint8[filesize]; if (fread (ptr, filesize, 1, f) != 1) nlwarning("AFM: Couldn't read '%s'", _FileNames[i].c_str()); fclose (f); diff --git a/code/nel/src/misc/bitmap.cpp b/code/nel/src/misc/bitmap.cpp index 798a52019..11a27e67e 100644 --- a/code/nel/src/misc/bitmap.cpp +++ b/code/nel/src/misc/bitmap.cpp @@ -555,17 +555,10 @@ uint8 CBitmap::readDDS(NLMISC::IStream &f, uint mipMapSkip) (very) bad rendered with this fix so we have to deactivate it the for moment */ -//#ifdef NL_OS_WINDOWS -// if(PixelFormat==DXTC1) //AlphaBitDepth -// { -// PixelFormat = DXTC1Alpha; -// } -//#else if(PixelFormat==DXTC1 && _DDSSurfaceDesc[21]>0) //AlphaBitDepth { PixelFormat = DXTC1Alpha; } -//#endif if(PixelFormat!= DXTC1 && PixelFormat!= DXTC1Alpha && PixelFormat!= DXTC3 && PixelFormat!= DXTC5) { diff --git a/code/nel/src/misc/displayer.cpp b/code/nel/src/misc/displayer.cpp index 159a3d6b5..208bac26d 100644 --- a/code/nel/src/misc/displayer.cpp +++ b/code/nel/src/misc/displayer.cpp @@ -290,12 +290,6 @@ void CStdDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *mess } else { - /*OutputDebugString(ss2.str().c_str()); - OutputDebugString("\n\t\t\t"); - OutputDebugString("message end: "); - OutputDebugString(&message[strlen(message) - 1024]); - OutputDebugString("\n");*/ - sint count = 0; uint n = (uint)strlen(message); std::string s(&str2.c_str()[0], (str2.size() - n)); @@ -702,58 +696,4 @@ void CMsgBoxDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *m } } - - -/***************************************************************/ -/******************* THE FOLLOWING CODE IS COMMENTED OUT *******/ -/*************************************************************** -void CStdDisplayer::display (const std::string& str) -{ -// printf("%s", str.c_str ()); - cout << str; - -#ifdef NL_OS_WINDOWS - // display the string in the debugger is the application is started with the debugger - if (IsDebuggerPresent ()) - OutputDebugString(str.c_str ()); -#endif -} - - -void CFileDisplayer::display (const std::string& str) -{ - if (_FileName.size () == 0) return; - - ofstream ofs (_FileName.c_str (), ios::out | ios::app); - if (ofs.is_open ()) - { - ofs << str; - ofs.close(); - } - - -// FILE *fp = fopen (_FileName.c_str (), "a"); -// if (fp == NULL) return; - -// fprintf (fp, "%s", str.c_str ()); - -// fclose (fp); -} - - - -void CMsgBoxDisplayer::display (const std::string& str) -{ -#ifdef NL_OS_WINDOWS - - CSystemUtils::copyTextToClipboard(str); - - string strf = str; - strf += "\n\n(this message was copied in the clipboard)"; - MessageBox (NULL, strf.c_str (), "", MB_OK | MB_ICONEXCLAMATION); -#endif -} -**************************************************************************/ - - } // NLMISC diff --git a/code/nel/src/misc/path.cpp b/code/nel/src/misc/path.cpp index c473bf29c..376f238c8 100644 --- a/code/nel/src/misc/path.cpp +++ b/code/nel/src/misc/path.cpp @@ -2299,9 +2299,6 @@ static bool CopyMoveFile(const std::string &dest, const std::string &src, bool c std::string sdest = CPath::standardizePath(dest,false); std::string ssrc = CPath::standardizePath(src,false); -// return copyFile ? CopyFile(dossrc.c_str(), dosdest.c_str(), failIfExists) != FALSE -// : MoveFile(dossrc.c_str(), dosdest.c_str()) != FALSE; - if (progress) progress->progress(0.f); if(copyFile) { diff --git a/code/nel/src/net/service.cpp b/code/nel/src/net/service.cpp index 610fd1a1d..e2db26bd5 100644 --- a/code/nel/src/net/service.cpp +++ b/code/nel/src/net/service.cpp @@ -600,7 +600,6 @@ sint IService::main (const char *serviceShortName, const char *serviceLongName, ListeningPort = servicePort; - // setReportEmailFunction ((void*)sendEmail); // setDefaultEmailParams ("gw.nevrax.com", "", "cado@nevrax.com"); diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 152b2bbde..171af2d38 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -1857,17 +1857,7 @@ class CAHOpenURL : public IActionHandler // TODO: for Linux and Mac OS #endif - /* - if (sParams == "cfg_CreateAccountURL") - { - url = ClientCfg.CreateAccountURL; - - if (!installTag.empty()) - { - url += string("/?from=")+installTag; - } - } - else */if (sParams == "cfg_EditAccountURL") + if (sParams == "cfg_EditAccountURL") { url = ClientCfg.EditAccountURL; } diff --git a/code/ryzom/common/src/game_share/file_description_container.cpp b/code/ryzom/common/src/game_share/file_description_container.cpp index ae4a2e07f..e974bd7d2 100644 --- a/code/ryzom/common/src/game_share/file_description_container.cpp +++ b/code/ryzom/common/src/game_share/file_description_container.cpp @@ -26,13 +26,6 @@ #include "utils.h" #include "file_description_container.h" -#ifdef NL_OS_WINDOWS -#include -#include -//#include -#include -#endif - //------------------------------------------------------------------------------------------------- // namespaces @@ -110,23 +103,10 @@ void CFileDescriptionContainer::addFile(const string& fileName, uint32 timeStamp void CFileDescriptionContainer::addFile(const string& fileName) { -//#ifdef NL_OS_WINDOWS -// -// struct _stat buffer; -// uint32 result= _stat(fileName.c_str(),&buffer); -// if (result==0) -// { -// addFile(fileName, uint32(buffer.st_mtime), buffer.st_size); -// } -// -//#else - if (CFile::fileExists(fileName)) { addFile(fileName,CFile::getFileModificationDate(fileName),CFile::getFileSize(fileName)); } - -//#endif } void CFileDescriptionContainer::addFileSpec(const string& fileSpec,bool recurse) diff --git a/code/ryzom/common/src/game_share/utils.h b/code/ryzom/common/src/game_share/utils.h index a93c68a4d..96099a466 100644 --- a/code/ryzom/common/src/game_share/utils.h +++ b/code/ryzom/common/src/game_share/utils.h @@ -671,14 +671,6 @@ struct TTypeLimits }; static uint32 floor(uint32 value) { return value; } }; -/* -#ifdef NL_OS_WINDOWS -template <> -struct TTypeLimits : public TTypeLimits -{ -}; -#endif -*/ template <> struct TTypeLimits { @@ -728,12 +720,7 @@ struct TTypeLimits }; static sint32 floor(sint32 value) { return value; } }; -/*#ifdef NL_OS_WINDOWS -template <> -struct TTypeLimits : public TTypeLimits -{ -}; -#endif*/ + template <> struct TTypeLimits {