From 3632ae4e645f77c2c95a13f5cb40896822eda7cd Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 15 Jan 2016 11:52:09 +0100 Subject: [PATCH] Fix VS2015 warnings --HG-- branch : develop --- code/nel/src/misc/debug.cpp | 8 ++++---- code/nel/src/misc/eval_num_expr.cpp | 2 +- code/nel/src/misc/mem_displayer.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/nel/src/misc/debug.cpp b/code/nel/src/misc/debug.cpp index 45a55188c..44cd6f706 100644 --- a/code/nel/src/misc/debug.cpp +++ b/code/nel/src/misc/debug.cpp @@ -864,18 +864,18 @@ public: else if(type == "int") { if (!IsBadReadPtr(addr,sizeof(int))) - sprintf (tmp, "%d", *addr); + sprintf (tmp, "%p", (void *)(*addr)); } else if (type == "char") { if (!IsBadReadPtr(addr,sizeof(char))) if (nlisprint(*addr)) { - sprintf (tmp, "'%c'", *addr); + sprintf (tmp, "'%c'", (char)((*addr) & 0xFF)); } else { - sprintf (tmp, "%d", *addr); + sprintf (tmp, "%p", (void *)(*addr)); } } else if (type == "char*") @@ -932,7 +932,7 @@ public: if(*addr == 0) sprintf (tmp, ""); else - sprintf (tmp, "0x%p", *addr); + sprintf (tmp, "0x%p", (void *)*addr); } } diff --git a/code/nel/src/misc/eval_num_expr.cpp b/code/nel/src/misc/eval_num_expr.cpp index c47309498..1bfad17eb 100644 --- a/code/nel/src/misc/eval_num_expr.cpp +++ b/code/nel/src/misc/eval_num_expr.cpp @@ -945,7 +945,7 @@ CEvalNumExpr::TReturnState CEvalNumExpr::evalExpression (double &finalResult, TT value = (double)(uint)((floor (value+0.5)==0.0)); break; case Tilde: - value = (double)~((uint)floor (value+0.5)); + value = (double)(~((uint)floor (value+0.5)) & std::numeric_limits::max()); break; case Minus: value = -value; diff --git a/code/nel/src/misc/mem_displayer.cpp b/code/nel/src/misc/mem_displayer.cpp index d92c4d432..40cc1bb6e 100644 --- a/code/nel/src/misc/mem_displayer.cpp +++ b/code/nel/src/misc/mem_displayer.cpp @@ -99,7 +99,7 @@ static string getFuncInfo (DWORD_TYPE funcAddr, DWORD_TYPE stackAddr) if (stop==0 && (parse[i] == ',' || parse[i] == ')')) { char tmp[32]; - sprintf(tmp, "=0x%p", *((DWORD_TYPE*)(stackAddr) + 2 + pos++)); + sprintf(tmp, "=0x%p", (void *)(*((DWORD_TYPE*)(stackAddr) + 2 + pos++))); str += tmp; } str += parse[i];