From abbded6e92e4eb94e1dee0ee2027b9befd85a96d Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 13 Apr 2012 09:36:51 +0200 Subject: [PATCH 1/2] Changed: #825 Remove all warnings when compiling Ryzom --- code/ryzom/client/src/interface_v3/interface_element.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/client/src/interface_v3/interface_element.h b/code/ryzom/client/src/interface_v3/interface_element.h index 24982cad2..0202618ba 100644 --- a/code/ryzom/client/src/interface_v3/interface_element.h +++ b/code/ryzom/client/src/interface_v3/interface_element.h @@ -361,7 +361,7 @@ public: */ virtual void forceOpen() { setActive(true); } - virtual void enableBlink(int /* numBlinks */ = 0) {} + virtual void enableBlink(uint /* numBlinks */ = 0) {} virtual void disableBlink() {} virtual bool getBlink() const { return false; } From 291a9562162ecaececa0be12e57dce3e86e9a481 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 13 Apr 2012 10:07:06 +0200 Subject: [PATCH 2/2] Changed: #825 Remove all warnings when compiling Ryzom --- code/nel/include/nel/misc/bit_mem_stream.h | 6 ++-- code/nel/include/nel/misc/mem_stream.h | 4 +-- code/nel/src/misc/bit_mem_stream.cpp | 2 +- code/nel/src/misc/bitmap_jpeg.cpp | 2 +- code/nel/src/misc/co_task.cpp | 3 ++ code/nel/src/misc/command.cpp | 3 ++ code/nel/src/misc/common.cpp | 38 +++++++++++++++++++++- 7 files changed, 50 insertions(+), 8 deletions(-) diff --git a/code/nel/include/nel/misc/bit_mem_stream.h b/code/nel/include/nel/misc/bit_mem_stream.h index 3bddc20f7..b294d5454 100644 --- a/code/nel/include/nel/misc/bit_mem_stream.h +++ b/code/nel/include/nel/misc/bit_mem_stream.h @@ -394,7 +394,7 @@ public: * If you are using the stream only in output mode, you can use this method as a faster version * of clear() *if you don't serialize pointers*. */ - void resetBufPos() + virtual void resetBufPos() { // This is ensured in CMemStream::CMemStream() and CMemStream::clear() //if ( (!isReading()) && _Buffer.empty() ) @@ -477,7 +477,7 @@ public: } /// See doc in CMemStream::bufferToFill() - uint8 *bufferToFill( uint32 msgsize ) + virtual uint8 *bufferToFill( uint32 msgsize ) { _FreeBits = 8; _DbgInfo.clear(); @@ -654,7 +654,7 @@ public: virtual void serial(ucstring &b); virtual void serial(CBitMemStream &b) { serialMemStream(b); } - virtual void serialMemStream(CBitMemStream &b); + virtual void serialMemStream(CMemStream &b); //@} diff --git a/code/nel/include/nel/misc/mem_stream.h b/code/nel/include/nel/misc/mem_stream.h index 2102129dd..1da99a48d 100644 --- a/code/nel/include/nel/misc/mem_stream.h +++ b/code/nel/include/nel/misc/mem_stream.h @@ -301,7 +301,7 @@ public: * If you are using the stream only in output mode, you can use this method as a faster version * of clear() *if you don't serialize pointers*. */ - void resetBufPos() { _Buffer.Pos = 0; } + virtual void resetBufPos() { _Buffer.Pos = 0; } /** * Resize the message buffer and fill data at position 0. @@ -340,7 +340,7 @@ public: * fill it with raw data using any filling function (warning: don't fill more than 'msgsize' * bytes!), then you are ready to read, using serial(), the data you've just filled. */ - uint8 *bufferToFill( uint32 msgsize ) + virtual uint8 *bufferToFill( uint32 msgsize ) { #ifdef NL_DEBUG nlassert( isReading() ); diff --git a/code/nel/src/misc/bit_mem_stream.cpp b/code/nel/src/misc/bit_mem_stream.cpp index c050d9c61..007b95cbc 100644 --- a/code/nel/src/misc/bit_mem_stream.cpp +++ b/code/nel/src/misc/bit_mem_stream.cpp @@ -599,7 +599,7 @@ void CBitMemStream::append( const CBitMemStream& newBits ) /* * Serial bitmemstream */ -void CBitMemStream::serialMemStream(CBitMemStream &b) +void CBitMemStream::serialMemStream(CMemStream &b) { #ifdef LOG_ALL_TRAFFIC sint32 bitpos = getPosInBit(); diff --git a/code/nel/src/misc/bitmap_jpeg.cpp b/code/nel/src/misc/bitmap_jpeg.cpp index 835110d86..a4eaaa0b9 100644 --- a/code/nel/src/misc/bitmap_jpeg.cpp +++ b/code/nel/src/misc/bitmap_jpeg.cpp @@ -109,7 +109,7 @@ static void jpgDecompressSkip(j_decompress_ptr cinfo, long num_bytes) } } -static void jpgDecompressTerm(j_decompress_ptr cinfo) +static void jpgDecompressTerm(j_decompress_ptr /* cinfo */) { } diff --git a/code/nel/src/misc/co_task.cpp b/code/nel/src/misc/co_task.cpp index 1880be06c..c66941a40 100644 --- a/code/nel/src/misc/co_task.cpp +++ b/code/nel/src/misc/co_task.cpp @@ -237,12 +237,15 @@ namespace NLMISC _PImpl = new TCoTaskData(this); // _PImpl->_TaskThreadId = 0; // _PImpl->_ParentThreadId = 0; + nlunreferenced(stackSize); #else //NL_USE_THREAD_COTASK // allocate platform specific data storage _PImpl = new TCoTaskData; + nlunreferenced(stackSize); #if defined (NL_OS_WINDOWS) _PImpl->_Fiber = NULL; _PImpl->_ParentFiber = NULL; + nlunreferenced(stackSize); #elif defined(NL_OS_UNIX) // allocate the stack _PImpl->_Stack = new uint8[stackSize]; diff --git a/code/nel/src/misc/command.cpp b/code/nel/src/misc/command.cpp index 80d074386..f2b422d69 100644 --- a/code/nel/src/misc/command.cpp +++ b/code/nel/src/misc/command.cpp @@ -650,6 +650,9 @@ ICommand *CCommandRegistry::getCommand(const std::string &commandName) NLMISC_CATEGORISED_COMMAND(nel,help,"display help on a specific variable/commands or on all variables and commands", "[|]") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); // nlassert (_Commands != NULL); // make sure we have a valid number of parameters diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 6d37c19ab..d89708c4e 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -373,6 +373,10 @@ uint32 humanReadableToBytes (const string &str) NLMISC_CATEGORISED_COMMAND(nel,btohr, "Convert a bytes number into an human readable number", "") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if (args.size() != 1) return false; @@ -384,6 +388,10 @@ NLMISC_CATEGORISED_COMMAND(nel,btohr, "Convert a bytes number into an human read NLMISC_CATEGORISED_COMMAND(nel,hrtob, "Convert a human readable number into a bytes number", "
") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if (args.size() != 1) return false; @@ -446,6 +454,10 @@ uint32 fromHumanReadable (const std::string &str) NLMISC_CATEGORISED_COMMAND(nel,stohr, "Convert a second number into an human readable time", "") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if (args.size() != 1) return false; @@ -829,6 +841,7 @@ int nlfseek64( FILE *stream, sint64 offset, int origin ) return fsetpos (stream, &pos64); #else // NL_OS_WINDOWS + // TODO: to fix for Linux and Mac OS X // This code doesn't work under windows : fseek() implementation uses a signed 32 bits offset. What ever we do, it can't seek more than 2 Go. // For the moment, i don't know if it works under linux for seek of more than 2 Go. @@ -871,6 +884,9 @@ sint64 nlftell64(FILE *stream) } else return -1; #else + nlunreferenced(stream); + + // TODO: implement for Linux and Mac OS X nlerror("Not implemented"); return -1; #endif @@ -885,9 +901,14 @@ sint64 nlftell64(FILE *stream) NLMISC_CATEGORISED_COMMAND(nel, sleep, "Freeze the service for N seconds (for debug purpose)", "") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if(args.size() != 1) return false; - sint32 n = atoi (args[0].c_str()); + sint32 n; + fromString(args[0], n); log.displayNL ("Sleeping during %d seconds", n); @@ -897,6 +918,10 @@ NLMISC_CATEGORISED_COMMAND(nel, sleep, "Freeze the service for N seconds (for de NLMISC_CATEGORISED_COMMAND(nel, system, "Execute the command line using system() function call (wait until the end of the command)", "") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if(args.size() != 1) return false; string cmd = args[0]; @@ -915,6 +940,10 @@ NLMISC_CATEGORISED_COMMAND(nel, system, "Execute the command line using system() NLMISC_CATEGORISED_COMMAND(nel, launchProgram, "Execute the command line using launcProgram() function call (launch in background task without waiting the end of the execution)", " ") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if(args.size() != 2) return false; string cmd = args[0]; @@ -927,6 +956,10 @@ NLMISC_CATEGORISED_COMMAND(nel, launchProgram, "Execute the command line using l NLMISC_CATEGORISED_COMMAND(nel, killProgram, "kill a program given the pid", "") { + nlunreferenced(rawCommandString); + nlunreferenced(quiet); + nlunreferenced(human); + if(args.size() != 1) return false; uint32 pid; fromString(args[0], pid); @@ -1030,6 +1063,9 @@ bool openDoc (const char *document) } else return true; +#else + // TODO: implement for Linux and Mac OS X + nlunreferenced(document); #endif // NL_OS_WINDOWS return false; }