Fix compiler warning for cast from int to id.

qcocoaapplication.mm:118:61: warning: cast to 'id' from smaller integer type 'int' [-Wint-to-pointer-cast]
    id a1 = ([args->arg1 isKindOfClass:[NSNumber class]]) ? (id)[args->arg1 intValue] : args->arg1;
                                                            ^
qcocoaapplication.mm:119:61: warning: cast to 'id' from smaller integer type 'int' [-Wint-to-pointer-cast]
    id a2 = ([args->arg2 isKindOfClass:[NSNumber class]]) ? (id)[args->arg2 intValue] : args->arg2;

Change-Id: Ibcf3d5d5698ff863f3c9bd65e0388ccca147f419
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
bb10
Erik Verbruggen 2013-11-11 10:35:33 +01:00 committed by The Qt Project
parent 2c450d90b6
commit 81f2d6eaac
1 changed files with 2 additions and 2 deletions

View File

@ -115,8 +115,8 @@ QT_USE_NAMESPACE
QCocoaPostMessageArgs *args = reinterpret_cast<QCocoaPostMessageArgs *>(lower | (upper << 32));
// Special case for convenience: if the argument is an NSNumber, we unbox it directly.
// Use NSValue instead if this behaviour is unwanted.
id a1 = ([args->arg1 isKindOfClass:[NSNumber class]]) ? (id)[args->arg1 intValue] : args->arg1;
id a2 = ([args->arg2 isKindOfClass:[NSNumber class]]) ? (id)[args->arg2 intValue] : args->arg2;
id a1 = ([args->arg1 isKindOfClass:[NSNumber class]]) ? (id)[args->arg1 longValue] : args->arg1;
id a2 = ([args->arg2 isKindOfClass:[NSNumber class]]) ? (id)[args->arg2 longValue] : args->arg2;
switch (args->argCount) {
case 0:
[args->target performSelector:args->selector];