From c5458f35b7dbdcbbd50a32dfbcacad0daa43160f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Min=C3=A1=C5=99?= Date: Fri, 19 Aug 2011 12:32:39 +0200 Subject: [PATCH] Fixes: Compilation fails with error: "implicit conversion changes signedness: 'const int' to 'NSUInteger' (aka 'unsigned int') [-Wconversion]" --- Classes/CrashController.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Classes/CrashController.m b/Classes/CrashController.m index 5baff43..5c3ca07 100644 --- a/Classes/CrashController.m +++ b/Classes/CrashController.m @@ -155,9 +155,10 @@ - (NSArray*)callstackAsArray { void* callstack[128]; const int numFrames = backtrace(callstack, 128); + assert(numFrames >= 0); char **symbols = backtrace_symbols(callstack, numFrames); - NSMutableArray *arr = [NSMutableArray arrayWithCapacity:numFrames]; + NSMutableArray *arr = [NSMutableArray arrayWithCapacity:(numFrames >= 0 ? (NSUInteger)numFrames : 0)]; for (int i = 0; i < numFrames; ++i) { [arr addObject:[NSString stringWithUTF8String:symbols[i]]];