Merge remote-tracking branch 'origin/master' into mmaps

Conflicts:
	src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
This commit is contained in:
Nay
2012-09-04 19:11:04 +01:00
21 changed files with 535 additions and 519 deletions

View File

@@ -409,11 +409,12 @@ void WheatyExceptionReport::printTracesForAllThreads()
CONTEXT context;
context.ContextFlags = 0xffffffff;
HANDLE threadHandle = OpenThread(THREAD_GET_CONTEXT | THREAD_QUERY_INFORMATION, false, te32.th32ThreadID);
if (threadHandle && GetThreadContext(threadHandle, &context))
if (threadHandle)
{
WriteStackDetails(&context, false, threadHandle);
if (GetThreadContext(threadHandle, &context))
WriteStackDetails(&context, false, threadHandle);
CloseHandle(threadHandle);
}
CloseHandle(threadHandle);
}
} while (Thread32Next(hThreadSnap, &te32));
@@ -521,7 +522,7 @@ PEXCEPTION_POINTERS pExceptionInfo)
_tprintf(_T("Global Variables\r\n"));
SymEnumSymbols(GetCurrentProcess(),
(DWORD64)GetModuleHandle(szFaultingModule),
(UINT_PTR)GetModuleHandle(szFaultingModule),
0, EnumerateSymbolsCallback, 0);
// #endif // X86 Only!
@@ -989,7 +990,7 @@ PVOID pAddress)
if (!IsBadStringPtr(*(PSTR*)pAddress, 32))
{
pszCurrBuffer += sprintf(pszCurrBuffer, " = \"%.31s\"",
*(PDWORD)pAddress);
*(PSTR*)pAddress);
}
else
pszCurrBuffer += sprintf(pszCurrBuffer, " = %X",

View File

@@ -59,7 +59,7 @@ void AppenderConsole::InitColors(std::string const& str)
void AppenderConsole::SetColor(bool stdout_stream, ColorTypes color)
{
#if PLATFORM == PLATFORWINDOWS
#if PLATFORM == PLATFORM_WINDOWS
static WORD WinColorFG[MaxColors] =
{
0, // BLACK
@@ -146,7 +146,7 @@ void AppenderConsole::SetColor(bool stdout_stream, ColorTypes color)
void AppenderConsole::ResetColor(bool stdout_stream)
{
#if PLATFORM == PLATFORWINDOWS
#if PLATFORM == PLATFORM_WINDOWS
HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE);
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
#else

View File

@@ -92,7 +92,7 @@ Tokens::Tokens(const std::string &src, const char sep, uint32 vectorReserve)
void stripLineInvisibleChars(std::string &str)
{
static std::string invChars = " \t\7\n";
static std::string const invChars = " \t\7\n";
size_t wpos = 0;

View File

@@ -51,7 +51,7 @@ std::string TimeToTimestampStr(time_t t);
inline uint32 secsToTimeBitFields(time_t secs)
{
tm* lt = localtime(&secs);
return (lt->tm_year - 100) << 24 | lt->tm_mon << 20 | (lt->tm_mday - 1) << 14 | lt->tm_wday << 11 | lt->tm_hour << 6 | lt->tm_min;
return uint32((lt->tm_year - 100) << 24 | lt->tm_mon << 20 | (lt->tm_mday - 1) << 14 | lt->tm_wday << 11 | lt->tm_hour << 6 | lt->tm_min);
}
/* Return a random number in the range min..max; (max-min) must be smaller than 32768. */
@@ -89,22 +89,6 @@ inline bool roll_chance_i(int chance)
return chance > irand(0, 99);
}
inline void ApplyModUInt32Var(uint32& var, int32 val, bool apply)
{
int32 cur = var;
cur += (apply ? val : -val);
if (cur < 0)
cur = 0;
var = cur;
}
inline void ApplyModFloatVar(float& var, float val, bool apply)
{
var += (apply ? val : -val);
if (var < 0)
var = 0;
}
inline void ApplyPercentModFloatVar(float& var, float val, bool apply)
{
if (val == -100.0f) // prevent set var to zero