@@ -23,7 +23,7 @@ @implementation NSInvocation(OCMAdditions)
23
23
- (BOOL )hasCharPointerArgument
24
24
{
25
25
NSMethodSignature *signature = [self methodSignature ];
26
- for (int i = 0 ; i < [signature numberOfArguments ]; i++)
26
+ for (NSUInteger i = 0 ; i < [signature numberOfArguments ]; i++)
27
27
{
28
28
const char *argType = OCMTypeWithoutQualifiers ([signature getArgumentTypeAtIndex: i]);
29
29
if (strcmp (argType, " *" ) == 0 )
@@ -33,9 +33,9 @@ - (BOOL)hasCharPointerArgument
33
33
}
34
34
35
35
36
- - (id )getArgumentAtIndexAsObject : (int )argIndex
36
+ - (id )getArgumentAtIndexAsObject : (NSInteger )argIndex
37
37
{
38
- const char *argType = OCMTypeWithoutQualifiers ([[self methodSignature ] getArgumentTypeAtIndex: argIndex]);
38
+ const char *argType = OCMTypeWithoutQualifiers ([[self methodSignature ] getArgumentTypeAtIndex: ( NSUInteger ) argIndex]);
39
39
40
40
if ((strlen (argType) > 1 ) && (strchr (" {^" , argType[0 ]) == NULL ) && (strcmp (" @?" , argType) != 0 ))
41
41
[NSException raise :NSInvalidArgumentException format: @" Cannot handle argument type '%s '." , argType];
@@ -149,7 +149,7 @@ - (id)getArgumentAtIndexAsObject:(int)argIndex
149
149
case ' {' : // structure
150
150
{
151
151
NSUInteger argSize;
152
- NSGetSizeAndAlignment ([[self methodSignature ] getArgumentTypeAtIndex: argIndex], &argSize, NULL );
152
+ NSGetSizeAndAlignment ([[self methodSignature ] getArgumentTypeAtIndex: ( NSUInteger ) argIndex], &argSize, NULL );
153
153
if (argSize == 0 ) // TODO: Can this happen? Is frameLength a good choice in that case?
154
154
argSize = [[self methodSignature ] frameLength ];
155
155
NSMutableData *argumentData = [[[NSMutableData alloc ] initWithLength: argSize] autorelease ];
@@ -172,19 +172,19 @@ - (NSString *)invocationDescription
172
172
173
173
NSArray *selectorParts = [NSStringFromSelector ([self selector ]) componentsSeparatedByString: @" :" ];
174
174
NSMutableString *description = [[NSMutableString alloc ] init ];
175
- unsigned int i;
175
+ NSUInteger i;
176
176
for (i = 2 ; i < numberOfArgs; i++)
177
177
{
178
178
[description appendFormat: @" %@%@ :" , (i > 2 ? @" " : @" " ), [selectorParts objectAtIndex: (i - 2 )]];
179
- [description appendString: [self argumentDescriptionAtIndex: i]];
179
+ [description appendString: [self argumentDescriptionAtIndex: ( NSInteger ) i]];
180
180
}
181
181
182
182
return [description autorelease ];
183
183
}
184
184
185
- - (NSString *)argumentDescriptionAtIndex : (int )argIndex
185
+ - (NSString *)argumentDescriptionAtIndex : (NSInteger )argIndex
186
186
{
187
- const char *argType = OCMTypeWithoutQualifiers ([[self methodSignature ] getArgumentTypeAtIndex: argIndex]);
187
+ const char *argType = OCMTypeWithoutQualifiers ([[self methodSignature ] getArgumentTypeAtIndex: ( NSUInteger ) argIndex]);
188
188
189
189
switch (*argType)
190
190
{
@@ -213,7 +213,7 @@ - (NSString *)argumentDescriptionAtIndex:(int)argIndex
213
213
}
214
214
215
215
216
- - (NSString *)objectDescriptionAtIndex : (int )anInt
216
+ - (NSString *)objectDescriptionAtIndex : (NSInteger )anInt
217
217
{
218
218
id object;
219
219
@@ -227,14 +227,14 @@ - (NSString *)objectDescriptionAtIndex:(int)anInt
227
227
return [object description ] ?: @" <nil description>" ;
228
228
}
229
229
230
- - (NSString *)boolDescriptionAtIndex : (int )anInt
230
+ - (NSString *)boolDescriptionAtIndex : (NSInteger )anInt
231
231
{
232
232
bool value;
233
233
[self getArgument: &value atIndex: anInt];
234
234
return value? @" YES" : @" NO" ;
235
235
}
236
236
237
- - (NSString *)charDescriptionAtIndex : (int )anInt
237
+ - (NSString *)charDescriptionAtIndex : (NSInteger )anInt
238
238
{
239
239
unsigned char buffer[128 ];
240
240
memset (buffer, 0x0 , 128 );
@@ -248,7 +248,7 @@ - (NSString *)charDescriptionAtIndex:(int)anInt
248
248
return [NSString stringWithFormat: @" '%c '" , *buffer];
249
249
}
250
250
251
- - (NSString *)unsignedCharDescriptionAtIndex : (int )anInt
251
+ - (NSString *)unsignedCharDescriptionAtIndex : (NSInteger )anInt
252
252
{
253
253
unsigned char buffer[128 ];
254
254
memset (buffer, 0x0 , 128 );
@@ -257,108 +257,108 @@ - (NSString *)unsignedCharDescriptionAtIndex:(int)anInt
257
257
return [NSString stringWithFormat: @" '%c '" , *buffer];
258
258
}
259
259
260
- - (NSString *)intDescriptionAtIndex : (int )anInt
260
+ - (NSString *)intDescriptionAtIndex : (NSInteger )anInt
261
261
{
262
262
int intValue;
263
263
264
264
[self getArgument: &intValue atIndex: anInt];
265
265
return [NSString stringWithFormat: @" %d " , intValue];
266
266
}
267
267
268
- - (NSString *)unsignedIntDescriptionAtIndex : (int )anInt
268
+ - (NSString *)unsignedIntDescriptionAtIndex : (NSInteger )anInt
269
269
{
270
270
unsigned int intValue;
271
271
272
272
[self getArgument: &intValue atIndex: anInt];
273
273
return [NSString stringWithFormat: @" %d " , intValue];
274
274
}
275
275
276
- - (NSString *)shortDescriptionAtIndex : (int )anInt
276
+ - (NSString *)shortDescriptionAtIndex : (NSInteger )anInt
277
277
{
278
278
short shortValue;
279
279
280
280
[self getArgument: &shortValue atIndex: anInt];
281
281
return [NSString stringWithFormat: @" %hi " , shortValue];
282
282
}
283
283
284
- - (NSString *)unsignedShortDescriptionAtIndex : (int )anInt
284
+ - (NSString *)unsignedShortDescriptionAtIndex : (NSInteger )anInt
285
285
{
286
286
unsigned short shortValue;
287
287
288
288
[self getArgument: &shortValue atIndex: anInt];
289
289
return [NSString stringWithFormat: @" %hu " , shortValue];
290
290
}
291
291
292
- - (NSString *)longDescriptionAtIndex : (int )anInt
292
+ - (NSString *)longDescriptionAtIndex : (NSInteger )anInt
293
293
{
294
294
long longValue;
295
295
296
296
[self getArgument: &longValue atIndex: anInt];
297
297
return [NSString stringWithFormat: @" %ld " , longValue];
298
298
}
299
299
300
- - (NSString *)unsignedLongDescriptionAtIndex : (int )anInt
300
+ - (NSString *)unsignedLongDescriptionAtIndex : (NSInteger )anInt
301
301
{
302
302
unsigned long longValue;
303
303
304
304
[self getArgument: &longValue atIndex: anInt];
305
305
return [NSString stringWithFormat: @" %lu " , longValue];
306
306
}
307
307
308
- - (NSString *)longLongDescriptionAtIndex : (int )anInt
308
+ - (NSString *)longLongDescriptionAtIndex : (NSInteger )anInt
309
309
{
310
310
long long longLongValue;
311
311
312
312
[self getArgument: &longLongValue atIndex: anInt];
313
313
return [NSString stringWithFormat: @" %qi " , longLongValue];
314
314
}
315
315
316
- - (NSString *)unsignedLongLongDescriptionAtIndex : (int )anInt
316
+ - (NSString *)unsignedLongLongDescriptionAtIndex : (NSInteger )anInt
317
317
{
318
318
unsigned long long longLongValue;
319
319
320
320
[self getArgument: &longLongValue atIndex: anInt];
321
321
return [NSString stringWithFormat: @" %qu " , longLongValue];
322
322
}
323
323
324
- - (NSString *)doubleDescriptionAtIndex : (int )anInt
324
+ - (NSString *)doubleDescriptionAtIndex : (NSInteger )anInt
325
325
{
326
326
double doubleValue;
327
327
328
328
[self getArgument: &doubleValue atIndex: anInt];
329
329
return [NSString stringWithFormat: @" %f " , doubleValue];
330
330
}
331
331
332
- - (NSString *)floatDescriptionAtIndex : (int )anInt
332
+ - (NSString *)floatDescriptionAtIndex : (NSInteger )anInt
333
333
{
334
334
float floatValue;
335
335
336
336
[self getArgument: &floatValue atIndex: anInt];
337
337
return [NSString stringWithFormat: @" %f " , floatValue];
338
338
}
339
339
340
- - (NSString *)longDoubleDescriptionAtIndex : (int )anInt
340
+ - (NSString *)longDoubleDescriptionAtIndex : (NSInteger )anInt
341
341
{
342
342
long double longDoubleValue;
343
343
344
344
[self getArgument: &longDoubleValue atIndex: anInt];
345
345
return [NSString stringWithFormat: @" %Lf " , longDoubleValue];
346
346
}
347
347
348
- - (NSString *)structDescriptionAtIndex : (int )anInt
348
+ - (NSString *)structDescriptionAtIndex : (NSInteger )anInt
349
349
{
350
350
return [NSString stringWithFormat: @" (%@ )" , [[self getArgumentAtIndexAsObject: anInt] description ]];
351
351
}
352
352
353
- - (NSString *)pointerDescriptionAtIndex : (int )anInt
353
+ - (NSString *)pointerDescriptionAtIndex : (NSInteger )anInt
354
354
{
355
355
void *buffer;
356
356
357
357
[self getArgument: &buffer atIndex: anInt];
358
358
return [NSString stringWithFormat: @" %p " , buffer];
359
359
}
360
360
361
- - (NSString *)cStringDescriptionAtIndex : (int )anInt
361
+ - (NSString *)cStringDescriptionAtIndex : (NSInteger )anInt
362
362
{
363
363
char buffer[104 ];
364
364
char *cStringPtr;
@@ -369,7 +369,7 @@ - (NSString *)cStringDescriptionAtIndex:(int)anInt
369
369
return [NSString stringWithFormat: @" \" %s \" " , buffer];
370
370
}
371
371
372
- - (NSString *)selectorDescriptionAtIndex : (int )anInt
372
+ - (NSString *)selectorDescriptionAtIndex : (NSInteger )anInt
373
373
{
374
374
SEL selectorValue;
375
375
0 commit comments