Permalink
Browse files

Merge pull request #128 from shpakovski/master

New project templates in Xcode 4.4 define NSUInteger differently from previous versions
  • Loading branch information...
2 parents 864aba4 + 12bb85f commit f2f2b5dd9752d776886b29a60a87b8d6663413fe Allen Ding committed May 3, 2012
Showing with 16 additions and 12 deletions.
  1. +1 −1 Kiwi/KWBeEmptyMatcher.m
  2. +1 −1 Kiwi/KWCallSite.m
  3. +4 −4 Kiwi/KWHaveMatcher.m
  4. +4 −2 Kiwi/KWIntercept.m
  5. +3 −1 Kiwi/KWMatcherFactory.m
  6. +3 −3 Kiwi/KWMessageTracker.m
View
@@ -54,7 +54,7 @@ - (NSString *)countPhrase {
if (self.count == 1)
return @"1 item";
else
- return [NSString stringWithFormat:@"%u items", self.count];
+ return [NSString stringWithFormat:@"%u items", (unsigned)self.count];
}
- (NSString *)failureMessageForShould {
View
@@ -39,7 +39,7 @@ - (void)dealloc {
#pragma mark Identifying and Comparing
- (NSUInteger)hash {
- return [[NSString stringWithFormat:@"%@%u", self.filename, self.lineNumber] hash];
+ return [[NSString stringWithFormat:@"%@%u", self.filename, (unsigned)self.lineNumber] hash];
}
- (BOOL)isEqual:(id)anObject {
View
@@ -133,21 +133,21 @@ - (NSString *)actualCountPhrase {
if (self.actualCount == 1)
return @"1 item";
else
- return [NSString stringWithFormat:@"%u items", self.actualCount];
+ return [NSString stringWithFormat:@"%u items", (unsigned)self.actualCount];
}
- (NSString *)failureMessageForShould {
return [NSString stringWithFormat:@"expected subject to %@ %u %@, got %@",
[self verbPhrase],
- self.count,
+ (unsigned)self.count,
[self itemPhrase],
[self actualCountPhrase]];
}
- (NSString *)failureMessageForShouldNot {
return [NSString stringWithFormat:@"expected subject not to %@ %u %@",
[self verbPhrase],
- self.count,
+ (unsigned)self.count,
[self itemPhrase]];
}
@@ -156,7 +156,7 @@ - (NSString *)failureMessageForShouldNot {
- (NSString *)description
{
- return [NSString stringWithFormat:@"%@ %u %@", [self verbPhrase], self.count, [self itemPhrase]];
+ return [NSString stringWithFormat:@"%@ %u %@", [self verbPhrase], (unsigned)self.count, [self itemPhrase]];
}
#pragma mark -
View
@@ -162,7 +162,8 @@ Class KWRestoreOriginalClass(id anObject) {
if (KWClassIsInterceptClass(interceptClass))
{
Class originalClass = class_getSuperclass(interceptClass);
- anObject->isa = originalClass;
+ // anObject->isa = originalClass;
+ object_setClass(anObject, originalClass);
}
return interceptClass;
}
@@ -191,7 +192,8 @@ void KWInterceptedForwardInvocation(id anObject, SEL aSelector, NSInvocation* an
Class interceptClass = KWRestoreOriginalClass(anObject);
[anInvocation invoke];
- anObject->isa = interceptClass;
+ // anObject->isa = interceptClass;
+ object_setClass(anObject, interceptClass);
}
void KWInterceptedDealloc(id anObject, SEL aSelector) {
View
@@ -73,8 +73,10 @@ - (void)registerMatcherClassesWithNamespacePrefix:(NSString *)aNamespacePrefix {
Class *classes = malloc(sizeof(Class) * numberOfClasses);
numberOfClasses = objc_getClassList(classes, numberOfClasses);
- if (numberOfClasses == 0)
+ if (numberOfClasses == 0) {
+ free(classes);
return;
+ }
for (int i = 0; i < numberOfClasses; ++i) {
Class candidateClass = classes[i];
View
@@ -96,7 +96,7 @@ - (NSString *)phraseForCount:(NSUInteger)aCount {
if (aCount == 1)
return @"1 time";
- return [NSString stringWithFormat:@"%d times", aCount];
+ return [NSString stringWithFormat:@"%d times", (int)aCount];
}
- (NSString *)expectedCountPhrase {
@@ -144,8 +144,8 @@ - (NSString *)description {
return [NSString stringWithFormat:@"messagePattern: %@\nmode: %@\ncount: %d\nreceiveCount: %d",
self.messagePattern,
self.modeString,
- self.count,
- self.receivedCount];
+ (int)self.count,
+ (int)self.receivedCount];
}
@end

0 comments on commit f2f2b5d

Please sign in to comment.