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

Re-define nil as nullptr, cleaning up some potential issues along the way

This commit is contained in:
2013-01-20 20:48:41 -08:00
parent c65ac61fb8
commit f86b549293
36 changed files with 123 additions and 130 deletions

View File

@ -770,7 +770,7 @@ static unsigned THREADCALL ListenThreadProc (AsyncThread *) {
for (NtOpConnAttempt * op; (op = s_connectList.Head()) != nil; s_connectList.Unlink(op)) {
if (op->hSocket != INVALID_SOCKET) {
closesocket(op->hSocket);
op->hSocket = nil;
op->hSocket = 0;
}
INtConnPostOperation(nil, op, 0);
}

View File

@ -306,7 +306,7 @@ void AsyncAddressLookupName (
sizeof(lookup->buffer)
);
if (!lookup->cancelHandle) {
PostMessage(s_lookupWindow, WM_LOOKUP_FOUND_HOST, nil, (unsigned) -1);
PostMessage(s_lookupWindow, WM_LOOKUP_FOUND_HOST, 0, (unsigned) -1);
}
}
s_critsect.Leave();
@ -356,7 +356,7 @@ void AsyncAddressLookupAddr (
sizeof(lookup->buffer)
);
if (!lookup->cancelHandle) {
PostMessage(s_lookupWindow, WM_LOOKUP_FOUND_HOST, nil, (unsigned) -1);
PostMessage(s_lookupWindow, WM_LOOKUP_FOUND_HOST, 0, (unsigned) -1);
}
}
s_critsect.Leave();
@ -381,7 +381,7 @@ void AsyncAddressLookupCancel (
lookup->cancelHandle = nil;
// initiate user callback
PostMessage(s_lookupWindow, WM_LOOKUP_FOUND_HOST, nil, (unsigned) -1);
PostMessage(s_lookupWindow, WM_LOOKUP_FOUND_HOST, 0, (unsigned) -1);
}
s_critsect.Leave();
}

View File

@ -154,7 +154,7 @@ void plFactory::IUnRegister(uint16_t hClass)
uint16_t plFactory::Register(uint16_t hClass, plCreator* worker)
{
if( !theFactory && !ICreateTheFactory() )
return nil;
return 0;
hsRefCnt_SafeRef(theFactory);
return theFactory->IRegister(hClass, worker);

View File

@ -120,15 +120,6 @@ static const char* CloneString(const plKeyData* keyData)
#endif
plKey::plKey() : fKeyData(nil)
{
}
plKey::plKey(void* ptr) : fKeyData(nil)
{
hsAssert(!ptr, "Attempting to publically construct a non-nil key");
}
plKey::plKey(const plKey& rhs) : fKeyData(rhs.fKeyData)
{
#if TRACK_REFS // FOR DEBUGGING ONLY
@ -143,13 +134,13 @@ plKey::plKey(const plKey& rhs) : fKeyData(rhs.fKeyData)
IIncRef();
}
plKey::plKey(plKeyData* data, bool ignore) : fKeyData(data)
plKey::plKey(plKeyData* data) : fKeyData(data)
{
#if TRACK_REFS // FOR DEBUGGING ONLY
if( IsTracked(fKeyData) )
{
char msg[ 512 ];
sprintf( msg, "C: Key %s %s is being constructed using the plKey(plKeyData*, bool) constructor", keyNameToLookFor, CloneString(fKeyData) );
sprintf( msg, "C: Key %s %s is being constructed using the plKey(plKeyData*) constructor", keyNameToLookFor, CloneString(fKeyData) );
//hsAssert( false, msg );
hsStatusMessageF(msg);
}

View File

@ -61,9 +61,9 @@ class plKey
{
public:
// Constructors and destructors and copy stuff
plKey();
plKey() : fKeyData(nullptr) { }
plKey(std::nullptr_t) : fKeyData(nullptr) { }
plKey(const plKey& rhs);
plKey(void* ptr); // For constructing a nil key
~plKey();
plKey& operator=(const plKey& rhs);
@ -77,7 +77,7 @@ public:
operator plKeyImp*() const { return (plKeyImp*)fKeyData; }
static plKey Make(plKeyData* data) { return plKey(data, false); }
static plKey Make(plKeyData* data) { return plKey(data); }
protected:
// Pointer to our real key
@ -86,7 +86,7 @@ protected:
void IDecRef();
// Internal constructor, extra param is to distinguish it from the void* constructor
plKey(plKeyData* data, bool ignore);
plKey(plKeyData* data);
};
//// plKeyData ///////////////////////////////////////////////////////////////

View File

@ -53,13 +53,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
//
plCameraMsg::plCameraMsg() :
plCameraMsg::plCameraMsg() :
fNewCam(nil),
fTriggerer(nil),
fTransTime(0),
fSubject(nil),
fPipe(nil),
fConfig(nil),
fActivated(false)
{
}
@ -70,7 +69,6 @@ fTriggerer(nil),
fTransTime(0),
fSubject(nil),
fPipe(nil),
fConfig(nil),
fActivated(false),
plMessage(s, r, t)
{

View File

@ -333,7 +333,7 @@ uint16_t plCoordinateInterface::GetReasons()
void plCoordinateInterface::ClearReasons()
{
fReason = nil;
fReason = 0;
}
void plCoordinateInterface::SetLocalToParent(const hsMatrix44& l2p, const hsMatrix44& p2l)