diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index d54325fcb..59fbb3916 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -525,7 +525,13 @@ MACRO(NL_SETUP_BUILD) # Ignore default include paths ADD_PLATFORM_FLAGS("/X") - IF(MSVC12) + IF(MSVC14) + ADD_PLATFORM_FLAGS("/Gy- /MP") + # /Ox is working with VC++ 2015, but custom optimizations don't exist + SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") + # without inlining it's unusable, use custom optimizations again + SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}") + ELSEIF(MSVC12) ADD_PLATFORM_FLAGS("/Gy- /MP") # /Ox is working with VC++ 2013, but custom optimizations don't exist SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}") @@ -557,7 +563,7 @@ MACRO(NL_SETUP_BUILD) SET(DEBUG_CFLAGS "/Od /Ob1 ${DEBUG_CFLAGS}") ELSE(MSVC12) MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}") - ENDIF(MSVC12) + ENDIF(MSVC14) ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /Zm1000 /wd4250") diff --git a/code/nel/include/nel/misc/entity_id.h b/code/nel/include/nel/misc/entity_id.h index 0a3d51208..46561a512 100644 --- a/code/nel/include/nel/misc/entity_id.h +++ b/code/nel/include/nel/misc/entity_id.h @@ -354,7 +354,7 @@ public: } else { - nlerror ("CEntityId looped (max was %"NL_I64"d", MaxEntityId); + nlerror ("CEntityId looped (max was %" NL_I64 "d", MaxEntityId); } return *this; } @@ -487,7 +487,7 @@ public: uint creatorId; uint dynamicId; - if (sscanf(str, "(%"NL_I64"x:%x:%x:%x)", &id, &type, &creatorId, &dynamicId) != 4) + if (sscanf(str, "(%" NL_I64 "x:%x:%x:%x)", &id, &type, &creatorId, &dynamicId) != 4) { *this = Unknown; return; diff --git a/code/nel/include/nel/misc/mem_stream.h b/code/nel/include/nel/misc/mem_stream.h index 507ff6714..f614cc040 100644 --- a/code/nel/include/nel/misc/mem_stream.h +++ b/code/nel/include/nel/misc/mem_stream.h @@ -728,7 +728,7 @@ inline void CMemStream::serial(uint64 &b) } else { - writenumber( b, "%"NL_I64"u", 20 ); + writenumber( b, "%" NL_I64 "u", 20 ); } } else @@ -748,7 +748,7 @@ inline void CMemStream::serial(sint64 &b) } else { - writenumber( b, "%"NL_I64"d", 20 ); + writenumber( b, "%" NL_I64 "d", 20 ); } } else diff --git a/code/nel/include/nel/misc/string_common.h b/code/nel/include/nel/misc/string_common.h index f71759eae..d0a667563 100644 --- a/code/nel/include/nel/misc/string_common.h +++ b/code/nel/include/nel/misc/string_common.h @@ -186,8 +186,8 @@ inline std::string toString(const uint16 &val) { return toString("%hu", val); } inline std::string toString(const sint16 &val) { return toString("%hd", val); } inline std::string toString(const uint32 &val) { return toString("%u", val); } inline std::string toString(const sint32 &val) { return toString("%d", val); } -inline std::string toString(const uint64 &val) { return toString("%"NL_I64"u", val); } -inline std::string toString(const sint64 &val) { return toString("%"NL_I64"d", val); } +inline std::string toString(const uint64 &val) { return toString("%" NL_I64 "u", val); } +inline std::string toString(const sint64 &val) { return toString("%" NL_I64 "d", val); } #ifdef NL_COMP_GCC # if GCC_VERSION == 40102 @@ -206,7 +206,7 @@ inline std::string toString(const long unsigned int &val) #endif #if (SIZEOF_SIZE_T) == 8 -inline std::string toString(const size_t &val) { return toString("%"NL_I64"u", val); } +inline std::string toString(const size_t &val) { return toString("%" NL_I64 "u", val); } #else #ifdef NL_OS_MAC inline std::string toString(const size_t &val) { return toString("%u", val); } @@ -237,8 +237,8 @@ inline bool fromString(const std::string &str, uint8 &val) { char *end; long v; inline bool fromString(const std::string &str, sint8 &val) { char *end; long v; errno = 0; v = strtol(str.c_str(), &end, 10); if (errno || v > SCHAR_MAX || v < SCHAR_MIN || end == str.c_str()) { val = 0; return false; } else { val = (sint8)v; return true; } } inline bool fromString(const std::string &str, uint16 &val) { char *end; long v; errno = 0; v = strtol(str.c_str(), &end, 10); if (errno || v > USHRT_MAX || v < 0 || end == str.c_str()) { val = 0; return false; } else { val = (uint16)v; return true; } } inline bool fromString(const std::string &str, sint16 &val) { char *end; long v; errno = 0; v = strtol(str.c_str(), &end, 10); if (errno || v > SHRT_MAX || v < SHRT_MIN || end == str.c_str()) { val = 0; return false; } else { val = (sint16)v; return true; } } -inline bool fromString(const std::string &str, uint64 &val) { bool ret = sscanf(str.c_str(), "%"NL_I64"u", &val) == 1; if (!ret) val = 0; return ret; } -inline bool fromString(const std::string &str, sint64 &val) { bool ret = sscanf(str.c_str(), "%"NL_I64"d", &val) == 1; if (!ret) val = 0; return ret; } +inline bool fromString(const std::string &str, uint64 &val) { bool ret = sscanf(str.c_str(), "%" NL_I64 "u", &val) == 1; if (!ret) val = 0; return ret; } +inline bool fromString(const std::string &str, sint64 &val) { bool ret = sscanf(str.c_str(), "%" NL_I64 "d", &val) == 1; if (!ret) val = 0; return ret; } inline bool fromString(const std::string &str, float &val) { bool ret = sscanf(str.c_str(), "%f", &val) == 1; if (!ret) val = 0.0f; return ret; } inline bool fromString(const std::string &str, double &val) { bool ret = sscanf(str.c_str(), "%lf", &val) == 1; if (!ret) val = 0.0; return ret; } @@ -286,8 +286,8 @@ inline bool fromString(const char *str, uint8 &val) { char *end; long v; errno = inline bool fromString(const char *str, sint8 &val) { char *end; long v; errno = 0; v = strtol(str, &end, 10); if (errno || v > SCHAR_MAX || v < SCHAR_MIN || end == str) { val = 0; return false; } else { val = (sint8)v; return true; } } inline bool fromString(const char *str, uint16 &val) { char *end; long v; errno = 0; v = strtol(str, &end, 10); if (errno || v > USHRT_MAX || v < 0 || end == str) { val = 0; return false; } else { val = (uint16)v; return true; } } inline bool fromString(const char *str, sint16 &val) { char *end; long v; errno = 0; v = strtol(str, &end, 10); if (errno || v > SHRT_MAX || v < SHRT_MIN || end == str) { val = 0; return false; } else { val = (sint16)v; return true; } } -inline bool fromString(const char *str, uint64 &val) { bool ret = sscanf(str, "%"NL_I64"u", &val) == 1; if (!ret) val = 0; return ret; } -inline bool fromString(const char *str, sint64 &val) { bool ret = sscanf(str, "%"NL_I64"d", &val) == 1; if (!ret) val = 0; return ret; } +inline bool fromString(const char *str, uint64 &val) { bool ret = sscanf(str, "%" NL_I64 "u", &val) == 1; if (!ret) val = 0; return ret; } +inline bool fromString(const char *str, sint64 &val) { bool ret = sscanf(str, "%" NL_I64 "d", &val) == 1; if (!ret) val = 0; return ret; } inline bool fromString(const char *str, float &val) { bool ret = sscanf(str, "%f", &val) == 1; if (!ret) val = 0.0f; return ret; } inline bool fromString(const char *str, double &val) { bool ret = sscanf(str, "%lf", &val) == 1; if (!ret) val = 0.0; return ret; } diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index 64d82d5bf..5f25387f5 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -67,7 +67,10 @@ # endif # ifdef _MSC_VER # define NL_COMP_VC -# if _MSC_VER >= 1800 +# if _MSC_VER >= 1900 +# define NL_COMP_VC14 +# define NL_COMP_VC_VERSION 140 +# elif _MSC_VER >= 1800 # define NL_COMP_VC12 # define NL_COMP_VC_VERSION 120 # elif _MSC_VER >= 1700 @@ -303,7 +306,7 @@ * Used to display a int64 in a platform independent way with printf like functions. \code sint64 myint64 = SINT64_CONSTANT(0x123456781234); - printf("This is a 64 bits int: %"NL_I64"u", myint64); + printf("This is a 64 bits int: %" NL_I64 "u", myint64); \endcode */ diff --git a/code/nel/src/gui/lua_object.cpp b/code/nel/src/gui/lua_object.cpp index 622157ed9..dc7abff52 100644 --- a/code/nel/src/gui/lua_object.cpp +++ b/code/nel/src/gui/lua_object.cpp @@ -422,7 +422,7 @@ namespace NLGUI { nlassert(key); nlassert(isValid()); - if (!isTable()) throw ELuaNotATable(NLMISC::toString("Trying to set a value '%d"NL_I64"' at key %s on object '%s' of type %s (not a table).", value, key, getId().c_str(), getTypename())); + if (!isTable()) throw ELuaNotATable(NLMISC::toString("Trying to set a value '%d" NL_I64 "' at key %s on object '%s' of type %s (not a table).", value, key, getId().c_str(), getTypename())); CLuaStackChecker lsc(_LuaState); push(); _LuaState->push(key); diff --git a/code/nel/src/misc/bit_mem_stream.cpp b/code/nel/src/misc/bit_mem_stream.cpp index ed282786e..4cd77e8ab 100644 --- a/code/nel/src/misc/bit_mem_stream.cpp +++ b/code/nel/src/misc/bit_mem_stream.cpp @@ -836,7 +836,7 @@ std::string CBitMemStream::getSerialItem( const TBMSSerialInfo& serialItem ) { uint64 u; serial( u, serialItem.BitSize ); - s = NLMISC::toString( "%"NL_I64"u", u ); + s = NLMISC::toString( "%" NL_I64 "u", u ); break; } case TBMSSerialInfo::F: // what about double? diff --git a/code/nel/src/misc/buf_fifo.cpp b/code/nel/src/misc/buf_fifo.cpp index 6c377f078..eee981644 100644 --- a/code/nel/src/misc/buf_fifo.cpp +++ b/code/nel/src/misc/buf_fifo.cpp @@ -538,9 +538,9 @@ void CBufFIFO::displayStats (CLog *log) log->displayNL ("%p BiggestBlock: %d, SmallestBlock: %d", this, _BiggestBlock, _SmallestBlock); log->displayNL ("%p BiggestBuffer: %d, SmallestBuffer: %d", this, _BiggestBuffer, _SmallestBuffer); - log->displayNL ("%p Pushed: %d, PushedTime: total %"NL_I64"d ticks, mean %f ticks", this, _Pushed, _PushedTime, (_Pushed>0?(double)(sint64)_PushedTime / (double)_Pushed:0.0)); - log->displayNL ("%p Fronted: %d, FrontedTime: total %"NL_I64"d ticks, mean %f ticks", this, _Fronted, _FrontedTime, (_Fronted>0?(double)(sint64)_FrontedTime / (double)_Fronted:0.0)); - log->displayNL ("%p Resized: %d, ResizedTime: total %"NL_I64"d ticks, mean %f ticks", this, _Resized, _ResizedTime, (_Resized>0?(double)(sint64)_ResizedTime / (double)_Resized:0.0)); + log->displayNL ("%p Pushed: %d, PushedTime: total %" NL_I64 "d ticks, mean %f ticks", this, _Pushed, _PushedTime, (_Pushed>0?(double)(sint64)_PushedTime / (double)_Pushed:0.0)); + log->displayNL ("%p Fronted: %d, FrontedTime: total %" NL_I64 "d ticks, mean %f ticks", this, _Fronted, _FrontedTime, (_Fronted>0?(double)(sint64)_FrontedTime / (double)_Fronted:0.0)); + log->displayNL ("%p Resized: %d, ResizedTime: total %" NL_I64 "d ticks, mean %f ticks", this, _Resized, _ResizedTime, (_Resized>0?(double)(sint64)_ResizedTime / (double)_Resized:0.0)); } void CBufFIFO::display () diff --git a/code/nel/src/misc/cdb_leaf.cpp b/code/nel/src/misc/cdb_leaf.cpp index 049791923..f74fb2d3d 100644 --- a/code/nel/src/misc/cdb_leaf.cpp +++ b/code/nel/src/misc/cdb_leaf.cpp @@ -120,7 +120,7 @@ ICDBNode * CCDBNodeLeaf::getNode (const CTextId& id, bool /* bCreate */) //----------------------------------------------- void CCDBNodeLeaf::write( CTextId& id, FILE * f) { - fprintf(f,"%"NL_I64"d\t%s\n",_Property,id.toString().c_str()); + fprintf(f,"%" NL_I64 "d\t%s\n",_Property,id.toString().c_str()); } // write // //----------------------------------------------- @@ -165,7 +165,7 @@ void CCDBNodeLeaf::readDelta(TGameCycle gc, CBitMemStream & f ) } if ( verboseDatabase ) { - nlinfo( "CDB: Read value (%u bits) %"NL_I64"d", bits, _Property ); + nlinfo( "CDB: Read value (%u bits) %" NL_I64 "d", bits, _Property ); } // bkup the date of change diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index e57ce635b..4c7d4fe02 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -380,7 +380,7 @@ string bytesToHumanReadable (uint64 bytes) div++; res = newres; } - return toString ("%"NL_I64"u%s", res, divTable[div]); + return toString ("%" NL_I64 "u%s", res, divTable[div]); } uint32 humanReadableToBytes (const string &str) diff --git a/code/nel/src/misc/cpu_time_stat.cpp b/code/nel/src/misc/cpu_time_stat.cpp index 861ab8e56..6441a8b45 100644 --- a/code/nel/src/misc/cpu_time_stat.cpp +++ b/code/nel/src/misc/cpu_time_stat.cpp @@ -49,7 +49,7 @@ bool CCPUTimeStat::getCPUTicks(uint64& user, uint64& nice, uint64& system, uint6 // /proc/stat // cpu [user] [nice] [system] [idle] [iowait] [irq] [softirq] - if (fscanf(f, "cpu %"NL_I64"u %"NL_I64"u %"NL_I64"u %"NL_I64"u %"NL_I64"u", &user, &nice, &system, &idle, &iowait) != 5) + if (fscanf(f, "cpu %" NL_I64 "u %" NL_I64 "u %" NL_I64 "u %" NL_I64 "u %" NL_I64 "u", &user, &nice, &system, &idle, &iowait) != 5) nlwarning("Failed to parse /proc/stat"); fclose(f); @@ -73,7 +73,7 @@ bool CCPUTimeStat::getPIDTicks(uint64& utime, uint64& stime, uint64& cutime, uin // /proc//stat // pid com sta ppi pgi ses tty tpg fla mif maf cmi cma [utime] [stime] [cutime] [cstime] ... - if (fscanf(f, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %"NL_I64"u %"NL_I64"u %"NL_I64"u %"NL_I64"u", &utime, &stime, &cutime, &cstime) != 4) + if (fscanf(f, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %" NL_I64 "u %" NL_I64 "u %" NL_I64 "u %" NL_I64 "u", &utime, &stime, &cutime, &cstime) != 4) nlwarning("Failed to parse /proc//stat"); fclose(f); diff --git a/code/nel/src/misc/file.cpp b/code/nel/src/misc/file.cpp index e5c0736f4..00a1823ef 100644 --- a/code/nel/src/misc/file.cpp +++ b/code/nel/src/misc/file.cpp @@ -791,7 +791,7 @@ NLMISC_CATEGORISED_COMMAND(nel, iFileAccessLogDisplay, "Display file access logs while (atIt!=atItEnd) { uint64 delta= (*atIt-IFileAccessLogStartTime); - log.display("%"NL_I64"u,",delta); + log.display("%" NL_I64 "u,",delta); ++atIt; } log.displayNL(""); diff --git a/code/nel/src/misc/o_xml.cpp b/code/nel/src/misc/o_xml.cpp index 0fbe3dade..d07362904 100644 --- a/code/nel/src/misc/o_xml.cpp +++ b/code/nel/src/misc/o_xml.cpp @@ -327,14 +327,14 @@ void COXml::serial(sint32 &b) void COXml::serial(uint64 &b) { - writenumber( b, "%"NL_I64"u", 20 ); + writenumber( b, "%" NL_I64 "u", 20 ); } // *************************************************************************** void COXml::serial(sint64 &b) { - writenumber( b, "%"NL_I64"d", 20 ); + writenumber( b, "%" NL_I64 "d", 20 ); } // *************************************************************************** diff --git a/code/nel/src/misc/system_utils.cpp b/code/nel/src/misc/system_utils.cpp index b70d3203e..2746c3f39 100644 --- a/code/nel/src/misc/system_utils.cpp +++ b/code/nel/src/misc/system_utils.cpp @@ -23,6 +23,32 @@ #include #include #include +#ifdef DXGI_STATUS_OCCLUDED +#undef DXGI_STATUS_OCCLUDED +#undef DXGI_STATUS_CLIPPED +#undef DXGI_STATUS_NO_REDIRECTION +#undef DXGI_STATUS_NO_DESKTOP_ACCESS +#undef DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE +#undef DXGI_STATUS_MODE_CHANGED +#undef DXGI_STATUS_MODE_CHANGE_IN_PROGRESS +#endif +#ifdef DXGI_ERROR_INVALID_CALL +#undef DXGI_ERROR_INVALID_CALL +#undef DXGI_ERROR_NOT_FOUND +#undef DXGI_ERROR_MORE_DATA +#undef DXGI_ERROR_UNSUPPORTED +#undef DXGI_ERROR_DEVICE_REMOVED +#undef DXGI_ERROR_DEVICE_HUNG +#undef DXGI_ERROR_DEVICE_RESET +#undef DXGI_ERROR_WAS_STILL_DRAWING +#undef DXGI_ERROR_FRAME_STATISTICS_DISJOINT +#undef DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE +#undef DXGI_ERROR_DRIVER_INTERNAL_ERROR +#undef DXGI_ERROR_NONEXCLUSIVE +#undef DXGI_ERROR_NOT_CURRENTLY_AVAILABLE +#undef DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED +#undef DXGI_ERROR_REMOTE_OUTOFMEMORY +#endif #include #include #include diff --git a/code/nel/src/net/buf_server.cpp b/code/nel/src/net/buf_server.cpp index 09b061fd4..301972d68 100644 --- a/code/nel/src/net/buf_server.cpp +++ b/code/nel/src/net/buf_server.cpp @@ -716,7 +716,7 @@ uint64 CBufServer::newBytesReceived() { uint64 b = bytesReceived(); uint64 nbrecvd = b - _PrevBytesPoppedIn; - //nlinfo( "b: %"NL_I64"u new: %"NL_I64"u", b, nbrecvd ); + //nlinfo( "b: %" NL_I64 "u new: %" NL_I64 "u", b, nbrecvd ); _PrevBytesPoppedIn = b; return nbrecvd; } @@ -728,7 +728,7 @@ uint64 CBufServer::newBytesSent() { uint64 b = bytesSent(); uint64 nbsent = b - _PrevBytesPushedOut; - //nlinfo( "b: %"NL_I64"u new: %"NL_I64"u", b, nbsent ); + //nlinfo( "b: %" NL_I64 "u new: %" NL_I64 "u", b, nbsent ); _PrevBytesPushedOut = b; return nbsent; } diff --git a/code/nel/src/net/callback_client.cpp b/code/nel/src/net/callback_client.cpp index f05648016..2a5871c2f 100644 --- a/code/nel/src/net/callback_client.cpp +++ b/code/nel/src/net/callback_client.cpp @@ -311,7 +311,7 @@ void CCallbackClient::connect( const CInetAddress& addr ) throw ESocketConnectionFailed( addr ); //break; default : - nlwarning( "LNETL3C: No connection event in replay data, at update #%"NL_I64"u", _MR_UpdateCounter ); + nlwarning( "LNETL3C: No connection event in replay data, at update #%" NL_I64 "u", _MR_UpdateCounter ); } } #endif @@ -346,7 +346,7 @@ void CCallbackClient::disconnect( TSockId hostid ) // Read (skip) disconnection in the file if ( ! (_MR_Recorder.checkNextOne( _MR_UpdateCounter ) == Disconnecting) ) { - nlwarning( "LNETL3C: No disconnection event in the replay data, at update #%"NL_I64"u", _MR_UpdateCounter ); + nlwarning( "LNETL3C: No disconnection event in the replay data, at update #%" NL_I64 "u", _MR_UpdateCounter ); } } // Record or replay disconnection (because disconnect() in the client does not push a disc. event) diff --git a/code/nel/src/net/message_recorder.cpp b/code/nel/src/net/message_recorder.cpp index ec52ad1da..2f27be151 100644 --- a/code/nel/src/net/message_recorder.cpp +++ b/code/nel/src/net/message_recorder.cpp @@ -301,7 +301,7 @@ TNetworkEvent CMessageRecorder::checkNextOne( sint64 updatecounter ) TMessageRecord record; if ( getNext( record, updatecounter ) ) { - nldebug( "MR: Check next one: %s at update %"NL_I64"u", EventToString(record.Event).c_str(), updatecounter ); + nldebug( "MR: Check next one: %s at update %" NL_I64 "u", EventToString(record.Event).c_str(), updatecounter ); return record.Event; } else @@ -330,7 +330,7 @@ TNetworkEvent CMessageRecorder::replayConnectionAttempt( const CInetAddress& add { // Found event = (*ipr).Event; - nldebug( "MR: Connection attempt found at update %"NL_I64"u", (*ipr).UpdateCounter ); + nldebug( "MR: Connection attempt found at update %" NL_I64 "u", (*ipr).UpdateCounter ); _ConnectionAttempts.erase( ipr ); return event; } @@ -348,7 +348,7 @@ TNetworkEvent CMessageRecorder::replayConnectionAttempt( const CInetAddress& add if ( stored_addr == addr ) { // Found - nldebug( "MR: Connection attempt found at update %"NL_I64"u", (*ipr).UpdateCounter ); + nldebug( "MR: Connection attempt found at update %" NL_I64 "u", (*ipr).UpdateCounter ); _PreloadedRecords.erase( ipr ); return event; } @@ -367,7 +367,7 @@ TNetworkEvent CMessageRecorder::replayConnectionAttempt( const CInetAddress& add if ( stored_addr == addr ) { // Found - nldebug( "MR: Connection attempt found at update %"NL_I64"u", rec.UpdateCounter ); + nldebug( "MR: Connection attempt found at update %" NL_I64 "u", rec.UpdateCounter ); return rec.Event; } else diff --git a/code/nel/src/net/net_log.cpp b/code/nel/src/net/net_log.cpp index c6702be2f..9f563bf98 100644 --- a/code/nel/src/net/net_log.cpp +++ b/code/nel/src/net/net_log.cpp @@ -72,12 +72,12 @@ void CNetLog::output( const char *srchost, uint8 msgnum, const char *desthost, const char *msgname, uint32 msgsize ) { /*OLD char line [1024]; - smprintf( line, 1024, "@@%"NL_I64"d@%s@%hu@%s@%s@%s@%u@", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0), + smprintf( line, 1024, "@@%" NL_I64 "d@%s@%hu@%s@%s@%s@%u@", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0), srchost, (uint16)msgnum, _ProcessName.c_str(), desthost, msgname, msgsize ); displayRawNL( line ); */ -/* displayRawNL( "@@%"NL_I64"d@%s@%hu@%s@%s@%s@%u@", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0), +/* displayRawNL( "@@%" NL_I64 "d@%s@%hu@%s@%s@%s@%u@", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0), srchost, (uint16)msgnum, _ProcessName.c_str(), desthost, msgname, msgsize ); */ displayRawNL( "@@0@%s@%hu@%s@%s@%s@%u@", @@ -91,11 +91,11 @@ void CNetLog::output( const char *srchost, uint8 msgnum, void CNetLog::input( const char *srchost, uint8 msgnum, const char *desthost ) { /*OLD char line [1024]; - smprintf( line, 1024, "##%"NL_I64"d#%s#%hu#%s#%s#", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0), + smprintf( line, 1024, "##%" NL_I64 "d#%s#%hu#%s#%s#", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0), srchost, msgnum, _ProcessName.c_str(), desthost ); displayRawNL( line ); */ -/* displayRawNL( "##%"NL_I64"d#%s#%hu#%s#%s#", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0), +/* displayRawNL( "##%" NL_I64 "d#%s#%hu#%s#%s#", (CUniTime::Sync?CUniTime::getUniTime():(TTime)0), srchost, msgnum, _ProcessName.c_str(), desthost ); */ displayRawNL( "##0#%s#%hu#%s#%s#", diff --git a/code/nel/src/net/unified_network.cpp b/code/nel/src/net/unified_network.cpp index 788dcdf12..0f4396ef5 100644 --- a/code/nel/src/net/unified_network.cpp +++ b/code/nel/src/net/unified_network.cpp @@ -251,7 +251,7 @@ void uncbServiceIdentification(CMessage &msgin, TSockId from, CCallbackNetBase & TServiceId inSid; if (from->appId () != AppIdDeadConnection) - AUTOCHECK_DISPLAY ("HNETL5: received a connect ident from an unknown connection 0x%"NL_I64"X", from->appId ()); + AUTOCHECK_DISPLAY ("HNETL5: received a connect ident from an unknown connection 0x%" NL_I64 "X", from->appId ()); // recover the service name and id msgin.serial(inSName); @@ -362,7 +362,7 @@ void uncbMsgProcessing(CMessage &msgin, TSockId from, CCallbackNetBase &/* netba if (uc == 0) { - nlwarning ("HNETL5: Received a message from a service %hu that is not ready (bad appid? 0x%"NL_I64"X)", sid.get(), from->appId ()); + nlwarning ("HNETL5: Received a message from a service %hu that is not ready (bad appid? 0x%" NL_I64 "X)", sid.get(), from->appId ()); return; } if((*itcb).second == 0) @@ -1139,7 +1139,7 @@ void CUnifiedNetwork::update(TTime timeout) if ( remainingTime > prevRemainingTime ) { // Restart at previousTime - nldebug( "Backward time sync detected (at least -%"NL_I64"d ms)", remainingTime - prevRemainingTime ); + nldebug( "Backward time sync detected (at least -%" NL_I64 "d ms)", remainingTime - prevRemainingTime ); remainingTime = prevRemainingTime; t0 = currentTime - (timeout - remainingTime); } @@ -1935,7 +1935,7 @@ void CUnifiedNetwork::autoCheck() for (j = 0; j < _IdCnx[i].Connections.size (); j++) { - if (_IdCnx[i].Connections[j].valid() && !_IdCnx[i].Connections[j].IsServerConnection && _IdCnx[i].Connections[j].CbNetBase->connected () && _IdCnx[i].Connections[j].getAppId() != i) AUTOCHECK_DISPLAY ("HLNET5: sid %d bad appid %"NL_I64"X", i, _IdCnx[i].Connections[j].getAppId()); + if (_IdCnx[i].Connections[j].valid() && !_IdCnx[i].Connections[j].IsServerConnection && _IdCnx[i].Connections[j].CbNetBase->connected () && _IdCnx[i].Connections[j].getAppId() != i) AUTOCHECK_DISPLAY ("HLNET5: sid %d bad appid %" NL_I64 "X", i, _IdCnx[i].Connections[j].getAppId()); } for (j = 0; j < _IdCnx[i].NetworkConnectionAssociations.size (); j++) diff --git a/code/nel/src/net/unitime.cpp b/code/nel/src/net/unitime.cpp index 057c29373..55e00a311 100644 --- a/code/nel/src/net/unitime.cpp +++ b/code/nel/src/net/unitime.cpp @@ -44,11 +44,11 @@ void _CUniTime::setUniTime (NLMISC::TTime /* uTime */, NLMISC::TTime /* lTime */ TTime lt = getLocalTime (); TTime delta = uTime - lTime + _SyncLocalTime - _SyncUniTime; - nlinfo ("_CUniTime::setUniTime(%"NL_I64"d, %"NL_I64"d): Resyncing delta %"NL_I64"dms",uTime,lTime,delta); + nlinfo ("_CUniTime::setUniTime(%" NL_I64 "d, %" NL_I64 "d): Resyncing delta %" NL_I64 "dms",uTime,lTime,delta); } else { - nlinfo ("_CUniTime::setUniTime(%"NL_I64"d, %"NL_I64"d)",uTime,lTime); + nlinfo ("_CUniTime::setUniTime(%" NL_I64 "d, %" NL_I64 "d)",uTime,lTime); Sync = true; } _SyncUniTime = uTime; @@ -191,7 +191,7 @@ void _CUniTime::syncUniTimeFromService (CCallbackNetBase::TRecordingState /* rec after = CTime::getLocalTime (); delta = after - before; - nlinfo ("_CUniTime::syncUniTimeFromService(): ping:%"NL_I64"dms, time:%ds, unitime:%"NL_I64"dms", delta, GetUniversalTimeSecondsSince1970, GetUniversalTimeUniTime); + nlinfo ("_CUniTime::syncUniTimeFromService(): ping:%" NL_I64 "dms, time:%ds, unitime:%" NL_I64 "dms", delta, GetUniversalTimeSecondsSince1970, GetUniversalTimeUniTime); // <-- from here to the "-->" comment, the block must be executed in less than one second or an infinite loop occurs @@ -222,11 +222,11 @@ void _CUniTime::syncUniTimeFromService (CCallbackNetBase::TRecordingState /* rec // adjust the unitime to the current localtime GetUniversalTimeUniTime += deltaAdjust; - nlinfo ("_CUniTime::syncUniTimeFromService(): rtime:%ds, runitime:%"NL_I64"ds, rlocaltime:%"NL_I64"d, deltaAjust:%"NL_I64"dms", nextsecond, GetUniversalTimeUniTime, lt, deltaAdjust); + nlinfo ("_CUniTime::syncUniTimeFromService(): rtime:%ds, runitime:%" NL_I64 "ds, rlocaltime:%" NL_I64 "d, deltaAjust:%" NL_I64 "dms", nextsecond, GetUniversalTimeUniTime, lt, deltaAdjust); } else { - nlinfo ("_CUniTime::syncUniTimeFromService(): runitime:%"NL_I64"ds, rlocaltime:%"NL_I64"d", GetUniversalTimeUniTime, lt); + nlinfo ("_CUniTime::syncUniTimeFromService(): runitime:%" NL_I64 "ds, rlocaltime:%" NL_I64 "d", GetUniversalTimeUniTime, lt); } _CUniTime::setUniTime (GetUniversalTimeUniTime, lt); @@ -256,7 +256,7 @@ static void cbServerAskUniversalTime (CMessage& /* msgin */, TSockId from, CCall TTime ut = _CUniTime::getUniTime (); // afficher l adresse de celui qui demande - nlinfo("UT: Send the universal time %"NL_I64"d to '%s'", ut, netbase.hostAddress(from).asString().c_str()); + nlinfo("UT: Send the universal time %" NL_I64 "d to '%s'", ut, netbase.hostAddress(from).asString().c_str()); CMessage msgout ("GUT"); msgout.serial (ut); @@ -359,7 +359,7 @@ void _CUniTime::syncUniTimeFromServer (CCallbackClient * /* client */) attempt++; } client->disconnect (); - nlinfo ("Universal time is %"NL_I64"dms with a mean error of %"NL_I64"dms", _CUniTime::getUniTime(), bestdelta/2); + nlinfo ("Universal time is %" NL_I64 "dms with a mean error of %" NL_I64 "dms", _CUniTime::getUniTime(), bestdelta/2); return; error: nlwarning ("there's no connection or lost or can't synchronize universal time"); @@ -377,12 +377,12 @@ NLMISC_CATEGORISED_COMMAND(nel, time, "displays the universal time", "") if ( _CUniTime::Sync ) { - log.displayNL ("CTime::getLocalTime(): %"NL_I64"dms, _CUniTime::getUniTime(): %"NL_I64"dms", CTime::getLocalTime (), _CUniTime::getUniTime ()); + log.displayNL ("CTime::getLocalTime(): %" NL_I64 "dms, _CUniTime::getUniTime(): %" NL_I64 "dms", CTime::getLocalTime (), _CUniTime::getUniTime ()); log.displayNL ("_CUniTime::getStringUniTime(): '%s'", _CUniTime::getStringUniTime()); } else { - log.displayNL ("CTime::getLocalTime(): %"NL_I64"dms ", CTime::getLocalTime ()); + log.displayNL ("CTime::getLocalTime(): %" NL_I64 "dms ", CTime::getLocalTime ()); } return true; diff --git a/code/nel/src/pacs/edge_collide.cpp b/code/nel/src/pacs/edge_collide.cpp index 700935947..c0766b691 100644 --- a/code/nel/src/pacs/edge_collide.cpp +++ b/code/nel/src/pacs/edge_collide.cpp @@ -174,9 +174,9 @@ CRational64 CEdgeCollide::testPointMove(const CVector2f &start, const CVector2f */ /* if (numerator != numeratorInt) - nlwarning("numerator(%f) != numeratorInt(%"NL_I64"d)", numerator, numeratorInt); + nlwarning("numerator(%f) != numeratorInt(%" NL_I64 "d)", numerator, numeratorInt); if (denominator != denominatorInt) - nlwarning("denominator(%f) != denominatorInt(%"NL_I64"d)", denominator, denominatorInt); + nlwarning("denominator(%f) != denominatorInt(%" NL_I64 "d)", denominator, denominatorInt); */ return CRational64(numeratorInt, denominatorInt); }