diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-01-08 04:36:12 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-01-08 04:36:12 +0000 |
commit | b2fa9805eb63d5daa1dd8fab1edf0c85fb7ebfc0 (patch) | |
tree | a07aae86ed120807b8f2d5f621e575f4257115c8 /Foundation | |
parent | 31ce8143b3739153e88bd6847e1fbaf7633f6233 (diff) |
[Author: dmaclach]
Added some basic casting debugging goodness to GTM.
Opinions? added to help catch a bug in QSB.
R=thomasvl
DELTA=55 (55 added, 0 deleted, 0 changed)
Diffstat (limited to 'Foundation')
-rw-r--r-- | Foundation/GTMFileSystemKQueue.m | 5 | ||||
-rw-r--r-- | Foundation/GTMHTTPServer.m | 4 | ||||
-rw-r--r-- | Foundation/GTMObjC2RuntimeTest.m | 7 | ||||
-rw-r--r-- | Foundation/GTMSignalHandler.m | 3 |
4 files changed, 12 insertions, 7 deletions
diff --git a/Foundation/GTMFileSystemKQueue.m b/Foundation/GTMFileSystemKQueue.m index 1db71c1..e423de2 100644 --- a/Foundation/GTMFileSystemKQueue.m +++ b/Foundation/GTMFileSystemKQueue.m @@ -20,7 +20,7 @@ #import <unistd.h> #import "GTMDefines.h" #import "GTMDebugSelectorValidation.h" - +#import "GTMTypeCasting.h" // File descriptor for the kqueue that will hold all of our file system events. static int gFileSystemKQueueFileDescriptor = 0; @@ -118,7 +118,8 @@ static void SocketCallBack(CFSocketRef socketref, CFSocketCallBackType type, if (kevent(gFileSystemKQueueFileDescriptor, NULL, 0, &event, 1, NULL) == -1) { _GTMDevLog(@"could not pick up kqueue event. Errno %d", errno); // COV_NF_LINE } else { - GTMFileSystemKQueue *fskq = (GTMFileSystemKQueue *)event.udata; + GTMFileSystemKQueue *fskq = GTM_STATIC_CAST(GTMFileSystemKQueue, + event.udata); [fskq notify:event.fflags]; } diff --git a/Foundation/GTMHTTPServer.m b/Foundation/GTMHTTPServer.m index 7887ade..a514842 100644 --- a/Foundation/GTMHTTPServer.m +++ b/Foundation/GTMHTTPServer.m @@ -28,6 +28,7 @@ #import "GTMDebugSelectorValidation.h" #import "GTMGarbageCollection.h" #import "GTMDefines.h" +#import "GTMTypeCasting.h" @interface GTMHTTPServer (PrivateMethods) - (void)acceptedConnectionNotification:(NSNotification *)notification; @@ -283,7 +284,8 @@ startFailed: } - (void)dataAvailableNotification:(NSNotification *)notification { - NSFileHandle *connectionHandle = [notification object]; + NSFileHandle *connectionHandle = GTM_STATIC_CAST(NSFileHandle, + [notification object]); NSMutableDictionary *connDict = [self lookupConnection:connectionHandle]; if (connDict == nil) return; // we are no longer tracking this one diff --git a/Foundation/GTMObjC2RuntimeTest.m b/Foundation/GTMObjC2RuntimeTest.m index 626a625..aa57388 100644 --- a/Foundation/GTMObjC2RuntimeTest.m +++ b/Foundation/GTMObjC2RuntimeTest.m @@ -19,8 +19,7 @@ #import "GTMObjC2Runtime.h" #import "GTMSenTestCase.h" #import "GTMSystemVersion.h" - - +#import "GTMTypeCasting.h" #import <string.h> @@ -94,7 +93,9 @@ AT_REQUIRED - (void)startedTest:(NSNotification *)notification { // Logs if we are testing on Tiger or Leopard runtime. - NSString *testName = [(SenTest*)[[notification object] test] name]; + SenTestSuiteRun *suiteRun = GTM_STATIC_CAST(SenTestSuiteRun, + [notification object]); + NSString *testName = [[suiteRun test] name]; NSString *className = NSStringFromClass([GTMObjC2RuntimeTest class]); if ([testName isEqualToString:className]) { NSString *runtimeString; diff --git a/Foundation/GTMSignalHandler.m b/Foundation/GTMSignalHandler.m index b6cfb70..dd67269 100644 --- a/Foundation/GTMSignalHandler.m +++ b/Foundation/GTMSignalHandler.m @@ -18,6 +18,7 @@ #import "GTMSignalHandler.h" #import "GTMDefines.h" +#import "GTMTypeCasting.h" #import <sys/event.h> // for kqueue() and kevent #import "GTMDebugSelectorValidation.h" @@ -116,7 +117,7 @@ static void SocketCallBack(CFSocketRef socketref, CFSocketCallBackType type, if (kevent(gSignalKQueueFileDescriptor, NULL, 0, &event, 1, NULL) == -1) { _GTMDevLog(@"could not pick up kqueue event. Errno %d", errno); // COV_NF_LINE } else { - GTMSignalHandler *handler = (GTMSignalHandler *)event.udata; + GTMSignalHandler *handler = GTM_STATIC_CAST(GTMSignalHandler, event.udata); [handler notify]; } |