From 022fd814741044db4b360d08f4fdf4a1dfc7c8ec Mon Sep 17 00:00:00 2001 From: Patrice Levesque Date: Wed, 17 Feb 2016 11:06:12 -0500 Subject: [PATCH] Fix warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] Those are all log formatting routines that assume pointers are unsigned int, for display purpose. Replace the cast with the native '%p' token from NSString::stringWithFormat that's provided for pointer address output. --- SoObjects/SOGo/SOGoObject.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 084244286..8a5b172f6 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -1046,8 +1046,8 @@ if (nameInContainer) [_ms appendFormat:@" name=%@", nameInContainer]; if (container) - [_ms appendFormat:@" container=0x%08X/%@", - (unsigned int)container, [container valueForKey:@"nameInContainer"]]; + [_ms appendFormat:@" container=%p/%@", + container, [container valueForKey:@"nameInContainer"]]; } - (NSString *) description @@ -1055,7 +1055,7 @@ NSMutableString *ms; ms = [NSMutableString stringWithCapacity:64]; - [ms appendFormat:@"<0x%08X[%@]:", (unsigned int) self, NSStringFromClass([self class])]; + [ms appendFormat:@"<%p[%@]:", self, NSStringFromClass([self class])]; [self appendAttributesToDescription:ms]; [ms appendString:@">"]; @@ -1064,8 +1064,8 @@ - (NSString *) loggingPrefix { - return [NSString stringWithFormat:@"<0x%08X[%@]:%@>", - (unsigned int) self, NSStringFromClass([self class]), + return [NSString stringWithFormat:@"<%p[%@]:%@>", + self, NSStringFromClass([self class]), [self nameInContainer]]; }