Thomas "elfprince13" Dickerson пре 8 година
родитељ
комит
878fbdb609

+ 5 - 4
Engine/source/platform/platformNet.cpp

@@ -491,10 +491,11 @@ template<class T> T ReservedSocketList<T>::resolve(NetSocket socketToResolve)
    EntryType &entry = mSocketList[socketToResolve.getHandle()];
    return entry.used ? entry.value : -1;
 }
-ConnectionNotifyEvent*   Net::smConnectionNotify = NULL;
-ConnectionAcceptedEvent* Net::smConnectionAccept = NULL;
-ConnectionReceiveEvent*  Net::smConnectionReceive = NULL;
-PacketReceiveEvent*      Net::smPacketReceive = NULL;
+
+static ConnectionNotifyEvent*   smConnectionNotify = NULL;
+static ConnectionAcceptedEvent* smConnectionAccept = NULL;
+static ConnectionReceiveEvent*  smConnectionReceive = NULL;
+static PacketReceiveEvent*      smPacketReceive = NULL;
 
 ConnectionNotifyEvent& Net::getConnectionNotifyEvent()
 {

+ 9 - 9
Engine/source/platform/profiler.cpp

@@ -48,7 +48,7 @@ Profiler *gProfiler = NULL;
 //#define TORQUE_PROFILER_DEBUG
 
 // Machinery to record the stack of node names, as a debugging aid to find
-// mismatched PROFILE_START and PROFILE_END blocks. We profile from the 
+// mismatched PROFILE_START and PROFILE_END blocks. We profile from the
 // beginning to catch profile block errors that occur when torque is starting up.
 #ifdef TORQUE_PROFILER_DEBUG
 Vector<StringTableEntry> gProfilerNodeStack;
@@ -191,7 +191,7 @@ Profiler::Profiler()
    mCurrentProfilerData->mInvokeCount = 0;
    mCurrentProfilerData->mTotalTime = 0;
    mCurrentProfilerData->mSubTime = 0;
-#ifdef TORQUE_ENABLE_PROFILE_PATH   
+#ifdef TORQUE_ENABLE_PROFILE_PATH
    mCurrentProfilerData->mPath = "";
 #endif
    mRootProfilerData = mCurrentProfilerData;
@@ -201,7 +201,7 @@ Profiler::Profiler()
 
    mProfileList = NULL;
 
-   mEnabled = TORQUE_PROFILE_AT_ENGINE_START;   
+   mEnabled = TORQUE_PROFILE_AT_ENGINE_START;
    mNextEnable = TORQUE_PROFILE_AT_ENGINE_START;
    mStackDepth = 0;
    gProfiler = this;
@@ -289,7 +289,7 @@ void Profiler::validate()
          if(!wk)
             Platform::debugBreak();
          for(wk = dp->mParent->mChildHash[walk->mNameHash & (ProfilerData::HashTableSize - 1)] ;
-               wk; wk = wk->mNextHash)
+            wk; wk = wk->mNextHash)
             if(wk == dp)
                break;
          if(!wk)
@@ -352,7 +352,7 @@ void Profiler::hashPush(ProfilerRootData *root)
    mStackDepth++;
    PROFILER_DEBUG_PUSH_NODE(root->mName);
    AssertFatal(mStackDepth <= mMaxStackDepth,
-                  "Stack overflow in profiler.  You may have mismatched PROFILE_START and PROFILE_ENDs");
+            "Stack overflow in profiler.  You may have mismatched PROFILE_START and PROFILE_ENDs");
    if(!mEnabled)
       return;
 
@@ -364,7 +364,7 @@ void Profiler::hashPush(ProfilerRootData *root)
    }
 
    if(mCurrentProfilerData->mLastSeenProfiler &&
-            mCurrentProfilerData->mLastSeenProfiler->mRoot == root)
+      mCurrentProfilerData->mLastSeenProfiler->mRoot == root)
       nextProfiler = mCurrentProfilerData->mLastSeenProfiler;
 
    if(!nextProfiler)
@@ -715,9 +715,9 @@ void Profiler::enableMarker(const char *marker, bool enable)
 
 //-----------------------------------------------------------------------------
 
