diff --git a/src/Command.mm b/src/Command.mm index f67b30d..ef70523 100644 --- a/src/Command.mm +++ b/src/Command.mm @@ -38,34 +38,34 @@ padArguments(OFArray *arguments, size_t count) if (isDown) { arguments = padArguments(arguments, 2); ((void(__cdecl *)(int))_function)( - (int)[arguments[1] longLongValueWithBase:0]); + [arguments[1] intValueWithBase:0]); } break; case ARG_2INT: if (isDown) { arguments = padArguments(arguments, 3); ((void(__cdecl *)(int, int))_function)( - (int)[arguments[1] longLongValueWithBase:0], - (int)[arguments[2] longLongValueWithBase:0]); + [arguments[1] intValueWithBase:0], + [arguments[2] intValueWithBase:0]); } break; case ARG_3INT: if (isDown) { arguments = padArguments(arguments, 4); ((void(__cdecl *)(int, int, int))_function)( - (int)[arguments[1] longLongValueWithBase:0], - (int)[arguments[2] longLongValueWithBase:0], - (int)[arguments[3] longLongValueWithBase:0]); + [arguments[1] intValueWithBase:0], + [arguments[2] intValueWithBase:0], + [arguments[3] intValueWithBase:0]); } break; case ARG_4INT: if (isDown) { arguments = padArguments(arguments, 5); ((void(__cdecl *)(int, int, int, int))_function)( - (int)[arguments[1] longLongValueWithBase:0], - (int)[arguments[2] longLongValueWithBase:0], - (int)[arguments[3] longLongValueWithBase:0], - (int)[arguments[4] longLongValueWithBase:0]); + [arguments[1] intValueWithBase:0], + [arguments[2] intValueWithBase:0], + [arguments[3] intValueWithBase:0], + [arguments[4] intValueWithBase:0]); } break; case ARG_NONE: diff --git a/src/Cube.mm b/src/Cube.mm index 7ee8602..9a98be0 100644 --- a/src/Cube.mm +++ b/src/Cube.mm @@ -49,16 +49,16 @@ VARP(minmillis, 0, 5, 1000); while ((option = [optionsParser nextOption]) != '\0') { switch (option) { case 'w': - _width = (int)optionsParser.argument.longLongValue; + _width = optionsParser.argument.intValue; break; case 'h': - _height = (int)optionsParser.argument.longLongValue; + _height = optionsParser.argument.intValue; break; case 'u': - uprate = (int)optionsParser.argument.longLongValue; + uprate = optionsParser.argument.intValue; break; case 'c': - maxcl = (int)optionsParser.argument.longLongValue; + maxcl = optionsParser.argument.intValue; break; case ':': case '=': diff --git a/src/MenuItem.m b/src/MenuItem.m index b9bcba0..ec531c4 100644 --- a/src/MenuItem.m +++ b/src/MenuItem.m @@ -20,12 +20,13 @@ int x, y; @try { - x = (int)_text.longLongValue; + x = _text.intValue; } @catch (OFInvalidFormatException *e) { x = 0; } + @try { - y = (int)otherItem.text.longLongValue; + y = otherItem.text.intValue; } @catch (OFInvalidFormatException *e) { y = 0; } diff --git a/src/clientgame.mm b/src/clientgame.mm index e3f24d8..208b44b 100644 --- a/src/clientgame.mm +++ b/src/clientgame.mm @@ -238,7 +238,7 @@ static OFString *sleepcmd = nil; void sleepf(OFString *msec, OFString *cmd) { - sleepwait = (int)msec.longLongValue + lastmillis; + sleepwait = msec.intValue + lastmillis; sleepcmd = cmd; } COMMANDN(sleep, sleepf, ARG_2STR) diff --git a/src/commands.mm b/src/commands.mm index 158e5e1..c9eb6cd 100644 --- a/src/commands.mm +++ b/src/commands.mm @@ -233,7 +233,7 @@ execute(OFString *string, bool isDown) __kindof Identifier *identifier = identifiers[c]; if (identifier == nil) { @try { - val = (int)[c longLongValueWithBase:0]; + val = [c intValueWithBase:0]; } @catch (OFInvalidFormatException *e) { conoutf(@"unknown command: %@", c); } @@ -258,8 +258,8 @@ execute(OFString *string, bool isDown) else [identifier setValue: - (int)[w[1] - longLongValueWithBase: + [w[1] + intValueWithBase: 0]]; } } else if ([identifier @@ -439,7 +439,7 @@ void loopa(OFString *times, OFString *body) { @autoreleasepool { - int t = (int)times.longLongValue; + int t = times.intValue; loopi(t) { @@ -497,7 +497,7 @@ void at(OFString *s_, OFString *pos) { @autoreleasepool { - int n = (int)pos.longLongValue; + int n = pos.intValue; std::unique_ptr copy(strdup(s_.UTF8String)); char *s = copy.get(); diff --git a/src/console.mm b/src/console.mm index bbe66c7..77ed3d7 100644 --- a/src/console.mm +++ b/src/console.mm @@ -106,8 +106,8 @@ keymap(OFString *code, OFString *key, OFString *action) if (keyMappings == nil) keyMappings = [[OFMutableArray alloc] init]; - KeyMapping *mapping = - [[KeyMapping alloc] initWithCode:(int)code.longLongValue name:key]; + KeyMapping *mapping = [[KeyMapping alloc] initWithCode:code.intValue + name:key]; mapping.action = action; [keyMappings addObject:mapping]; } diff --git a/src/editing.mm b/src/editing.mm index 9c20074..bc098ff 100644 --- a/src/editing.mm +++ b/src/editing.mm @@ -605,10 +605,8 @@ newent(OFString *what, OFString *a1, OFString *a2, OFString *a3, OFString *a4) EDITSEL; @autoreleasepool { newentity(sel.x, sel.y, (int)player1.o.z, what, - (int)[a1 longLongValueWithBase:0], - (int)[a2 longLongValueWithBase:0], - (int)[a3 longLongValueWithBase:0], - (int)[a4 longLongValueWithBase:0]); + [a1 intValueWithBase:0], [a2 intValueWithBase:0], + [a3 intValueWithBase:0], [a4 intValueWithBase:0]); } } diff --git a/src/rendergl.mm b/src/rendergl.mm index f6a3af5..672caf5 100644 --- a/src/rendergl.mm +++ b/src/rendergl.mm @@ -197,7 +197,7 @@ void texture(OFString *aframe, OFString *name) { @autoreleasepool { - int num = curtexnum++, frame = (int)aframe.longLongValue; + int num = curtexnum++, frame = aframe.intValue; if (num < 0 || num >= 256 || frame < 0 || frame >= MAXFRAMES) return; mapping[num][frame] = 1; diff --git a/src/rendermd2.mm b/src/rendermd2.mm index 5429c20..6902248 100644 --- a/src/rendermd2.mm +++ b/src/rendermd2.mm @@ -68,10 +68,10 @@ mapmodel( OFString *rad, OFString *h, OFString *zoff, OFString *snap, OFString *name) { MD2 *m = loadmodel(name); - m.mmi = [[MapModelInfo alloc] initWithRad:(int)rad.longLongValue - h:(int)h.longLongValue - zoff:(int)zoff.longLongValue - snap:(int)snap.longLongValue + m.mmi = [[MapModelInfo alloc] initWithRad:rad.intValue + h:h.intValue + zoff:zoff.intValue + snap:snap.intValue name:m.loadname]; if (mapmodels == nil) diff --git a/src/weapon.mm b/src/weapon.mm index c48e1db..0355e04 100644 --- a/src/weapon.mm +++ b/src/weapon.mm @@ -63,9 +63,9 @@ reloadtime(int gun) void weapon(OFString *a1, OFString *a2, OFString *a3) { - selectgun((a1.length > 0 ? (int)a1.longLongValue : -1), - (a2.length > 0 ? (int)a2.longLongValue : -1), - (a3.length > 0 ? (int)a3.longLongValue : -1)); + selectgun((a1.length > 0 ? a1.intValue : -1), + (a2.length > 0 ? a2.intValue : -1), + (a3.length > 0 ? a3.intValue : -1)); } COMMAND(weapon, ARG_3STR)