mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
Applied new coding standard, see http://github.com/mangos/mangos/wikis/codingstandards for more.
This commit is contained in:
parent
899d7dec74
commit
92441a0241
21 changed files with 68 additions and 68 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -30,25 +30,25 @@ noinst_LIBRARIES = libmangosshared.a
|
||||||
|
|
||||||
# libmangosshared library will later be reused by ...
|
# libmangosshared library will later be reused by ...
|
||||||
libmangosshared_a_SOURCES = \
|
libmangosshared_a_SOURCES = \
|
||||||
Base.cpp \
|
Base.cpp \
|
||||||
Base.h \
|
Base.h \
|
||||||
ByteBuffer.h \
|
ByteBuffer.h \
|
||||||
Common.cpp \
|
Common.cpp \
|
||||||
Common.h \
|
Common.h \
|
||||||
Errors.h \
|
Errors.h \
|
||||||
Log.cpp \
|
Log.cpp \
|
||||||
Log.h \
|
Log.h \
|
||||||
MemoryLeaks.cpp \
|
MemoryLeaks.cpp \
|
||||||
MemoryLeaks.h \
|
MemoryLeaks.h \
|
||||||
Mthread.cpp \
|
Mthread.cpp \
|
||||||
Mthread.h \
|
Mthread.h \
|
||||||
ProgressBar.cpp \
|
ProgressBar.cpp \
|
||||||
ProgressBar.h \
|
ProgressBar.h \
|
||||||
Timer.h \
|
Timer.h \
|
||||||
Util.cpp \
|
Util.cpp \
|
||||||
Util.h \
|
Util.h \
|
||||||
WorldPacket.h \
|
WorldPacket.h \
|
||||||
svn_revision.h
|
svn_revision.h
|
||||||
|
|
||||||
# Get svn revision
|
# Get svn revision
|
||||||
SVN_REVISION_FILE = svn_revision.h
|
SVN_REVISION_FILE = svn_revision.h
|
||||||
|
|
@ -59,21 +59,21 @@ CLEANFILES = $(SVN_REVISION_FILE)
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
$(SVN_REVISION_FILE) : $(top_builddir)/src/tools/gensvnrevision/gensvnrevision FORCE
|
$(SVN_REVISION_FILE) : $(top_builddir)/src/tools/gensvnrevision/gensvnrevision FORCE
|
||||||
$(top_builddir)/src/tools/gensvnrevision/gensvnrevision $(top_srcdir)
|
$(top_builddir)/src/tools/gensvnrevision/gensvnrevision $(top_srcdir)
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
# Disabled packet logger
|
# Disabled packet logger
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
PacketLog.cpp \
|
PacketLog.cpp \
|
||||||
PacketLog.h
|
PacketLog.h
|
||||||
|
|
||||||
# System configuration
|
# System configuration
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
SystemConfig.h
|
SystemConfig.h
|
||||||
|
|
||||||
# System Win32 files
|
# System Win32 files
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
ServiceWin32.cpp \
|
ServiceWin32.cpp \
|
||||||
ServiceWin32.h \
|
ServiceWin32.h \
|
||||||
WheatyExceptionReport.cpp \
|
WheatyExceptionReport.cpp \
|
||||||
WheatyExceptionReport.h
|
WheatyExceptionReport.h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005,2006 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005,2006 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
@ -48,7 +48,7 @@ inline uint32 getMSTime()
|
||||||
inline uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
|
inline uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
|
||||||
{
|
{
|
||||||
// getMSTime() have limited data range and this is case when it overflow in this tick
|
// getMSTime() have limited data range and this is case when it overflow in this tick
|
||||||
if (oldMSTime > newMSTime)
|
if (oldMSTime > newMSTime)
|
||||||
return (0xFFFFFFFF - oldMSTime) + newMSTime;
|
return (0xFFFFFFFF - oldMSTime) + newMSTime;
|
||||||
else
|
else
|
||||||
return newMSTime - oldMSTime;
|
return newMSTime - oldMSTime;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
typedef ZThread::ThreadLocal<MTRand> MTRandTSS;
|
typedef ZThread::ThreadLocal<MTRand> MTRandTSS;
|
||||||
|
|
||||||
/* NOTE: Not sure if static initialization is ok for TSS objects ,
|
/* NOTE: Not sure if static initialization is ok for TSS objects ,
|
||||||
* as I see zthread uses custom implementation of the TSS
|
* as I see zthread uses custom implementation of the TSS
|
||||||
* ,and in the consturctor there is no code ,so I suppose its ok
|
* ,and in the consturctor there is no code ,so I suppose its ok
|
||||||
* If its not ok ,change it to use singleton.
|
* If its not ok ,change it to use singleton.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
@ -99,7 +99,7 @@ bool Utf8toWStr(std::string utf8str, std::wstring& wstr);
|
||||||
// in wsize==max size of buffer, out wsize==real string size
|
// in wsize==max size of buffer, out wsize==real string size
|
||||||
bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize);
|
bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize);
|
||||||
inline bool Utf8toWStr(std::string utf8str, wchar_t* wstr, size_t& wsize)
|
inline bool Utf8toWStr(std::string utf8str, wchar_t* wstr, size_t& wsize)
|
||||||
{
|
{
|
||||||
return Utf8toWStr(utf8str.c_str(), utf8str.size(), wstr, wsize);
|
return Utf8toWStr(utf8str.c_str(), utf8str.size(), wstr, wsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -159,7 +159,7 @@ inline bool isEastAsianCharacter(wchar_t wchar)
|
||||||
return true;
|
return true;
|
||||||
if(wchar >= 0x31F0 && wchar <= 0x31FF) // Katakana Phonetic Ext.
|
if(wchar >= 0x31F0 && wchar <= 0x31FF) // Katakana Phonetic Ext.
|
||||||
return true;
|
return true;
|
||||||
if(wchar >= 0x3400 && wchar <= 0x4DB5) // CJK Ideographs Ext. A
|
if(wchar >= 0x3400 && wchar <= 0x4DB5) // CJK Ideographs Ext. A
|
||||||
return true;
|
return true;
|
||||||
if(wchar >= 0x4E00 && wchar <= 0x9FC3) // Unified CJK Ideographs
|
if(wchar >= 0x4E00 && wchar <= 0x9FC3) // Unified CJK Ideographs
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -330,22 +330,22 @@ void WheatyExceptionReport::PrintSystemInfo()
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
void WheatyExceptionReport::printTracesForAllThreads()
|
void WheatyExceptionReport::printTracesForAllThreads()
|
||||||
{
|
{
|
||||||
HANDLE hThreadSnap = INVALID_HANDLE_VALUE;
|
HANDLE hThreadSnap = INVALID_HANDLE_VALUE;
|
||||||
THREADENTRY32 te32;
|
THREADENTRY32 te32;
|
||||||
|
|
||||||
DWORD dwOwnerPID = GetCurrentProcessId();
|
DWORD dwOwnerPID = GetCurrentProcessId();
|
||||||
m_hProcess = GetCurrentProcess();
|
m_hProcess = GetCurrentProcess();
|
||||||
// Take a snapshot of all running threads
|
// Take a snapshot of all running threads
|
||||||
hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 );
|
hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 );
|
||||||
if( hThreadSnap == INVALID_HANDLE_VALUE )
|
if( hThreadSnap == INVALID_HANDLE_VALUE )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Fill in the size of the structure before using it.
|
// Fill in the size of the structure before using it.
|
||||||
te32.dwSize = sizeof(THREADENTRY32 );
|
te32.dwSize = sizeof(THREADENTRY32 );
|
||||||
|
|
||||||
// Retrieve information about the first thread,
|
// Retrieve information about the first thread,
|
||||||
// and exit if unsuccessful
|
// and exit if unsuccessful
|
||||||
if( !Thread32First( hThreadSnap, &te32 ) )
|
if( !Thread32First( hThreadSnap, &te32 ) )
|
||||||
{
|
{
|
||||||
CloseHandle( hThreadSnap ); // Must clean up the
|
CloseHandle( hThreadSnap ); // Must clean up the
|
||||||
// snapshot object!
|
// snapshot object!
|
||||||
|
|
@ -355,8 +355,8 @@ void WheatyExceptionReport::printTracesForAllThreads()
|
||||||
// Now walk the thread list of the system,
|
// Now walk the thread list of the system,
|
||||||
// and display information about each thread
|
// and display information about each thread
|
||||||
// associated with the specified process
|
// associated with the specified process
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if( te32.th32OwnerProcessID == dwOwnerPID )
|
if( te32.th32OwnerProcessID == dwOwnerPID )
|
||||||
{
|
{
|
||||||
CONTEXT context;
|
CONTEXT context;
|
||||||
|
|
@ -368,7 +368,7 @@ void WheatyExceptionReport::printTracesForAllThreads()
|
||||||
}
|
}
|
||||||
CloseHandle(threadHandle);
|
CloseHandle(threadHandle);
|
||||||
}
|
}
|
||||||
} while( Thread32Next(hThreadSnap, &te32 ) );
|
} while( Thread32Next(hThreadSnap, &te32 ) );
|
||||||
|
|
||||||
// Don't forget to clean up the snapshot object.
|
// Don't forget to clean up the snapshot object.
|
||||||
CloseHandle( hThreadSnap );
|
CloseHandle( hThreadSnap );
|
||||||
|
|
@ -604,7 +604,7 @@ bool bWriteVariables, HANDLE pThreadHandle) // true if local/par
|
||||||
{
|
{
|
||||||
_tprintf( _T("\r\nCall stack:\r\n") );
|
_tprintf( _T("\r\nCall stack:\r\n") );
|
||||||
|
|
||||||
_tprintf( _T("Address Frame Function SourceFile\r\n") );
|
_tprintf( _T("Address Frame Function SourceFile\r\n") );
|
||||||
|
|
||||||
DWORD dwMachineType = 0;
|
DWORD dwMachineType = 0;
|
||||||
// Could use SymSetOptions here to add the SYMOPT_DEFERRED_LOADS flag
|
// Could use SymSetOptions here to add the SYMOPT_DEFERRED_LOADS flag
|
||||||
|
|
@ -906,10 +906,10 @@ char* Name)
|
||||||
|
|
||||||
// BasicType basicType = GetBasicType(children.ChildId[i], modBase );
|
// BasicType basicType = GetBasicType(children.ChildId[i], modBase );
|
||||||
//
|
//
|
||||||
// pszCurrBuffer += sprintf( pszCurrBuffer, rgBaseType[basicType]);
|
// pszCurrBuffer += sprintf( pszCurrBuffer, rgBaseType[basicType]);
|
||||||
//
|
//
|
||||||
// Emit the variable name
|
// Emit the variable name
|
||||||
// pszCurrBuffer += sprintf( pszCurrBuffer, "\'%s\'", Name );
|
// pszCurrBuffer += sprintf( pszCurrBuffer, "\'%s\'", Name );
|
||||||
|
|
||||||
pszCurrBuffer = FormatOutputValue( pszCurrBuffer, basicType,
|
pszCurrBuffer = FormatOutputValue( pszCurrBuffer, basicType,
|
||||||
length, (PVOID)dwFinalOffset );
|
length, (PVOID)dwFinalOffset );
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue