1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

Remove useless ref macro, since it conflicts with VS2010's libraries.

The compiler warnings will have to be cleaned up later (without the use of a silly macro)
This commit is contained in:
2011-04-06 19:39:14 -07:00
parent a9a69421eb
commit 4218993bf5
45 changed files with 13 additions and 354 deletions

View File

@ -228,8 +228,6 @@ static void INtOpDispatch (
//===========================================================================
static unsigned THREADCALL NtWorkerThreadProc (AsyncThread * thread) {
ref(thread);
ThreadDenyBlock();
unsigned sleepMs = INFINITE;
@ -324,7 +322,6 @@ void INtConnCompleteOperation (NtObject * ntObj) {
return;
DWORD err = GetLastError();
ref(err);
switch (ntObj->ioType) {
case kNtFile:
INtFileDelete((NtFile *) ntObj);

View File

@ -790,11 +790,6 @@ static void __cdecl DumpInvalidData (
const char fmt[],
...
) {
ref(filename);
ref(bytes);
ref(data);
ref(fmt);
wchar path[MAX_PATH];
PathGetProgramDirectory(path, arrsize(path));
PathAddFilename(path, path, L"Log", arrsize(path));
@ -931,7 +926,6 @@ void INtSockDelete (
sock->notifyProc = nil;
notifyProc((AsyncSocket) sock, kNotifySocketDisconnect, nil, &sock->userState);
DWORD err = GetLastError();
ref(err);
}
else {
// Since the no application notification procedure was
@ -1000,7 +994,6 @@ void INtSocketOpCompleteSocketRead (
if (sock->connType == kConnTypeCliToAuth) {
int x = 0;
ref(x);
}
if (!SocketDispatchRead(sock))

View File

@ -991,10 +991,6 @@ void W9xSocketConnect (
unsigned connectMs,
unsigned localPort
) {
// Not supported for W9X
ref(connectMs);
ref(localPort);
// If necessary, startup the window and message queue
HWND window = StartupWindow();
@ -1139,8 +1135,6 @@ unsigned W9xSocketStartListening (
const NetAddress & listenAddr,
FAsyncNotifySocketProc notifyProc
) {
ref(listenAddr);
ref(notifyProc);
return 0;
}
@ -1150,8 +1144,6 @@ void W9xSocketStopListening (
const NetAddress & listenAddr,
FAsyncNotifySocketProc notifyProc
) {
ref(listenAddr);
ref(notifyProc);
}
//===========================================================================
@ -1174,9 +1166,6 @@ void W9xSocketSetNotifyProc (
AsyncSocket sock,
FAsyncNotifySocketProc notifyProc
) {
ref(sock);
ref(notifyProc);
// This provider does not allow changing the notification procedure
FATAL("SocketSetNotifyProc");
}
@ -1188,8 +1177,6 @@ void W9xSocketSetBacklogAlloc (
) {
// This provider does not limit the maximum backlog allocation
ref(sock);
ref(bufferSize);
}

View File

@ -376,8 +376,6 @@ bool W9xThreadWaitId (
AsyncId asyncId,
unsigned timeoutMs
) {
ref(file);
// Find a pending I/O operation with the given id
s_critSect.Enter();
CThreadDispRec * disp;

View File

@ -88,8 +88,6 @@ AsyncThreadTaskList::~AsyncThreadTaskList () {
//===========================================================================
static unsigned THREADCALL ThreadTaskProc (AsyncThread * thread) {
ref(thread);
PerfAddCounter(kAsyncPerfThreadTaskThreadsActive, 1);
for (;;) {
@ -250,7 +248,6 @@ void AsyncThreadTaskAdd (
ASSERT(taskList);
ASSERT(callback);
ASSERT(priority == kThreadTaskPriorityNormal);
ref(priority);
// Allocate a new task record
ThreadTask * task = NEW(ThreadTask);

View File

@ -75,7 +75,6 @@ static void DoTransgamingCheck () {
//===========================================================================
static void IAsyncInitUseW9x () {
ref(IAsyncInitUseW9x);
#ifdef HS_BUILD_FOR_WIN32
W9xGetApi(&g_api);
#else
@ -85,7 +84,6 @@ static void IAsyncInitUseW9x () {
//===========================================================================
static void IAsyncInitUseNt () {
ref(IAsyncInitUseNt);
#ifdef HS_BUILD_FOR_WIN32
NtGetApi(&g_api);
#else
@ -95,7 +93,6 @@ static void IAsyncInitUseNt () {
//===========================================================================
static void IAsyncInitUseUnix () {
ref(IAsyncInitUseUnix);
#ifdef HS_BUILD_FOR_UNIX
#error Unix I/O not implemented yet
UxGetApi(&g_api);
@ -106,7 +103,6 @@ static void IAsyncInitUseUnix () {
//===========================================================================
static void IAsyncInitForClient () {
ref(IAsyncInitForClient);
#ifdef HS_BUILD_FOR_WIN32
DoTransgamingCheck();
if (s_transgaming) {
@ -124,7 +120,6 @@ static void IAsyncInitForClient () {
//===========================================================================
static void IAsyncInitForServer () {
ref(IAsyncInitForServer);
#ifdef HS_BUILD_FOR_WIN32
IAsyncInitUseNt();
#elif HS_BUILD_FOR_UNIX

View File

@ -127,9 +127,6 @@ static void LogFileNotifyProc (
AsyncNotifyFile * notify,
void ** userState
) {
ref(file);
ref(userState);
switch (code) {
case kNotifyFileWrite:
FREE(notify->param);
@ -147,8 +144,6 @@ static void LogFileNotifyProc (
//============================================================================
static void AllocLogBuffer_CS (unsigned index) {
ref(AllocLogBuffer_CS);
ASSERT(!s_logBuf[index]);
s_logBuf[index] = (char *)ALLOC(s_logSize[index]);
s_logPos[index] = 0;
@ -159,8 +154,6 @@ static void AllocLogBuffer_CS (unsigned index) {
//============================================================================
static void FreeLogBuffer_CS (unsigned index) {
ref(FreeLogBuffer_CS);
if (s_logBuf[index]) {
FREE(s_logBuf[index]);
s_logBuf[index] = nil;
@ -306,8 +299,6 @@ static void FlushLogFile_CS (
unsigned index,
TimeDesc timeDesc
) {
ref(FlushLogFile_CS);
bool close = !s_running || (s_logTime[index].day != timeDesc.day);
WriteLogFile_CS(index, close);
if (close)
@ -316,8 +307,6 @@ static void FlushLogFile_CS (
//============================================================================
static unsigned FlushLogsTimerCallback (void *) {
ref(FlushLogsTimerCallback);
AsyncLogFlush();
return kAsyncTimeInfinite;
}
@ -411,10 +400,6 @@ void AsyncLogWriteMsg (
ELogSeverity severity,
const wchar msg[]
) {
ref(facility);
ref(severity);
ref(msg);
if (!s_running)
return;

View File

@ -725,9 +725,6 @@ unsigned IniGetBoundedValue (
unsigned maxVal,
unsigned defVal
) {
ref(key);
ref(section);
if (!value)
return defVal;

View File

@ -110,8 +110,6 @@ static void ChangeDispatch_WL (IniChangeReg * marker) {
//===========================================================================
static unsigned THREADCALL IniSrvThreadProc (AsyncThread * thread) {
ref(thread);
IniChangeReg marker;
marker.fNotify = nil;
s_lock.EnterWrite();

View File

@ -127,7 +127,6 @@ namespace pnNetCli {
static void PutBufferOnWire (NetCli * cli, void * data, unsigned bytes) {
byte * temp, * heap = NULL;
ref(temp);
if (cli->mode == kNetCliModeEncrypted) {
// Encrypt data...
@ -224,7 +223,6 @@ static void BufferedSendData (
return;
unsigned_ptr const * const msgEnd = msg + fieldCount;
ref(msgEnd);
const NetMsgInitSend * sendMsg = NetMsgChannelFindSendMessage(cli->channel, msg[0]);
ASSERT(msg[0] == sendMsg->msg.messageId);
@ -990,7 +988,6 @@ bool NetCliDispatch (
if (cli->mode == kNetCliModeEncrypted) {
// Decrypt data...
byte * temp, * heap = NULL;
ref(temp);
#ifndef NO_ENCRYPTION
if (bytes <= 2048)
@ -1008,7 +1005,6 @@ bool NetCliDispatch (
// Add data to accumulator and dispatch
cli->input.Add(bytes, data);
bool result = DispatchData(cli, param);
ref(result);
#ifdef SERVER
cli->recvDispatch = result;

View File

@ -62,8 +62,6 @@ static void LookupCallback (
unsigned addrCount,
const NetAddress addrs[]
) {
ref(name);
DNSParam * p = (DNSParam *)param;
if (addrCount) {
unsigned node = NetAddressGetNode(addrs[0]);

View File

@ -138,8 +138,6 @@ static bool Recv_PingReply (
unsigned bytes,
void *
) {
ref(bytes);
const Auth2Cli_PingReply & reply = *(const Auth2Cli_PingReply *)msg;
AuthTrans * trans;
@ -399,8 +397,6 @@ static bool AuthSocketNotifyCallback (
//============================================================================
static bool Recv_File2Cli_ManifestReply (FileConn * conn, const File2Cli_ManifestReply & msg) {
ref(conn);
FileTrans * trans;
s_critsect.Enter();
{

View File

@ -140,8 +140,6 @@ static inline bool ICompareStringI (const T lhs[], const T rhs[]) {
//============================================================================
static inline bool ICompareArray (const byte lhs[], const byte rhs[]) {
ref(lhs);
ref(rhs);
return false;
}

View File

@ -41,7 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// This line must NEVER be modified manually; it is automatically updated
// by the build server.
#define BUILD_ID 902
#define BUILD_ID 897
COMPILER_ASSERT(BUILD_ID != 0);

View File

@ -396,8 +396,6 @@ static void AsyncLookupCallback (
unsigned addrCount,
const NetAddress addrs[]
) {
ref(name);
ConnectParam * cp = (ConnectParam *)param;
if (!addrCount) {

View File

@ -85,7 +85,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// 127.0.0.0 - 127.0.0.255
// (lowest)
static int NetAddressNodeSortValueNetOrder (NetAddressNode addr) {
ref(NetAddressNodeSortValueNetOrder);
// Loopback addresses
if ((addr & kNetClassALoopbackMask) == (kNetClassALoopbackAddr & kNetClassALoopbackMask))
return 4;

View File

@ -77,7 +77,6 @@ unsigned CBaseArray::CalcAllocGrowth (unsigned newAlloc, unsigned oldAlloc, unsi
//===========================================================================
void * CBaseArray::ReallocPtr (void * ptr, unsigned bytes) {
ref(ptr);
void * newPtr = nil;
if (bytes) {
newPtr = ALLOCFLAGS(bytes, ARR_MEMORY_FLAGS);

View File

@ -275,12 +275,12 @@ template<class T>
class TArrayCopyBits {
public:
inline static void Assign (T * dest, const T source[], unsigned count);
inline static void Construct (T * dest) { ref(dest); }
inline static void Construct (T * dest, unsigned count) { ref(dest); ref(count); }
inline static void Construct (T * dest) { }
inline static void Construct (T * dest, unsigned count) { }
inline static void CopyConstruct (T * dest, const T & source);
inline static void CopyConstruct (T * dest, const T source[], unsigned count);
inline static void Destruct (T * dest) { ref(dest); }
inline static void Destruct (T * dest, unsigned count) { ref(dest); ref(count); }
inline static void Destruct (T * dest) { }
inline static void Destruct (T * dest, unsigned count) { }
};
//===========================================================================
@ -362,14 +362,12 @@ void TArrayCopyObject<T>::CopyConstruct (T * dest, const T source[], unsigned co
//===========================================================================
template<class T>
void TArrayCopyObject<T>::Destruct (T * dest) {
ref(dest);
dest->~T();
}
//===========================================================================
template<class T>
void TArrayCopyObject<T>::Destruct (T * dest, unsigned count) {
ref(dest);
for (unsigned loop = count; loop--; )
dest[loop].~T();
}

View File

@ -91,8 +91,6 @@ unsigned Base64Encode (
ASSERT(dstChars >= Base64EncodeSize(srcChars));
ASSERT(dstData);
ref(dstChars);
const char * dstBase = dstData;
const byte * srcTerm = srcData + srcChars;
for (;;) switch (srcTerm - srcData) {
@ -136,7 +134,6 @@ unsigned Base64Decode (
ASSERT(srcData);
ASSERT(dstChars >= Base64DecodeSize(srcChars));
ASSERT(dstData);
ref(dstChars);
const byte * dstBase = dstData;
const char * srcTerm = srcData + srcChars;

View File

@ -597,15 +597,10 @@ bool CCmdParser::IsSpecified (const wchar name[]) const {
//===========================================================================
void CCmdParser::OnError (const wchar str[], ECmdError errorCode, const wchar arg[], const wchar value[]) {
ref(str);
ref(errorCode);
ref(arg);
ref(value);
}
//===========================================================================
bool CCmdParser::OnExtra (const wchar str[]) {
ref(str);
return false;
}

View File

@ -143,7 +143,7 @@ static void Rc4Codec (
unsigned sourceBytes,
const void * sourceData
) {
ref(encrypt); // RC4 uses the same algorithm to both encrypt and decrypt
// RC4 uses the same algorithm to both encrypt and decrypt
dest->SetCount(sourceBytes);
RC4((RC4_KEY *)key->handle, sourceBytes, (const unsigned char *)sourceData, dest->Ptr());
}
@ -155,7 +155,7 @@ static void Rc4Codec (
unsigned bytes,
void * data
) {
ref(encrypt); // RC4 uses the same algorithm to both encrypt and decrypt
// RC4 uses the same algorithm to both encrypt and decrypt
byte * temp = ALLOCA(byte, bytes);
RC4((RC4_KEY *)key->handle, bytes, (const unsigned char *)data, temp);
MemCopy(data, temp, bytes);
@ -165,7 +165,7 @@ static void Rc4Codec (
//===========================================================================
void KeyRc4::Codec (bool encrypt, ARRAY(byte) * dest, unsigned sourceBytes, const void * sourceData) {
ref(encrypt); // RC4 uses the same algorithm to both encrypt and decrypt
// RC4 uses the same algorithm to both encrypt and decrypt
dest->SetCount(sourceBytes);
byte * destDataPtr = (byte *)dest->Ptr();
@ -365,8 +365,6 @@ void CryptKeyGenerate (
break;
case kCryptRsa:
ref(keyBits);
ref(publicData);
#if 0
KeyRsa::KeyGen(
keyBits,

View File

@ -74,8 +74,6 @@ inline void EndianConvert (
word * array,
unsigned count
) {
ref(array);
ref(count);
return;
}
@ -84,8 +82,6 @@ inline void EndianConvert (
dword * array,
unsigned count
) {
ref(array);
ref(count);
return;
}
@ -94,8 +90,6 @@ inline void EndianConvert (
qword * array,
unsigned count
) {
ref(array);
ref(count);
return;
}
@ -105,9 +99,6 @@ inline void EndianConvert (
unsigned elemCount,
unsigned elemBytes
) {
ref(data);
ref(elemCount);
ref(elemBytes);
return;
}

View File

@ -203,7 +203,6 @@ TBaseHashTable<T>::TBaseHashTable () {
//===========================================================================
template<class T>
TBaseHashTable<T>::TBaseHashTable (const TBaseHashTable<T> & source) {
ref(source);
#ifdef HS_DEBUGGING
FATAL("No copy constructor");
#endif
@ -213,7 +212,6 @@ TBaseHashTable<T>::TBaseHashTable (const TBaseHashTable<T> & source) {
//===========================================================================
template<class T>
TBaseHashTable<T> & TBaseHashTable<T>::operator= (const TBaseHashTable<T> & source) {
ref(source);
#ifdef HS_DEBUGGING
FATAL("No assignment operator");
#endif
@ -329,7 +327,6 @@ const T * TBaseHashTable<T>::Next (const T * object) const {
template<class T>
void TBaseHashTable<T>::Order (T * linkedObject, ELinkType linkType, T * existingObject) {
THashLink<T> & link = GetLink(linkedObject);
ref(link);
ASSERT(link.m_linkToFull.IsLinked());
m_fullList.Link(linkedObject, linkType, existingObject);
}

View File

@ -122,7 +122,6 @@ CBaseLink::CBaseLink () {
//===========================================================================
CBaseLink::CBaseLink (const CBaseLink & source) {
ref(source);
#ifdef HS_DEBUGGING
if (source.IsLinked())
FATAL("No copy constructor");
@ -137,7 +136,6 @@ CBaseLink::~CBaseLink () {
//===========================================================================
CBaseLink & CBaseLink::operator= (const CBaseLink & source) {
ref(source);
#ifdef HS_DEBUGGING
FATAL("No assignment operator");
#endif
@ -348,7 +346,6 @@ CBaseList::CBaseList () {
//===========================================================================
CBaseList::CBaseList (const CBaseList & source) {
m_linkOffset = LINK_OFFSET_UNINIT;
ref(source);
}
//===========================================================================
@ -359,7 +356,6 @@ CBaseList::~CBaseList () {
//===========================================================================
CBaseList & CBaseList::operator= (const CBaseList & source) {
ref(source);
return *this;
}

View File

@ -86,7 +86,6 @@ public:
ASSERT(!zeroed);
#endif
long prev = AtomicAdd(&m_ref, 1);
ref(tag);
REFTRACE("Inc %p %s: %u", this, tag, prev+1);
return prev+1;
}
@ -103,7 +102,6 @@ public:
ASSERT(!zeroed);
#endif
long prev = AtomicAdd(&m_ref, n);
ref(tag);
REFTRACE("Inc %p %s: %u", this, tag, prev+n);
return prev+n;
}
@ -133,7 +131,6 @@ public:
#endif
OnZeroRef();
}
ref(tag);
REFTRACE("Dec %p %s: %u", this, tag, prev-1);
return prev-1;
}
@ -145,8 +142,6 @@ public:
#ifdef HS_DEBUGGING
ASSERT(!zeroed);
#endif
ref(oldTag);
ref(newTag);
REFTRACE("Inc %p %s: (xfer)", this, newTag);
REFTRACE("Dec %p %s: (xfer)", this, oldTag);
}

View File

@ -76,8 +76,6 @@ void CBaseSpareList::Free (void * object, unsigned objectSize) {
// initialize memory to a freaky value in debug mode
#ifdef HS_DEBUGGING
MemSet(object, (byte) ((unsigned) object >> 4), objectSize);
#else
ref(objectSize);
#endif
// link memory block onto head of spare list
@ -140,8 +138,6 @@ void CBaseSpareList::CleanUp (const char typeName[]) {
}
#endif
}
#else
ref(typeName);
#endif
// walk chain of AllocNodes and free each of them

View File

@ -94,9 +94,9 @@ struct Uuid {
inline bool operator ! () const { return GuidIsNil(*this); }
inline bool operator < (const Uuid & rhs) const { return GuidCompare(*this, rhs) < 0; }
inline bool operator == (const Uuid & rhs) const { return GuidsAreEqual(*this, rhs); }
inline bool operator == (int rhs) const { ref(rhs); ASSERT(!rhs); return GuidsAreEqual(*this, kNilGuid); }
inline bool operator == (int rhs) const { ASSERT(!rhs); return GuidsAreEqual(*this, kNilGuid); }
inline bool operator != (const Uuid & rhs) const { return !GuidsAreEqual(*this, rhs); }
inline bool operator != (int rhs) const { ref(rhs); ASSERT(!rhs); return !GuidsAreEqual(*this, kNilGuid); }
inline bool operator != (int rhs) const { ASSERT(!rhs); return !GuidsAreEqual(*this, kNilGuid); }
};
#include <PopPack.h>