-DefineEngineFunction( profilerMarkerEnable, void, ( const char* markerName, bool enable ), ( true ),   
+DefineEngineFunction( profilerMarkerEnable, void, ( const char* markerName, bool enable ), ( true ),
    "@brief Enable or disable a specific profile.\n\n"
-   "@param enable     Optional paramater to enable or disable the profile.\n"
+   "@param enable   Optional paramater to enable or disable the profile.\n"
    "@param markerName Name of a specific marker to enable or disable.\n"
    "@note Calling this function will first call profilerReset(), clearing all data from profiler. "
    "All profile markers are enabled by default.\n\n"
@@ -767,7 +767,7 @@ DefineEngineFunction( profilerDumpToFile, void, ( const char* fileName ),,
 }
 
 DefineEngineFunction( profilerReset, void, (),,
-                "@brief Resets the profiler, clearing it of all its data.\n\n"
+            "@brief Resets the profiler, clearing it of all its data.\n\n"
             "If the profiler is currently running, it will first be disabled. "
             "All markers will retain their current enabled/disabled status.\n\n"
             "@ingroup Debugging" )

+ 8 - 8
Engine/source/platform/test/netTest.cpp

@@ -76,8 +76,8 @@ TEST(Net, TCPRequest)
    handler.mDataReceived = 0;
 
    // Hook into the signals.
-   Net::smConnectionNotify ->notify(&handler, &TcpHandle::notify);
-   Net::smConnectionReceive->notify(&handler, &TcpHandle::receive);
+   Net::smConnectionNotify .notify(&handler, &TcpHandle::notify);
+   Net::smConnectionReceive.notify(&handler, &TcpHandle::receive);
 
    // Open a TCP connection to garagegames.com
    handler.mSocket = Net::openConnectTo("72.246.107.193:80");
@@ -85,8 +85,8 @@ TEST(Net, TCPRequest)
    while(Process::processEvents() && (Platform::getRealMilliseconds() < limit) ) {}
 
    // Unhook from the signals.
-   Net::smConnectionNotify ->remove(&handler, &TcpHandle::notify);
-   Net::smConnectionReceive->remove(&handler, &TcpHandle::receive);
+   Net::smConnectionNotify .remove(&handler, &TcpHandle::notify);
+   Net::smConnectionReceive.remove(&handler, &TcpHandle::receive);
 
    EXPECT_GT(handler.mDataReceived, 0)
       << "Didn't get any data back!";
@@ -139,8 +139,8 @@ struct JournalHandle
       mDataReceived = 0;
 
       // Hook into the signals.
-      Net::smConnectionNotify ->notify(this, &JournalHandle::notify);
-      Net::smConnectionReceive->notify(this, &JournalHandle::receive);
+      Net::smConnectionNotify .notify(this, &JournalHandle::notify);
+      Net::smConnectionReceive.notify(this, &JournalHandle::receive);
 
       // Open a TCP connection to garagegames.com
       mSocket = Net::openConnectTo("72.246.107.193:80");
@@ -149,8 +149,8 @@ struct JournalHandle
       while(Process::processEvents()) {}
 
       // Unhook from the signals.
-      Net::smConnectionNotify ->remove(this, &JournalHandle::notify);
-      Net::smConnectionReceive->remove(this, &JournalHandle::receive);
+      Net::smConnectionNotify .remove(this, &JournalHandle::notify);
+      Net::smConnectionReceive.remove(this, &JournalHandle::receive);
 
       EXPECT_GT(mDataReceived, 0)
          << "Didn't get any data back!";

+ 8 - 8
Engine/source/platformMac/macFileIO.mm

@@ -740,9 +740,9 @@ bool Platform::isSubDirectory(const char *pathParent, const char *pathSub)
 inline bool isGoodDirectory(dirent* entry)
 {
    return (entry->d_type == DT_DIR                          // is a dir
-           && dStrcmp(entry->d_name,".") != 0                 // not here
-           && dStrcmp(entry->d_name,"..") != 0                // not parent
-           && !Platform::isExcludedDirectory(entry->d_name)); // not excluded
+         && dStrcmp(entry->d_name,".") != 0                 // not here
+         && dStrcmp(entry->d_name,"..") != 0                // not parent
+         && !Platform::isExcludedDirectory(entry->d_name)); // not excluded
 }
 
 //-----------------------------------------------------------------------------
@@ -874,7 +874,7 @@ static bool recurseDumpDirectories(const char *basePath, const char *subPath, Ve
       if ( isDir )
       {
          if (dStrcmp(d->d_name, ".") == 0 ||
-             dStrcmp(d->d_name, "..") == 0)
+            dStrcmp(d->d_name, "..") == 0)
             continue;
          if (Platform::isExcludedDirectory(d->d_name))
             continue;
@@ -887,8 +887,8 @@ static bool recurseDumpDirectories(const char *basePath, const char *subPath, Ve
                dSprintf(child, 1024, "%s/%s", subPath, d->d_name);
             if (currentDepth < recurseDepth || recurseDepth == -1 )
                recurseDumpDirectories(basePath, child, directoryVector,
-                                      currentDepth + 1, recurseDepth,
-                                      noBasePath);
+                                 currentDepth + 1, recurseDepth,
+                                 noBasePath);
          }
          else
          {
@@ -899,8 +899,8 @@ static bool recurseDumpDirectories(const char *basePath, const char *subPath, Ve
                dSprintf(child, 1024, "/%s", d->d_name);
             if (currentDepth < recurseDepth || recurseDepth == -1)
                recurseDumpDirectories(basePath, child, directoryVector,
-                                      currentDepth + 1, recurseDepth,
-                                      noBasePath);
+                                 currentDepth + 1, recurseDepth,
+                                 noBasePath);
          }
       }
    }