Cleanup log warnings on OS X related to NSUInteger typedef differences (unsigned int vs unsigned long)

This commit is contained in:
Blake Watters
2012-08-07 09:58:30 -04:00
parent b246559112
commit 1463a7d2f8
7 changed files with 12 additions and 15 deletions

View File

@@ -96,8 +96,8 @@
- (void)load
{
RKLogDebug(@"Loading entity cache for Entity '%@' by attribute '%@' in managed object context %@ (concurrencyType = %d)",
self.entity.name, self.attribute, self.managedObjectContext, self.managedObjectContext.concurrencyType);
RKLogDebug(@"Loading entity cache for Entity '%@' by attribute '%@' in managed object context %@ (concurrencyType = %ld)",
self.entity.name, self.attribute, self.managedObjectContext, (unsigned long) self.managedObjectContext.concurrencyType);
@synchronized(self.attributeValuesToObjectIDs) {
self.attributeValuesToObjectIDs = [NSMutableDictionary dictionary];

View File

@@ -26,7 +26,7 @@
@class RKManagedObjectStore;
/**
RKEntityMapping objects model on object mapping with a Core Data destination entity.
RKEntityMapping objects model an object mapping with a Core Data destination entity.
*/
@interface RKEntityMapping : RKObjectMapping
@@ -126,9 +126,6 @@
'project' relationship:
[mapping connectRelationship:@"project" withMapping:projectMapping fromKeyPath:@"id" toKeyPath:@"userId"];
In effect, this approach allows foreign key relationships between managed objects
to be automatically maintained from the server to the underlying Core Data object graph.
*/
- (void)connectRelationship:(NSString *)relationshipName withMapping:(RKMapping *)objectOrDynamicMapping fromKeyPath:(NSString *)sourceKeyPath toKeyPath:(NSString *)destinationKeyPath;

View File

@@ -182,7 +182,7 @@
[self.managedObjectContext performBlockAndWait:^{
NSError *error;
NSArray *managedObjects = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error];
RKLogInfo(@"Deleting %d managed object instances for the '%@' entity", [managedObjects count], entity.name);
RKLogInfo(@"Deleting %ld managed object instances for the '%@' entity", (unsigned long) [managedObjects count], entity.name);
for (NSManagedObject *managedObject in managedObjects) {
[self.managedObjectContext deleteObject:managedObject];
}

View File

@@ -120,7 +120,7 @@
NSError *error;
BOOL success = [self.privateContext obtainPermanentIDsForObjects:objectsToObtainIDs error:&error];
if (! success) {
RKLogError(@"Failed to obtain permanent object ID's for %d objects: %@", [objectsToObtainIDs count], error);
RKLogError(@"Failed to obtain permanent object ID's for %ld objects: %@", (unsigned long) [objectsToObtainIDs count], error);
}
if ([self.targetObject isKindOfClass:[NSManagedObject class]]) {
@@ -243,13 +243,13 @@
__block NSError *error = nil;
NSArray *insertedObjects = [(RKManagedObjectMappingOperationDataSource *)self.mappingOperationDataSource insertedObjects];
RKLogDebug(@"Obtaining permanent object ID's for %d objects", [insertedObjects count]);
RKLogDebug(@"Obtaining permanent object ID's for %ld objects", (unsigned long) [insertedObjects count]);
[self.privateContext performBlockAndWait:^{
success = [self.privateContext obtainPermanentIDsForObjects:insertedObjects error:&error];
}];
if (! success) {
RKLogError(@"Failed to obtain permanent object ID's for %d managed objects. Error: %@", [insertedObjects count], [error localizedDescription]);
RKLogError(@"Failed to obtain permanent object ID's for %ld managed objects. Error: %@", (unsigned long) [insertedObjects count], [error localizedDescription]);
}
[self.privateContext performBlockAndWait:^{

View File

@@ -323,7 +323,7 @@ RKRequestMethod RKRequestMethodTypeFromName(NSString *methodName) {
[_URLRequest setValue:[_params performSelector:@selector(ContentTypeHTTPHeader)] forHTTPHeaderField:@"Content-Type"];
}
if ([_params respondsToSelector:@selector(HTTPHeaderValueForContentLength)]) {
[_URLRequest setValue:[NSString stringWithFormat:@"%d", [_params HTTPHeaderValueForContentLength]] forHTTPHeaderField:@"Content-Length"];
[_URLRequest setValue:[NSString stringWithFormat:@"%ld", (unsigned long) [_params HTTPHeaderValueForContentLength]] forHTTPHeaderField:@"Content-Length"];
}
} else {
[_URLRequest setValue:@"0" forHTTPHeaderField:@"Content-Length"];

View File

@@ -198,9 +198,9 @@ static const NSTimeInterval kFlushDelay = 0.3;
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@: %p name=%@ suspended=%@ requestCount=%d loadingCount=%d/%d>",
return [NSString stringWithFormat:@"<%@: %p name=%@ suspended=%@ requestCount=%ld loadingCount=%ld/%ld>",
NSStringFromClass([self class]), self, self.name, self.suspended ? @"YES" : @"NO",
self.count, self.loadingCount, self.concurrentRequestsLimit];
(unsigned long) self.count, (unsigned long) self.loadingCount, (unsigned long) self.concurrentRequestsLimit];
}
- (NSUInteger)loadingCount

View File

@@ -43,8 +43,8 @@
- (NSUInteger)hash
{
int prime = 31;
int result = 1;
NSUInteger prime = 31;
NSUInteger result = 1;
result = prime *[self.userData hash] ? [self.mapping hash] : [self.userData hash];
return result;
}