aboutsummaryrefslogtreecommitdiff
path: root/DebugUtils
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2012-06-20 21:00:18 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2012-06-20 21:00:18 +0000
commitb962a2ca36c7efbb9ae89330041a3edcd12e7704 (patch)
treec3a6fea8370576c22014fecdecdac744f522366c /DebugUtils
parent812fc139e0a33be66d7af0c4e070b76e739d317c (diff)
[Author: oster]
fix some type errors. Tested: Compiled and ran a text program R=thomasvl APPROVED=thomasvl DELTA=2 (0 added, 0 deleted, 2 changed)
Diffstat (limited to 'DebugUtils')
-rw-r--r--DebugUtils/GTMMethodCheck.m48
1 files changed, 24 insertions, 24 deletions
diff --git a/DebugUtils/GTMMethodCheck.m b/DebugUtils/GTMMethodCheck.m
index cb3c240..801278c 100644
--- a/DebugUtils/GTMMethodCheck.m
+++ b/DebugUtils/GTMMethodCheck.m
@@ -1,14 +1,14 @@
//
// GTMMethodCheck.m
-//
+//
// Copyright 2006-2008 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at
-//
+//
// http://www.apache.org/licenses/LICENSE-2.0
-//
+//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -33,16 +33,16 @@ static BOOL ConformsToNSObjectProtocol(Class cls) {
if (!cls) return NO;
const char *className = class_getName(cls);
if (!className) return NO;
-
- // We're going to assume that all Apple classes will work
+
+ // We're going to assume that all Apple classes will work
// (and aren't being checked)
- // Note to apple: why doesn't obj-c have real namespaces instead of two
- // letter hacks? If you name your own classes starting with NS this won't
+ // Note to apple: why doesn't obj-c have real namespaces instead of two
+ // letter hacks? If you name your own classes starting with NS this won't
// work for you.
// Some classes (like _NSZombie) start with _NS.
// On Leopard we have to look for CFObject as well.
// On iPhone we check Object as well
- if ((strncmp(className, "NS", 2) == 0)
+ if ((strncmp(className, "NS", 2) == 0)
|| (strncmp(className, "_NS", 3) == 0)
|| (strncmp(className, "__NS", 4) == 0)
|| (strcmp(className, "CFObject") == 0)
@@ -53,23 +53,23 @@ static BOOL ConformsToNSObjectProtocol(Class cls) {
) {
return YES;
}
-
+
// iPhone SDK does not define the |Object| class, so we instead test for the
// |NSObject| class.
#if GTM_IPHONE_SDK
// Iterate through all the protocols |cls| supports looking for NSObject.
- if (cls == [NSObject class]
+ if (cls == [NSObject class]
|| class_conformsToProtocol(cls, @protocol(NSObject))) {
return YES;
}
-#else
+#else
// Iterate through all the protocols |cls| supports looking for NSObject.
- if (cls == [Object class]
+ if (cls == [Object class]
|| class_conformsToProtocol(cls, @protocol(NSObject))) {
return YES;
}
#endif
-
+
// Recursively check the superclasses.
return ConformsToNSObjectProtocol(class_getSuperclass(cls));
}
@@ -91,20 +91,20 @@ void GTMMethodCheckMethodChecker(void) {
}
for (i = 0; i < numClasses && classes; ++i) {
Class cls = classes[i];
-
- // Since we are directly calling objc_msgSend, we need to conform to
+
+ // Since we are directly calling objc_msgSend, we need to conform to
// @protocol(NSObject), or else we will tumble into a _objc_msgForward
// recursive loop when we try and call a function by name.
if (!ConformsToNSObjectProtocol(cls)) {
// COV_NF_START
_GTMDevLog(@"GTMMethodCheckMethodChecker: Class %s does not conform to "
- "@protocol(NSObject), so won't be checked",
+ "@protocol(NSObject), so won't be checked",
class_getName(cls));
continue;
// COV_NF_END
}
// Since we are looking for a class method (+xxGMMethodCheckMethod...)
- // we need to query the isa pointer to see what methods it support, but
+ // we need to query the isa pointer to see what methods it support, but
// send the method (if it's supported) to the class itself.
unsigned int count;
Class metaClass = objc_getMetaClass(class_getName(cls));
@@ -115,7 +115,7 @@ void GTMMethodCheckMethodChecker(void) {
const char *name = sel_getName(selector);
if (strstr(name, "xxGTMMethodCheckMethod") == name) {
// Check to make sure that the method we are checking comes
- // from the same image that we are in. Since GTMMethodCheckMethodChecker
+ // from the same image that we are in. Since GTMMethodCheckMethodChecker
// is not exported, we should always find the copy in our local
// image. We compare the address of it's image with the address of
// the image which implements the method we want to check. If
@@ -124,25 +124,25 @@ void GTMMethodCheckMethodChecker(void) {
// methods. They should only be called once.
// b) prevents initializers for various classes being called too early
Dl_info methodCheckerInfo;
- if (!dladdr(GTMMethodCheckMethodChecker,
+ if (!dladdr(GTMMethodCheckMethodChecker,
&methodCheckerInfo)) {
- // COV_NF_START
- // Don't know how to force this case in a unittest.
+ // COV_NF_START
+ // Don't know how to force this case in a unittest.
// Certainly hope we never see it.
_GTMDevLog(@"GTMMethodCheckMethodChecker: Unable to get dladdr info "
- "for GTMMethodCheckMethodChecker while introspecting +[%@ %@]]",
+ "for GTMMethodCheckMethodChecker while introspecting +[%s %s]]",
class_getName(cls), name);
continue;
// COV_NF_END
}
Dl_info methodInfo;
- if (!dladdr(method_getImplementation(methods[j]),
+ if (!dladdr(method_getImplementation(methods[j]),
&methodInfo)) {
// COV_NF_START
// Don't know how to force this case in a unittest
// Certainly hope we never see it.
_GTMDevLog(@"GTMMethodCheckMethodChecker: Unable to get dladdr info "
- "for %@ while introspecting +[%@ %@]]", name,
+ "for %s while introspecting +[%s %s]]", name,
class_getName(cls), name);
continue;
// COV_NF_END