Correct the spelling of "int" and clean up the mess.

This commit is contained in:
Bill Currie 2011-03-25 16:46:32 +09:00
parent 1617f0765e
commit 896791b209
114 changed files with 601 additions and 601 deletions

View File

@ -5,7 +5,7 @@
@interface CrosshairCvar : CvarObject @interface CrosshairCvar : CvarObject
-(void) next; -(void) next;
-(integer) crosshair; -(int) crosshair;
@end @end
#endif//__CrosshairCvar_h #endif//__CrosshairCvar_h

View File

@ -5,11 +5,11 @@
@implementation CrosshairCvar @implementation CrosshairCvar
-(void) next -(void) next
{ {
local integer val = Cvar_GetInteger (name); local int val = Cvar_GetInteger (name);
Cvar_SetInteger (name, (val + 1) % 4); Cvar_SetInteger (name, (val + 1) % 4);
} }
-(integer) crosshair -(int) crosshair
{ {
return Cvar_GetInteger (name); return Cvar_GetInteger (name);
} }

View File

@ -28,7 +28,7 @@
Draw_Crosshair ([crosshair crosshair], xabs + xlen / 2, yabs + ylen / 2); Draw_Crosshair ([crosshair crosshair], xabs + xlen / 2, yabs + ylen / 2);
} }
- (integer) keyEvent:(integer)key unicode:(integer)unicode down:(integer)down - (int) keyEvent:(int)key unicode:(int)unicode down:(int)down
{ {
switch (key) { switch (key) {
case QFK_RETURN: case QFK_RETURN:

View File

@ -6,7 +6,7 @@
@interface CvarColor : CvarObject @interface CvarColor : CvarObject
-(void)next; -(void)next;
-(void)prev; -(void)prev;
-(integer)value; -(int)value;
@end @end
#endif//__CvarColor_h #endif//__CvarColor_h

View File

@ -18,7 +18,7 @@
Cvar_SetFloat (name, val); Cvar_SetFloat (name, val);
} }
-(integer)value -(int)value
{ {
return Cvar_GetInteger (name); return Cvar_GetInteger (name);
} }

View File

@ -27,7 +27,7 @@
-(void)draw -(void)draw
{ {
local integer xl; local int xl;
xl = xlen / 8 - 2; xl = xlen / 8 - 2;
text_box (xabs, yabs, xl, ylen / 8 - 2); text_box (xabs, yabs, xl, ylen / 8 - 2);
xl = (xl + 1) & ~1; // text_box does only multiples of 2 xl = (xl + 1) & ~1; // text_box does only multiples of 2
@ -35,7 +35,7 @@
[color value] * 16 + 8); [color value] * 16 + 8);
} }
- (integer) keyEvent:(integer)key unicode:(integer)unicode down:(integer)down - (int) keyEvent:(int)key unicode:(int)unicode down:(int)down
{ {
switch (key) { switch (key) {
case QFK_DOWN: case QFK_DOWN:

View File

@ -11,7 +11,7 @@
-(void)inc; -(void)inc;
-(void)dec; -(void)dec;
-(float)value; -(float)value;
-(integer)percentage; -(int)percentage;
@end @end
#endif//__CvarRange_h #endif//__CvarRange_h

View File

@ -35,7 +35,7 @@
return Cvar_GetFloat (name); return Cvar_GetFloat (name);
} }
-(integer)percentage -(int)percentage
{ {
return to_percentage(min, max, Cvar_GetFloat (name)); return to_percentage(min, max, Cvar_GetFloat (name));
} }

View File

@ -15,7 +15,7 @@
CvarRange *range; CvarRange *range;
} }
-(void)update; -(void)update;
-(id)initWithBounds:(Rect)aRect title:(string)_title sliderWidth:(integer)width :(CvarRange *)_range; -(id)initWithBounds:(Rect)aRect title:(string)_title sliderWidth:(int)width :(CvarRange *)_range;
-(void)inc; -(void)inc;
-(void)dec; -(void)dec;
@end @end

View File

@ -15,7 +15,7 @@
[value setText:ftos ([range value])]; [value setText:ftos ([range value])];
} }
-(id)initWithBounds:(Rect)aRect title:(string)_title sliderWidth:(integer)width :(CvarRange *)_range -(id)initWithBounds:(Rect)aRect title:(string)_title sliderWidth:(int)width :(CvarRange *)_range
{ {
local Rect rect; local Rect rect;
@ -59,7 +59,7 @@
S_LocalSound ("misc/menu3.wav"); S_LocalSound ("misc/menu3.wav");
} }
- (integer) keyEvent:(integer)key unicode:(integer)unicode down:(integer)down - (int) keyEvent:(int)key unicode:(int)unicode down:(int)down
{ {
switch (key) { switch (key) {
case QFK_RIGHT: case QFK_RIGHT:

View File

@ -43,7 +43,7 @@
S_LocalSound ("misc/menu3.wav"); S_LocalSound ("misc/menu3.wav");
} }
- (integer) keyEvent:(integer)key unicode:(integer)unicode down:(integer)down - (int) keyEvent:(int)key unicode:(int)unicode down:(int)down
{ {
switch (key) { switch (key) {
case QFK_RETURN: case QFK_RETURN:

View File

@ -10,5 +10,5 @@
- (void) dealloc; - (void) dealloc;
- (Size) size; - (Size) size;
- (float) duration; - (float) duration;
- (void) draw: (integer) x :(integer) y; - (void) draw: (int) x :(int) y;
@end @end

View File

@ -27,7 +27,7 @@
return duration; return duration;
} }
- (void) draw: (integer) x :(integer) y - (void) draw: (int) x :(int) y
{ {
[picture draw :x :y]; [picture draw :x :y];
} }

View File

@ -8,12 +8,12 @@
{ {
Point origin; Point origin;
BOOL visible; BOOL visible;
integer handle; int handle;
} }
- (id) initWithComponents: (integer) x : (integer) y; - (id) initWithComponents: (int) x : (int) y;
- (void) dealloc; - (void) dealloc;
- (integer) handle; - (int) handle;
- (Point) origin; - (Point) origin;
- (Size) size; - (Size) size;
- (void) setOrigin: (Point) newPoint; - (void) setOrigin: (Point) newPoint;
@ -28,7 +28,7 @@
string text; string text;
} }
- (id) initWithComponents: (integer) x :(integer) y :(string) _text; - (id) initWithComponents: (int) x :(int) y :(string) _text;
- (Size) size; - (Size) size;
- (string) text; - (string) text;
- (void) setText: (string) _text; - (void) setText: (string) _text;
@ -40,7 +40,7 @@
QPic *picture; QPic *picture;
} }
- (id) initWithComponents: (integer)x :(integer)y :(string) _file; - (id) initWithComponents: (int)x :(int)y :(string) _file;
- (void) dealloc; - (void) dealloc;
- (Size) size; - (Size) size;
- (void) setFile: (string) _file; - (void) setFile: (string) _file;
@ -48,16 +48,16 @@
@end @end
@extern void () HUD_Init; @extern void () HUD_Init;
@extern integer HUDHandleClass; @extern int HUDHandleClass;
@interface HUDAnimation : HUDObject @interface HUDAnimation : HUDObject
{ {
Array *frames; Array *frames;
integer currentFrame; int currentFrame;
float nextFrameTime; float nextFrameTime;
BOOL looping; BOOL looping;
} }
- (id) initWithComponents: (integer) x :(integer) y; - (id) initWithComponents: (int) x :(int) y;
- (void) dealloc; - (void) dealloc;
- (Size) size; - (Size) size;
- (void) addFrame: (Frame *) frame; - (void) addFrame: (Frame *) frame;

View File

@ -5,10 +5,10 @@
#include "system.h" #include "system.h"
#include "HUD.h" #include "HUD.h"
integer HUDHandleClass; int HUDHandleClass;
@implementation HUDObject @implementation HUDObject
- (id) initWithComponents: (integer) x : (integer) y - (id) initWithComponents: (int) x : (int) y
{ {
self = [super init]; self = [super init];
origin = makePoint (x, y); origin = makePoint (x, y);
@ -22,7 +22,7 @@ integer HUDHandleClass;
[super dealloc]; [super dealloc];
} }
- (integer) handle - (int) handle
{ {
return handle; return handle;
} }
@ -63,7 +63,7 @@ integer HUDHandleClass;
@end @end
@implementation HUDText : HUDObject @implementation HUDText : HUDObject
- (id) initWithComponents: (integer) x :(integer) y :(string) _text - (id) initWithComponents: (int) x :(int) y :(string) _text
{ {
self = [super initWithComponents :x :y]; self = [super initWithComponents :x :y];
[self setText :_text]; [self setText :_text];
@ -73,7 +73,7 @@ integer HUDHandleClass;
- (Size) size - (Size) size
{ {
return makeSize (8*(integer) strlen (text), 8); return makeSize (8*(int) strlen (text), 8);
} }
- (string) text - (string) text
@ -94,7 +94,7 @@ integer HUDHandleClass;
@end @end
@implementation HUDGraphic : HUDObject @implementation HUDGraphic : HUDObject
- (id) initWithComponents: (integer)x :(integer)y :(string) _file - (id) initWithComponents: (int)x :(int)y :(string) _file
{ {
self = [super initWithComponents :x :y]; self = [super initWithComponents :x :y];
[self setFile :_file]; [self setFile :_file];
@ -128,7 +128,7 @@ integer HUDHandleClass;
@implementation HUDAnimation : HUDObject @implementation HUDAnimation : HUDObject
- (id) initWithComponents: (integer) x :(integer) y - (id) initWithComponents: (int) x :(int) y
{ {
self = [super initWithComponents :x :y]; self = [super initWithComponents :x :y];
frames = [[Array alloc] init]; frames = [[Array alloc] init];

View File

@ -5,10 +5,10 @@
@interface MenuGroup : Group @interface MenuGroup : Group
{ {
integer base; int base;
integer current; int current;
} }
-(void)setBase:(integer)b; -(void)setBase:(int)b;
-(void) next; -(void) next;
-(void) prev; -(void) prev;
@end @end

View File

@ -14,7 +14,7 @@
return self; return self;
} }
-(void)setBase:(integer)b -(void)setBase:(int)b
{ {
if (b >= [views count]) if (b >= [views count])
b = [views count] - 1; b = [views count] - 1;
@ -23,7 +23,7 @@
current = base = b; current = base = b;
} }
- (integer) keyEvent:(integer)key unicode:(integer)unicode down:(integer)down - (int) keyEvent:(int)key unicode:(int)unicode down:(int)down
{ {
switch (key) { switch (key) {
case QFK_DOWN: case QFK_DOWN:

View File

@ -13,7 +13,7 @@
return self; return self;
} }
- (integer) keyEvent:(integer)key unicode:(integer)unicode down:(integer)down - (int) keyEvent:(int)key unicode:(int)unicode down:(int)down
{ {
return [view keyEvent:key unicode:unicode down:down]; return [view keyEvent:key unicode:unicode down:down];
} }

View File

@ -42,7 +42,7 @@ menu_leave_sound =
S_LocalSound ("misc/menu2.wav"); S_LocalSound ("misc/menu2.wav");
} }
integer (integer key, integer unicode, integer down) int (int key, int unicode, int down)
menu_key_sound = menu_key_sound =
{ {
switch (key) { switch (key) {
@ -58,15 +58,15 @@ menu_key_sound =
return 0; return 0;
} }
void (integer x, integer y) spinner = void (int x, int y) spinner =
{ {
local integer i = (integer) (time * 10) % 6; local int i = (int) (time * 10) % 6;
local qpic_t p = Draw_CachePic (dot_name[i], 1); local qpic_t p = Draw_CachePic (dot_name[i], 1);
Draw_Pic (x, y, p); Draw_Pic (x, y, p);
}; };
integer do_single_player; int do_single_player;
string quitMessage[32] = { string quitMessage[32] = {
/* .........1.........2.... */ /* .........1.........2.... */
@ -110,15 +110,15 @@ string quitMessage[32] = {
" for you next time! ", " for you next time! ",
" " " "
}; };
integer quit_index; int quit_index;
// ********* LOAD / SAVE // ********* LOAD / SAVE
#define MAX_SAVEGAMES 12 #define MAX_SAVEGAMES 12
string filenames[MAX_SAVEGAMES]; string filenames[MAX_SAVEGAMES];
integer loadable[MAX_SAVEGAMES]; int loadable[MAX_SAVEGAMES];
integer load_cursor; int load_cursor;
integer save_cursor; int save_cursor;
string (QFile f) get_comment = string (QFile f) get_comment =
{ {
@ -132,7 +132,7 @@ string (QFile f) get_comment =
void () scan_saves = void () scan_saves =
{ {
local integer i; local int i;
local QFile f; local QFile f;
local string line; local string line;
for (i = 0; i < MAX_SAVEGAMES; i++) { for (i = 0; i < MAX_SAVEGAMES; i++) {
@ -155,14 +155,14 @@ void () scan_saves =
} }
}; };
integer (string text, integer key) load_f = int (string text, int key) load_f =
{ {
scan_saves (); scan_saves ();
Menu_SelectMenu ("load"); Menu_SelectMenu ("load");
return 0; return 0;
}; };
integer (string text, integer key) save_f = int (string text, int key) save_f =
{ {
scan_saves (); scan_saves ();
Menu_SelectMenu ("save"); Menu_SelectMenu ("save");
@ -178,31 +178,31 @@ void () load_save_f =
Menu_SelectMenu ("save"); Menu_SelectMenu ("save");
}; };
integer (integer x, integer y) load_draw = int (int x, int y) load_draw =
{ {
local integer i; local int i;
Draw_CenterPic (x + 160, y + 4, Draw_CachePic ("gfx/p_load.lmp", 1)); Draw_CenterPic (x + 160, y + 4, Draw_CachePic ("gfx/p_load.lmp", 1));
for (i=0 ; i< MAX_SAVEGAMES; i++) for (i=0 ; i< MAX_SAVEGAMES; i++)
Draw_String (x + 16, y + 32 + 8 * i, filenames[i]); Draw_String (x + 16, y + 32 + 8 * i, filenames[i]);
Draw_Character (x + 8, y + 32 + load_cursor * 8, Draw_Character (x + 8, y + 32 + load_cursor * 8,
12 + ((integer) (time * 4) & 1)); 12 + ((int) (time * 4) & 1));
return 1; return 1;
}; };
integer (integer x, integer y) save_draw = int (int x, int y) save_draw =
{ {
local integer i; local int i;
Draw_CenterPic (x + 160, y + 4, Draw_CachePic ("gfx/p_save.lmp", 1)); Draw_CenterPic (x + 160, y + 4, Draw_CachePic ("gfx/p_save.lmp", 1));
for (i=0 ; i< MAX_SAVEGAMES; i++) for (i=0 ; i< MAX_SAVEGAMES; i++)
Draw_String (x + 16, y + 32 + 8 * i, filenames[i]); Draw_String (x + 16, y + 32 + 8 * i, filenames[i]);
Draw_Character (x + 8, y + 32 + save_cursor * 8, Draw_Character (x + 8, y + 32 + save_cursor * 8,
12 + ((integer) (time * 4) & 1)); 12 + ((int) (time * 4) & 1));
return 1; return 1;
}; };
integer (integer key, integer unicode, integer down) load_keyevent = int (int key, int unicode, int down) load_keyevent =
{ {
switch (key) { switch (key) {
case QFK_DOWN: case QFK_DOWN:
@ -229,7 +229,7 @@ integer (integer key, integer unicode, integer down) load_keyevent =
return 0; return 0;
}; };
integer (integer key, integer unicode, integer down) save_keyevent = int (int key, int unicode, int down) save_keyevent =
{ {
switch (key) { switch (key) {
case QFK_DOWN: case QFK_DOWN:
@ -279,21 +279,21 @@ void () save_menu =
// ********* QUIT // ********* QUIT
integer () quit = int () quit =
{ {
Menu_SelectMenu ("quit"); Menu_SelectMenu ("quit");
quit_index = (integer) (random () * 8); quit_index = (int) (random () * 8);
quit_index &= 7; quit_index &= 7;
return 0; return 0;
}; };
integer (string text, integer key) quit_f = int (string text, int key) quit_f =
{ {
quit (); quit ();
return 0; return 0;
}; };
integer (integer key, integer unicode, integer down) quit_keyevent = int (int key, int unicode, int down) quit_keyevent =
{ {
if (key == 'y') { if (key == 'y') {
Menu_Quit (); Menu_Quit ();
@ -306,7 +306,7 @@ integer (integer key, integer unicode, integer down) quit_keyevent =
return 0; return 0;
}; };
integer (integer x, integer y) quit_draw = int (int x, int y) quit_draw =
{ {
text_box (x + 56, y + 76, 24, 4); text_box (x + 56, y + 76, 24, 4);
Draw_String (x + 64, y + 84, quitMessage[quit_index * 4 + 0]); Draw_String (x + 64, y + 84, quitMessage[quit_index * 4 + 0]);
@ -327,7 +327,7 @@ void () quit_menu =
Menu_End (); Menu_End ();
}; };
integer (string text, integer key) sp_start = int (string text, int key) sp_start =
{ {
Menu_SelectMenu (nil); Menu_SelectMenu (nil);
Cbuf_AddText ("disconnect\n"); Cbuf_AddText ("disconnect\n");
@ -361,20 +361,20 @@ void () single_player_menu =
// ********* MULTIPLAYER // ********* MULTIPLAYER
integer JoiningGame; int JoiningGame;
integer lanConfig_cursor; int lanConfig_cursor;
string my_tcpip_address; string my_tcpip_address;
string lanConfig_portname; string lanConfig_portname;
string lanConfig_joinname; string lanConfig_joinname;
#define NUM_LANCONFIG_CMDS 3 #define NUM_LANCONFIG_CMDS 3
integer lanConfig_cursor_table[NUM_LANCONFIG_CMDS] = { 72, 92, 124 }; int lanConfig_cursor_table[NUM_LANCONFIG_CMDS] = { 72, 92, 124 };
InputLine *lanConfig_port_il; InputLine *lanConfig_port_il;
InputLine *lanConfig_join_il; InputLine *lanConfig_join_il;
InputLine *input_active; InputLine *input_active;
integer (integer x, integer y) join_draw = int (int x, int y) join_draw =
{ {
local integer f = x + (320 - 26 * 8) / 2; local int f = x + (320 - 26 * 8) / 2;
text_box (f, y + 134, 24, 4); text_box (f, y + 134, 24, 4);
Draw_String (f, y + 142, " Commonly used to play "); Draw_String (f, y + 142, " Commonly used to play ");
Draw_String (f, y + 150, " over the Internet, but "); Draw_String (f, y + 150, " over the Internet, but ");
@ -383,9 +383,9 @@ integer (integer x, integer y) join_draw =
return 0; return 0;
}; };
integer (integer x, integer y) lanconfig_draw = int (int x, int y) lanconfig_draw =
{ {
local integer basex = 54 + x; local int basex = 54 + x;
local string startJoin = JoiningGame ? "Join Game" : "New Game"; local string startJoin = JoiningGame ? "Join Game" : "New Game";
local string protocol = "UDP"; local string protocol = "UDP";
@ -415,12 +415,12 @@ integer (integer x, integer y) lanconfig_draw =
} }
if (!input_active) if (!input_active)
Draw_Character (basex - 8, y + lanConfig_cursor_table[lanConfig_cursor], Draw_Character (basex - 8, y + lanConfig_cursor_table[lanConfig_cursor],
12 + ((integer) (time * 4) & 1)); 12 + ((int) (time * 4) & 1));
return 0; return 0;
}; };
integer (integer key, integer unicode, integer down) lanconfig_keyevent = int (int key, int unicode, int down) lanconfig_keyevent =
{ {
if (input_active) if (input_active)
[input_active processInput:(key >= 256 ? key : unicode)]; [input_active processInput:(key >= 256 ? key : unicode)];
@ -490,7 +490,7 @@ void () join_menu =
Menu_End (); Menu_End ();
}; };
integer (integer key, integer unicode, integer down) multi_player_keyevent = int (int key, int unicode, int down) multi_player_keyevent =
{ {
if (key == QFK_RETURN) { if (key == QFK_RETURN) {
JoiningGame = (Menu_GetIndex () == 0); JoiningGame = (Menu_GetIndex () == 0);

View File

@ -34,8 +34,8 @@
#include "key.h" #include "key.h"
#include "options_util.h" #include "options_util.h"
integer set_key_flag; // holds flag for the key-setting int set_key_flag; // holds flag for the key-setting
// three global hashes for the main binding groups // three global hashes for the main binding groups
Array *movement_bindings; Array *movement_bindings;
Array *misc_bindings; Array *misc_bindings;
@ -121,10 +121,10 @@ new_binding (binding_t binding)
this function initializes the hashes for the binding menus this function initializes the hashes for the binding menus
*/ */
void () void ()
init_binding_hash = init_binding_hash =
{ {
local integer i; local int i;
movement_bindings = [[Array alloc] init]; movement_bindings = [[Array alloc] init];
for (i = 0; i < @sizeof (movement_binding_list) / @sizeof (movement_binding_list[0]); i++) for (i = 0; i < @sizeof (movement_binding_list) / @sizeof (movement_binding_list[0]); i++)
@ -146,10 +146,10 @@ init_binding_hash =
As a command/binding can be bound to many keys, you can get the second, As a command/binding can be bound to many keys, you can get the second,
third, etc. key by giving the bindnum. third, etc. key by giving the bindnum.
*/ */
string (string binding, integer bindnum) string (string binding, int bindnum)
get_keyname = get_keyname =
{ {
local integer keynum; local int keynum;
local string keyname; local string keyname;
keynum = Key_LookupBinding(IMT_0, bindnum, binding); keynum = Key_LookupBinding(IMT_0, bindnum, binding);
@ -171,7 +171,7 @@ get_keyname =
void void
get_hash_keys (Array *list) get_hash_keys (Array *list)
{ {
local integer i,hlen; local int i,hlen;
local Binding *binding; local Binding *binding;
local string desc1 = "", desc2 = ""; local string desc1 = "", desc2 = "";
@ -200,7 +200,7 @@ get_hash_keys (Array *list)
Loads the kername for into the hashes Loads the kername for into the hashes
*/ */
void () void ()
load_keybindings = load_keybindings =
{ {
get_hash_keys (movement_bindings); get_hash_keys (movement_bindings);
@ -214,9 +214,9 @@ load_keybindings =
*******************/ *******************/
/* /*
DESIGN NOTE (by elmex): DESIGN NOTE (by elmex):
Every sub-menu for control bindings has its own hash for holding the Every sub-menu for control bindings has its own hash for holding the
keybindings. Thats why there are three different functions, which shadow keybindings. Thats why there are three different functions, which shadow
the CB_MAIN_control_binding() function. They get the binding from the the CB_MAIN_control_binding() function. They get the binding from the
correct hash. correct hash.
@ -229,10 +229,10 @@ load_keybindings =
It takes the binding as argument. It takes the binding as argument.
This function is called by the real callbacks. This function is called by the real callbacks.
*/ */
integer int
CB_MAIN_control_binding (Binding *binding, integer key) CB_MAIN_control_binding (Binding *binding, int key)
{ {
local integer retval = 0, bindcnt = 0; local int retval = 0, bindcnt = 0;
if(set_key_flag) { if(set_key_flag) {
bindcnt = Key_CountBinding(IMT_0, binding.command); bindcnt = Key_CountBinding(IMT_0, binding.command);
@ -267,11 +267,11 @@ CB_MAIN_control_binding (Binding *binding, integer key)
Callback for the basic control bindings menu Callback for the basic control bindings menu
*/ */
integer (string text, integer key) int (string text, int key)
CB_basic_control_binding = CB_basic_control_binding =
{ {
local Binding *binding = [movement_bindings objectAtIndex: stoi (text)]; local Binding *binding = [movement_bindings objectAtIndex: stoi (text)];
local integer ret = CB_MAIN_control_binding (binding, key); local int ret = CB_MAIN_control_binding (binding, key);
// fetch all keynames (possible to optimize.. but not very neccessary) // fetch all keynames (possible to optimize.. but not very neccessary)
get_hash_keys (movement_bindings); get_hash_keys (movement_bindings);
@ -294,10 +294,10 @@ CB_ME_basic_control_binding =
Draws the menu for the basic control bindins Draws the menu for the basic control bindins
*/ */
integer (integer x, integer y) int (int x, int y)
DRAW_basic_control_binding = DRAW_basic_control_binding =
{ {
local integer cursor_pad = 40, bind_desc_pad, hl, i; local int cursor_pad = 40, bind_desc_pad, hl, i;
bind_desc_pad = 120; bind_desc_pad = 120;
@ -308,7 +308,7 @@ DRAW_basic_control_binding =
hl = [movement_bindings count]; hl = [movement_bindings count];
for(i = 0; i < hl; i++) { for(i = 0; i < hl; i++) {
local Binding *binding = [movement_bindings objectAtIndex: i]; local Binding *binding = [movement_bindings objectAtIndex: i];
draw_val_item (x + 20, y + 40 + ( i * 10), bind_desc_pad, draw_val_item (x + 20, y + 40 + ( i * 10), bind_desc_pad,
binding.text, binding.keys); binding.text, binding.keys);
} }
@ -322,10 +322,10 @@ DRAW_basic_control_binding =
Menu making function for the control bindings Menu making function for the control bindings
*/ */
void () void ()
MENU_basic_control_binding = MENU_basic_control_binding =
{ {
local integer i,hl; local int i,hl;
Menu_Begin (54, 40, "Movement bindings"); Menu_Begin (54, 40, "Movement bindings");
Menu_FadeScreen (1); Menu_FadeScreen (1);
@ -344,11 +344,11 @@ MENU_basic_control_binding =
Callback for misc control bindings. Callback for misc control bindings.
*/ */
integer (string text, integer key) int (string text, int key)
CB_misc_control_binding = CB_misc_control_binding =
{ {
local Binding *binding = [misc_bindings objectAtIndex: stoi (text)]; local Binding *binding = [misc_bindings objectAtIndex: stoi (text)];
local integer ret = CB_MAIN_control_binding (binding, key); local int ret = CB_MAIN_control_binding (binding, key);
// fetch all keynames (possible to optimize.. but not very neccessary) // fetch all keynames (possible to optimize.. but not very neccessary)
get_hash_keys (misc_bindings); get_hash_keys (misc_bindings);
@ -371,11 +371,11 @@ CB_ME_misc_control_binding =
Draw the bindings for the misc controls Draw the bindings for the misc controls
*/ */
integer (integer x, integer y) int (int x, int y)
DRAW_misc_control_binding = DRAW_misc_control_binding =
{ {
local integer cursor_pad = 40, bind_desc_pad; local int cursor_pad = 40, bind_desc_pad;
local integer i, hl; local int i, hl;
bind_desc_pad = 120; bind_desc_pad = 120;
@ -385,7 +385,7 @@ DRAW_misc_control_binding =
hl = [misc_bindings count]; hl = [misc_bindings count];
for(i=0;i < hl; i++) { for(i=0;i < hl; i++) {
local Binding *binding = [misc_bindings objectAtIndex: i]; local Binding *binding = [misc_bindings objectAtIndex: i];
draw_val_item (x + 20, y + 40+(i*10), bind_desc_pad, draw_val_item (x + 20, y + 40+(i*10), bind_desc_pad,
binding.text, binding.keys); binding.text, binding.keys);
} }
@ -398,10 +398,10 @@ DRAW_misc_control_binding =
Menu maker function for the misc control binding Menu maker function for the misc control binding
*/ */
void () void ()
MENU_misc_control_binding = MENU_misc_control_binding =
{ {
local integer hl, i; local int hl, i;
Menu_Begin (54, 50, "Misc bindings"); Menu_Begin (54, 50, "Misc bindings");
Menu_FadeScreen (1); Menu_FadeScreen (1);
@ -420,11 +420,11 @@ MENU_misc_control_binding =
Callback function for the weapons control bindings Callback function for the weapons control bindings
*/ */
integer (string text, integer key) int (string text, int key)
CB_weapon_control_binding = CB_weapon_control_binding =
{ {
local Binding *binding = [weapon_bindings objectAtIndex: stoi (text)]; local Binding *binding = [weapon_bindings objectAtIndex: stoi (text)];
local integer ret = CB_MAIN_control_binding (binding, key); local int ret = CB_MAIN_control_binding (binding, key);
// fetch all keynames (possible to optimize.. but not very neccessary) // fetch all keynames (possible to optimize.. but not very neccessary)
get_hash_keys (weapon_bindings); get_hash_keys (weapon_bindings);
@ -448,10 +448,10 @@ CB_ME_weapon_control_binding =
Draw the weapon binding menu Draw the weapon binding menu
*/ */
integer (integer x, integer y) int (int x, int y)
DRAW_weapon_control_binding = DRAW_weapon_control_binding =
{ {
local integer cursor_pad = 40, bind_desc_pad, hl, i; local int cursor_pad = 40, bind_desc_pad, hl, i;
bind_desc_pad = 120; bind_desc_pad = 120;
@ -461,7 +461,7 @@ DRAW_weapon_control_binding =
hl = [weapon_bindings count]; hl = [weapon_bindings count];
for(i = 0; i < hl; i++) { for(i = 0; i < hl; i++) {
local Binding *binding = [weapon_bindings objectAtIndex: i]; local Binding *binding = [weapon_bindings objectAtIndex: i];
draw_val_item (x + 20, y + 40 + (i * 10), bind_desc_pad, draw_val_item (x + 20, y + 40 + (i * 10), bind_desc_pad,
binding.text, binding.keys); binding.text, binding.keys);
} }
@ -475,10 +475,10 @@ DRAW_weapon_control_binding =
Menu maker for the weapons menu Menu maker for the weapons menu
*/ */
void () void ()
MENU_weapon_control_binding = MENU_weapon_control_binding =
{ {
local integer hl, i; local int hl, i;
Menu_Begin (54, 60, "Weapon bindings"); Menu_Begin (54, 60, "Weapon bindings");
Menu_FadeScreen (1); Menu_FadeScreen (1);
@ -497,7 +497,7 @@ MENU_weapon_control_binding =
Main controls menu, for selecting the sub control menus Main controls menu, for selecting the sub control menus
*/ */
void () void ()
MENU_control_binding = MENU_control_binding =
{ {
init_binding_hash (); // init the keybinding hashes init_binding_hash (); // init the keybinding hashes

View File

@ -1,28 +1,28 @@
#ifndef __menu_h #ifndef __menu_h
#define __menu_h #define __menu_h
@extern void (integer x, integer y, string text) Menu_Begin; @extern void (int x, int y, string text) Menu_Begin;
@extern void (integer val) Menu_FadeScreen; @extern void (int val) Menu_FadeScreen;
@extern void (integer (integer x, integer y) func) Menu_Draw; @extern void (int (int x, int y) func) Menu_Draw;
@extern void (void () func) Menu_EnterHook; @extern void (void () func) Menu_EnterHook;
@extern void (void () func) Menu_LeaveHook; @extern void (void () func) Menu_LeaveHook;
@extern void (integer x, integer y, string name) Menu_Pic; @extern void (int x, int y, string name) Menu_Pic;
@extern void (integer x, integer y, string name, integer srcx, integer srcy, @extern void (int x, int y, string name, int srcx, int srcy,
integer width, integer height) Menu_SubPic; int width, int height) Menu_SubPic;
@extern void (integer x, integer y, string name) Menu_CenterPic; @extern void (int x, int y, string name) Menu_CenterPic;
@extern void (integer x, integer y, string name, integer srcx, integer srcy, @extern void (int x, int y, string name, int srcx, int srcy,
integer width, integer height) Menu_CenterSubPic; int width, int height) Menu_CenterSubPic;
@extern void (integer x, integer y, string text, @extern void (int x, int y, string text,
integer (string text, integer key) func, int (string text, int key) func,
integer allkeys) Menu_Item; int allkeys) Menu_Item;
@extern void (void (integer x, integer y) func) Menu_Cursor; @extern void (void (int x, int y) func) Menu_Cursor;
@extern void (integer (integer key, integer unicode, integer down) @extern void (int (int key, int unicode, int down)
func) Menu_KeyEvent; func) Menu_KeyEvent;
@extern void () Menu_End; @extern void () Menu_End;
@extern void (string name) Menu_TopMenu; @extern void (string name) Menu_TopMenu;
@extern void (string name) Menu_SelectMenu; @extern void (string name) Menu_SelectMenu;
@extern void (integer () func) Menu_SetQuit; @extern void (int () func) Menu_SetQuit;
@extern void () Menu_Quit; @extern void () Menu_Quit;
@extern integer () Menu_GetIndex; @extern int () Menu_GetIndex;
#endif//__menu_h; #endif//__menu_h;

View File

@ -1,20 +1,20 @@
#include "menu.h" #include "menu.h"
void (integer x, integer y, string text) Menu_Begin = #0; void (int x, int y, string text) Menu_Begin = #0;
void (integer val) Menu_FadeScreen = #0; void (int val) Menu_FadeScreen = #0;
void (integer (integer x, integer y) func) Menu_Draw = #0; void (int (int x, int y) func) Menu_Draw = #0;
void (void () func) Menu_EnterHook = #0; void (void () func) Menu_EnterHook = #0;
void (void () func) Menu_LeaveHook = #0; void (void () func) Menu_LeaveHook = #0;
void (integer x, integer y, string name) Menu_Pic = #0; void (int x, int y, string name) Menu_Pic = #0;
void (integer x, integer y, string name, integer srcx, integer srcy, integer width, integer height) Menu_SubPic = #0; void (int x, int y, string name, int srcx, int srcy, int width, int height) Menu_SubPic = #0;
void (integer x, integer y, string name) Menu_CenterPic = #0; void (int x, int y, string name) Menu_CenterPic = #0;
void (integer x, integer y, string name, integer srcx, integer srcy, integer width, integer height) Menu_CenterSubPic = #0; void (int x, int y, string name, int srcx, int srcy, int width, int height) Menu_CenterSubPic = #0;
void (integer x, integer y, string text, integer (string text, integer key) func, integer allkeys) Menu_Item = #0; void (int x, int y, string text, int (string text, int key) func, int allkeys) Menu_Item = #0;
void (void (integer x, integer y) func) Menu_Cursor = #0; void (void (int x, int y) func) Menu_Cursor = #0;
void (integer (integer key, integer unicode, integer down) func) Menu_KeyEvent = #0; void (int (int key, int unicode, int down) func) Menu_KeyEvent = #0;
void () Menu_End = #0; void () Menu_End = #0;
void (string name) Menu_TopMenu = #0; void (string name) Menu_TopMenu = #0;
void (string name) Menu_SelectMenu = #0; void (string name) Menu_SelectMenu = #0;
void (integer () func) Menu_SetQuit = #0; void (int () func) Menu_SetQuit = #0;
void () Menu_Quit = #0; void () Menu_Quit = #0;
integer () Menu_GetIndex = #0; int () Menu_GetIndex = #0;

View File

@ -2,6 +2,6 @@
#define __options_h #define __options_h
@extern void () MENU_options; @extern void () MENU_options;
@extern void (integer x, integer y, integer spacing, string label, string valstr) draw_val_item; @extern void (int x, int y, int spacing, string label, string valstr) draw_val_item;
#endif//__options_r #endif//__options_r

View File

@ -93,7 +93,7 @@ InputLine *network_config_iactive;
#define COLOR_STEP 1 #define COLOR_STEP 1
/**************************** /****************************
* VIDEO OPTIONS * VIDEO OPTIONS
* Video settings menu code * Video settings menu code
****************************/ ****************************/
@ -102,8 +102,8 @@ InputLine *network_config_iactive;
Drawing function for the video options menu Drawing function for the video options menu
*/ */
integer (integer x, integer y) int (int x, int y)
DRAW_video_options = DRAW_video_options =
{ {
[video_options setBasePos:x y:y]; [video_options setBasePos:x y:y];
[video_options draw]; [video_options draw];
@ -111,7 +111,7 @@ DRAW_video_options =
return 1; return 1;
}; };
integer (integer key, integer unicode, integer down) int (int key, int unicode, int down)
KEY_video_options = KEY_video_options =
{ {
return [video_options keyEvent:key unicode:unicode down:down]; return [video_options keyEvent:key unicode:unicode down:down];
@ -149,8 +149,8 @@ MENU_video_options (PLItem *plist)
Draws the audio options menu Draws the audio options menu
*/ */
integer (integer x, integer y) int (int x, int y)
DRAW_audio_options = DRAW_audio_options =
{ {
[audio_options setBasePos:x y:y]; [audio_options setBasePos:x y:y];
[audio_options draw]; [audio_options draw];
@ -158,7 +158,7 @@ DRAW_audio_options =
return 1; return 1;
}; };
integer (integer key, integer unicode, integer down) int (int key, int unicode, int down)
KEY_audio_options = KEY_audio_options =
{ {
return [audio_options keyEvent:key unicode:unicode down:down]; return [audio_options keyEvent:key unicode:unicode down:down];
@ -196,8 +196,8 @@ MENU_audio_options (PLItem *plist)
Draws the control option menu Draws the control option menu
*/ */
integer (integer x, integer y) int (int x, int y)
DRAW_control_options = DRAW_control_options =
{ {
[control_options setBasePos:x y:y]; [control_options setBasePos:x y:y];
[control_options draw]; [control_options draw];
@ -205,7 +205,7 @@ DRAW_control_options =
return 1; return 1;
}; };
integer (integer key, integer unicode, integer down) int (int key, int unicode, int down)
KEY_control_options = KEY_control_options =
{ {
return [control_options keyEvent:key unicode:unicode down:down]; return [control_options keyEvent:key unicode:unicode down:down];
@ -244,10 +244,10 @@ MENU_control_options (PLItem *plist)
Draws the feature option menu Draws the feature option menu
*/ */
integer (integer x, integer y) int (int x, int y)
DRAW_feature_options = DRAW_feature_options =
{ {
local integer cursor_pad = 0, spacing = 120; local int cursor_pad = 0, spacing = 120;
[feature_options setBasePos:x y:y]; [feature_options setBasePos:x y:y];
[feature_options draw]; [feature_options draw];
@ -255,7 +255,7 @@ DRAW_feature_options =
return 1; return 1;
}; };
integer (integer key, integer unicode, integer down) int (int key, int unicode, int down)
KEY_feature_options = KEY_feature_options =
{ {
return [feature_options keyEvent:key unicode:unicode down:down]; return [feature_options keyEvent:key unicode:unicode down:down];
@ -299,14 +299,14 @@ string teamname_cvar; // name of the cvar holding teamname (MAY ? gametype depen
// table for cursor-positions // table for cursor-positions
#define NUM_PLAYERCONFIG_CMDS 4 #define NUM_PLAYERCONFIG_CMDS 4
integer player_config_cursor_tbl[NUM_PLAYERCONFIG_CMDS] = { int player_config_cursor_tbl[NUM_PLAYERCONFIG_CMDS] = {
PLAYER_CONF_Y_PAD + 8, PLAYER_CONF_Y_PAD + 8,
PLAYER_CONF_Y_PAD + 20 + 8, PLAYER_CONF_Y_PAD + 20 + 8,
PLAYER_CONF_Y_PAD + 45, PLAYER_CONF_Y_PAD + 45,
PLAYER_CONF_Y_PAD + 60 PLAYER_CONF_Y_PAD + 60
}; };
integer player_config_cursor; int player_config_cursor;
// array, which holds commands for this menu // array, which holds commands for this menu
string player_config_vals[NUM_PLAYERCONFIG_CMDS] = { string player_config_vals[NUM_PLAYERCONFIG_CMDS] = {
@ -317,7 +317,7 @@ string player_config_vals[NUM_PLAYERCONFIG_CMDS] = {
}; };
integer (integer key, integer unicode, integer down) int (int key, int unicode, int down)
KEYEV_player_options = KEYEV_player_options =
{ {
switch (key) { switch (key) {
@ -385,10 +385,10 @@ KEYEV_player_options =
Draws the player option menu Draws the player option menu
*/ */
integer (integer x, integer y) int (int x, int y)
DRAW_player_options = DRAW_player_options =
{ {
local integer cursor_pad = 0, spacing = 120; local int cursor_pad = 0, spacing = 120;
[player_config_plname_il cursor: player_config_iactive == player_config_plname_il]; [player_config_plname_il cursor: player_config_iactive == player_config_plname_il];
[player_config_tname_il cursor: player_config_iactive == player_config_tname_il]; [player_config_tname_il cursor: player_config_iactive == player_config_tname_il];
@ -406,7 +406,7 @@ DRAW_player_options =
Entercallback for the playermenu. Entercallback for the playermenu.
For initalising the playername and teamname. For initalising the playername and teamname.
*/ */
void () void ()
CB_ME_player_options = CB_ME_player_options =
{ {
if (gametype () == "quakeworld") { if (gametype () == "quakeworld") {
@ -417,8 +417,8 @@ CB_ME_player_options =
teamname_cvar = "team"; // FIXME: is this something else in netquake? teamname_cvar = "team"; // FIXME: is this something else in netquake?
[player_config_plname_il setText:Cvar_GetString (playername_cvar)]; [player_config_plname_il setText:Cvar_GetString (playername_cvar)];
[player_config_tname_il setText:Cvar_GetString (teamname_cvar)]; [player_config_tname_il setText:Cvar_GetString (teamname_cvar)];
}; };
/* /*
@ -497,18 +497,18 @@ MENU_player_options (PLItem *plist)
* Options, which have to do with network stuff (rate, noskins, netgraph, ...) * Options, which have to do with network stuff (rate, noskins, netgraph, ...)
*****************************************************************************/ *****************************************************************************/
integer network_config_cursor; int network_config_cursor;
// Y padding for the player config // Y padding for the player config
#define NETWORK_CONF_Y_PAD 60 #define NETWORK_CONF_Y_PAD 60
// table for cursor-positions // table for cursor-positions
#define NUM_NETWORKCONFIG_CMDS 1 #define NUM_NETWORKCONFIG_CMDS 1
integer network_config_cursor_tbl[NUM_NETWORKCONFIG_CMDS] = { int network_config_cursor_tbl[NUM_NETWORKCONFIG_CMDS] = {
PLAYER_CONF_Y_PAD + 8, PLAYER_CONF_Y_PAD + 8,
}; };
integer network_config_cursor; int network_config_cursor;
// array, which holds commands for this menu // array, which holds commands for this menu
string network_config_vals[NUM_NETWORKCONFIG_CMDS] = { string network_config_vals[NUM_NETWORKCONFIG_CMDS] = {
@ -516,7 +516,7 @@ string network_config_vals[NUM_NETWORKCONFIG_CMDS] = {
}; };
integer (integer key, integer unicode, integer down) int (int key, int unicode, int down)
KEYEV_network_options = KEYEV_network_options =
{ {
switch (key) { switch (key) {
@ -567,10 +567,10 @@ KEYEV_network_options =
Draws the network option menu Draws the network option menu
*/ */
integer (integer x, integer y) int (int x, int y)
DRAW_network_options = DRAW_network_options =
{ {
local integer cursor_pad = 0, spacing = 120; local int cursor_pad = 0, spacing = 120;
[network_config_rate_il cursor:network_config_iactive == network_config_rate_il]; [network_config_rate_il cursor:network_config_iactive == network_config_rate_il];
[network_options setBasePos:x y:y]; [network_options setBasePos:x y:y];
@ -635,7 +635,7 @@ MENU_network_options (PLItem *plist)
Menu_End (); Menu_End ();
}; };
integer (string text, integer key) int (string text, int key)
op_goto_console = op_goto_console =
{ {
Menu_SelectMenu (""); Menu_SelectMenu ("");
@ -644,7 +644,7 @@ op_goto_console =
}; };
/************************* /*************************
* MAIN OPTIONS * MAIN OPTIONS
* Main options menu code * Main options menu code
*************************/ *************************/
@ -653,10 +653,10 @@ op_goto_console =
Makes the main options menu Makes the main options menu
*/ */
void () void ()
MENU_options = MENU_options =
{ {
local integer spacing = 120; local int spacing = 120;
local PLItem *plist; local PLItem *plist;
plist = read_plist ("menu.plist"); plist = read_plist ("menu.plist");

View File

@ -1,10 +1,10 @@
#ifndef __options_util_h #ifndef __options_util_h
#define __options_util_h #define __options_util_h
@extern void (integer x, integer y) opt_cursor; @extern void (int x, int y) opt_cursor;
@extern void (integer x, integer y, integer spacing, string spacechar, string label, string valstr) draw_item; @extern void (int x, int y, int spacing, string spacechar, string label, string valstr) draw_item;
@extern void (integer x, integer y, integer spacing, string label, string valstr) draw_val_item; @extern void (int x, int y, int spacing, string label, string valstr) draw_val_item;
@extern integer (float min, float max, float val) to_percentage; @extern int (float min, float max, float val) to_percentage;
@extern float (float min, float max, float step, float val, integer cntflag) min_max_cnt; @extern float (float min, float max, float step, float val, int cntflag) min_max_cnt;
#endif//__options_util_h #endif//__options_util_h

View File

@ -35,43 +35,43 @@
function for drawing the cursor function for drawing the cursor
*/ */
void (integer x, integer y) void (int x, int y)
opt_cursor = opt_cursor =
{ {
// use time becaus we want a nice rotaing cursor // use time becaus we want a nice rotaing cursor
Draw_Character (x, y, 12 + ((integer) (time * 4) & 1)); Draw_Character (x, y, 12 + ((int) (time * 4) & 1));
}; };
/* /*
draw_item draw_item
Draws a item with a specific spacing between label and value to Draws a item with a specific spacing between label and value to
position x, y. position x, y.
Used as helper function for draw_val_item. Used as helper function for draw_val_item.
*/ */
void (integer x, integer y, integer spacing, string spacechar, void (int x, int y, int spacing, string spacechar,
string label, string valstr) string label, string valstr)
draw_item = draw_item =
{ {
local integer i; local int i;
Draw_String (x, y, label); Draw_String (x, y, label);
for (i = x + (integer) strlen (label) * 8; i < (x+spacing); i += 8) { for (i = x + (int) strlen (label) * 8; i < (x+spacing); i += 8) {
Draw_String (i, y, spacechar); Draw_String (i, y, spacechar);
} }
Draw_String (x + spacing, y, valstr); Draw_String (x + spacing, y, valstr);
}; };
/* /*
draw_val_item draw_val_item
Draws a nice menu item. Draws a nice menu item.
Use this function for a consistent look of menu items! Use this function for a consistent look of menu items!
Example: Example:
<Label>.....:<valstr> <Label>.....:<valstr>
spacing are the number of the points to put spacing are the number of the points to put
*/ */
void (integer x, integer y, integer spacing, string label, string valstr) void (int x, int y, int spacing, string label, string valstr)
draw_val_item = draw_val_item =
{ {
draw_item (x, y, spacing, ".", label, ":" + valstr); draw_item (x, y, spacing, ".", label, ":" + valstr);
@ -83,11 +83,11 @@ draw_val_item =
Calculates the percentage of a value relative Calculates the percentage of a value relative
to a min and max value. to a min and max value.
*/ */
integer (float min, float max, float val) int (float min, float max, float val)
to_percentage = to_percentage =
{ {
local float max_v = (max - min); local float max_v = (max - min);
local integer perc; local int perc;
val -= min; val -= min;
@ -97,7 +97,7 @@ to_percentage =
if (val < 0) { if (val < 0) {
val = 0; val = 0;
} }
perc = (integer) ((val / max_v) * 100); perc = (int) ((val / max_v) * 100);
return perc; return perc;
}; };
@ -110,7 +110,7 @@ to_percentage =
step is the step by in-/de-creasing. step is the step by in-/de-creasing.
cntflag should be true for increasing and false for decreasing cntflag should be true for increasing and false for decreasing
*/ */
float (float min, float max, float step, float val, integer cntflag) float (float min, float max, float step, float val, int cntflag)
min_max_cnt = min_max_cnt =
{ {
if (cntflag) { if (cntflag) {

View File

@ -42,7 +42,7 @@ class_from_plist (PLDictionary *pldict)
local id class; local id class;
local id obj; local id obj;
local PLArray *messages, *msg; local PLArray *messages, *msg;
local integer message_count, i, j; local int message_count, i, j;
local SEL sel; local SEL sel;
local PLItem *item; local PLItem *item;
@ -91,7 +91,7 @@ class_from_plist (PLDictionary *pldict)
array_from_plist (PLArray *plarray) array_from_plist (PLArray *plarray)
{ {
local Array *array; local Array *array;
local integer i, count; local int i, count;
local @param ret; local @param ret;
array = [[Array alloc] init]; array = [[Array alloc] init];
@ -114,7 +114,7 @@ rect_from_plist (PLString *plstring)
{ {
local string str = [plstring string]; local string str = [plstring string];
local string tmp; local string tmp;
local integer xp, yp, xl, yl; local int xp, yp, xl, yl;
local PLItem *item; local PLItem *item;
local union ParamRect pr; local union ParamRect pr;

View File

@ -7,7 +7,7 @@
#include "gui/InputLine.h" #include "gui/InputLine.h"
#include "gui/Rect.h" #include "gui/Rect.h"
integer (integer x, integer y) servlist_favorates_draw = int (int x, int y) servlist_favorates_draw =
{ {
Draw_Pic (x + 16, y + 4, Draw_CachePic ("gfx/qplaque.lmp", 1)); Draw_Pic (x + 16, y + 4, Draw_CachePic ("gfx/qplaque.lmp", 1));
Draw_CenterPic (x + 160, y + 4, Draw_CachePic ("gfx/p_multi.lmp", 1)); Draw_CenterPic (x + 160, y + 4, Draw_CachePic ("gfx/p_multi.lmp", 1));
@ -15,7 +15,7 @@ integer (integer x, integer y) servlist_favorates_draw =
return 1; return 1;
}; };
integer (integer x, integer y) servlist_all_draw = int (int x, int y) servlist_all_draw =
{ {
Draw_Pic (x + 16, y + 4, Draw_CachePic ("gfx/qplaque.lmp", 1)); Draw_Pic (x + 16, y + 4, Draw_CachePic ("gfx/qplaque.lmp", 1));
Draw_CenterPic (x + 160, y + 4, Draw_CachePic ("gfx/p_multi.lmp", 1)); Draw_CenterPic (x + 160, y + 4, Draw_CachePic ("gfx/p_multi.lmp", 1));
@ -23,12 +23,12 @@ integer (integer x, integer y) servlist_all_draw =
return 1; return 1;
}; };
integer serv_nfull; int serv_nfull;
integer serv_nempty; int serv_nempty;
InputLine *serv_maxping; InputLine *serv_maxping;
InputLine *serv_game; InputLine *serv_game;
integer (integer x, integer y) servlist_filter_draw = int (int x, int y) servlist_filter_draw =
{ {
Draw_Pic (x + 16, y + 4, Draw_CachePic ("gfx/qplaque.lmp", 1)); Draw_Pic (x + 16, y + 4, Draw_CachePic ("gfx/qplaque.lmp", 1));
Draw_CenterPic (x + 160, y + 4, Draw_CachePic ("gfx/p_multi.lmp", 1)); Draw_CenterPic (x + 160, y + 4, Draw_CachePic ("gfx/p_multi.lmp", 1));
@ -66,7 +66,7 @@ void () servlist_all_menu =
Menu_End (); Menu_End ();
}; };
integer (string text, integer key) sl_filter_in = int (string text, int key) sl_filter_in =
{ {
load_keybindings(); load_keybindings();
switch (text) { switch (text) {

View File

@ -1,6 +1,6 @@
#ifndef __world_h #ifndef __world_h
#define __world_h #define __world_h
@extern integer deathmatch; @extern int deathmatch;
#endif//__world_h #endif//__world_h

View File

@ -2,14 +2,14 @@
#include "World.h" #include "World.h"
id world; id world;
integer deathmatch; int deathmatch;
#define MAX_BODIES 8 #define MAX_BODIES 8
@interface BodyQueue: Object @interface BodyQueue: Object
{ {
entity bodies[MAX_BODIES]; entity bodies[MAX_BODIES];
integer head; int head;
} }
- (id) init; - (id) init;
@ -21,7 +21,7 @@ integer deathmatch;
- (id) init - (id) init
{ {
local integer i; local int i;
self = [super init]; self = [super init];
head = nil; head = nil;

View File

@ -32,12 +32,12 @@
return self; return self;
} }
- (void) moveTo: (integer)x y:(integer)y - (void) moveTo: (int)x y:(int)y
{ {
[self setBasePos: x y:y]; [self setBasePos: x y:y];
} }
- (void) setBasePos: (integer) x y: (integer) y - (void) setBasePos: (int) x y: (int) y
{ {
[super setBasePos: x y:y]; [super setBasePos: x y:y];
local SEL sel = @selector (setBasePosFromView:); local SEL sel = @selector (setBasePosFromView:);

View File

@ -2,19 +2,19 @@
#include "gui/InputLine.h" #include "gui/InputLine.h"
#include "gui/Rect.h" #include "gui/Rect.h"
inputline_t (integer lines, integer size, integer prompt) InputLine_Create = #0; inputline_t (int lines, int size, int prompt) InputLine_Create = #0;
void InputLine_SetUserData (inputline_t il, void *data) = #0; void InputLine_SetUserData (inputline_t il, void *data) = #0;
void (inputline_t il, integer width) InputLine_SetWidth = #0; void (inputline_t il, int width) InputLine_SetWidth = #0;
void (inputline_t il) InputLine_Destroy = #0; void (inputline_t il) InputLine_Destroy = #0;
void (inputline_t il, integer size) InputLine_Clear = #0; void (inputline_t il, int size) InputLine_Clear = #0;
void (inputline_t il, integer ch) InputLine_Process = #0; void (inputline_t il, int ch) InputLine_Process = #0;
void (inputline_t il) InputLine_Draw = #0; void (inputline_t il) InputLine_Draw = #0;
void (inputline_t il, string str) InputLine_SetText = #0; void (inputline_t il, string str) InputLine_SetText = #0;
string (inputline_t il) InputLine_GetText = #0; string (inputline_t il) InputLine_GetText = #0;
@implementation InputLine @implementation InputLine
- (id) initWithBounds: (Rect)aRect promptCharacter: (integer)char - (id) initWithBounds: (Rect)aRect promptCharacter: (int)char
{ {
self = [super initWithComponents:aRect.origin.x :aRect.origin.y :aRect.size.width * 8 :8]; self = [super initWithComponents:aRect.origin.x :aRect.origin.y :aRect.size.width * 8 :8];
control.x = xabs; control.x = xabs;
@ -40,12 +40,12 @@ string (inputline_t il) InputLine_GetText = #0;
control.y = yabs; control.y = yabs;
} }
- (void) setWidth: (integer)width - (void) setWidth: (int)width
{ {
InputLine_SetWidth (il, width); InputLine_SetWidth (il, width);
} }
- (void) processInput: (integer)key - (void) processInput: (int)key
{ {
InputLine_Process (il, key); InputLine_Process (il, key);
} }
@ -74,9 +74,9 @@ string (inputline_t il) InputLine_GetText = #0;
@end @end
@implementation InputLineBox @implementation InputLineBox
- (id) initWithBounds: (Rect)aRect promptCharacter: (integer)char - (id) initWithBounds: (Rect)aRect promptCharacter: (int)char
{ {
local integer xp, yp, xl, yl; local int xp, yp, xl, yl;
local Rect r; local Rect r;
xp = aRect.origin.x; xp = aRect.origin.x;
@ -94,7 +94,7 @@ string (inputline_t il) InputLine_GetText = #0;
return self; return self;
} }
- (void) setWidth: (integer)width - (void) setWidth: (int)width
{ {
[input_line setWidth:width]; [input_line setWidth:width];
} }
@ -104,7 +104,7 @@ string (inputline_t il) InputLine_GetText = #0;
[input_line cursor:cursor]; [input_line cursor:cursor];
} }
- (void) processInput: (integer)key - (void) processInput: (int)key
{ {
[input_line processInput:key]; [input_line processInput:key];
} }

View File

@ -1,6 +1,6 @@
#include "gui/Point.h" #include "gui/Point.h"
Point makePoint (integer x, integer y) Point makePoint (int x, int y)
{ {
Point p = {x, y}; Point p = {x, y};
return p; return p;

View File

@ -3,7 +3,7 @@
#include "gui/Size.h" #include "gui/Size.h"
#include "gui/Rect.h" #include "gui/Rect.h"
Rect makeRect (integer x, integer y, integer w, integer h) Rect makeRect (int x, int y, int w, int h)
{ {
//FIXME Rect r = {{x, y}, {w, h}}; //FIXME Rect r = {{x, y}, {w, h}};
Rect r; Rect r;

View File

@ -1,6 +1,6 @@
#include "gui/Size.h" #include "gui/Size.h"
Size makeSize (integer width, integer height) Size makeSize (int width, int height)
{ {
Size s = {width, height}; Size s = {width, height};
return s; return s;

View File

@ -5,7 +5,7 @@
@implementation Slider @implementation Slider
- (id) initWithBounds: (Rect)aRect size: (integer) aSize - (id) initWithBounds: (Rect)aRect size: (int) aSize
{ {
self = [self initWithBounds:aRect]; self = [self initWithBounds:aRect];
dir = ylen > xlen; dir = ylen > xlen;
@ -14,7 +14,7 @@
return self; return self;
} }
- (void) setIndex: (integer) ind - (void) setIndex: (int) ind
{ {
index = ind; index = ind;
if (index < 0) if (index < 0)
@ -25,7 +25,7 @@
- (void) draw - (void) draw
{ {
local integer pos, x, y; local int pos, x, y;
pos = (index * ((dir ? ylen : xlen) - 24) / size) + 8; pos = (index * ((dir ? ylen : xlen) - 24) / size) + 8;
if (dir) { if (dir) {

View File

@ -34,7 +34,7 @@
- (void) draw - (void) draw
{ {
local integer maxlen = xlen / 8; local int maxlen = xlen / 8;
Draw_nString (xabs, yabs, text, maxlen); Draw_nString (xabs, yabs, text, maxlen);
} }

View File

@ -5,7 +5,7 @@
@implementation View @implementation View
- (id) initWithComponents: (integer)x : (integer)y : (integer)w : (integer)h - (id) initWithComponents: (int)x : (int)y : (int)w : (int)h
{ {
self = [self init]; self = [self init];
xpos = xabs = x; xpos = xabs = x;
@ -27,13 +27,13 @@
return [self initWithOrigin:aRect.origin size:aRect.size]; return [self initWithOrigin:aRect.origin size:aRect.size];
} }
- (id) canFocus: (integer) cf - (id) canFocus: (int) cf
{ {
flags |= 1; flags |= 1;
return self; return self;
} }
- (integer) canFocus - (int) canFocus
{ {
return flags & 1; return flags & 1;
} }
@ -43,7 +43,7 @@
return makePoint (xabs, yabs); return makePoint (xabs, yabs);
} }
- (void) setBasePos: (integer) x y: (integer) y - (void) setBasePos: (int) x y: (int) y
{ {
local Point point = {x, y}; local Point point = {x, y};
xabs = xpos + x; xabs = xpos + x;
@ -61,7 +61,7 @@
{ {
} }
- (integer) keyEvent:(integer)key unicode:(integer)unicode down:(integer)down - (int) keyEvent:(int)key unicode:(int)unicode down:(int)down
{ {
return 0; return 0;
} }

View File

@ -37,7 +37,7 @@
{ {
@public @public
entity ent; entity ent;
integer own; int own;
} }
- (id) init; - (id) init;

View File

@ -5,12 +5,12 @@
@interface List: Object @interface List: Object
{ {
integer count; int count;
struct list_bucket_s *head; struct list_bucket_s *head;
struct list_bucket_s **tail; struct list_bucket_s **tail;
} }
- (id) init; - (id) init;
- (id) getItemAt: (integer) index; - (id) getItemAt: (int) index;
- (id) head; - (id) head;
- (id) tail; - (id) tail;
- (void) addItemAtHead: (id) item; - (void) addItemAtHead: (id) item;
@ -18,7 +18,7 @@
- (id) removeItem: (id) item; - (id) removeItem: (id) item;
- (id) removeItemAtHead; - (id) removeItemAtHead;
- (id) removeItemAtTail; - (id) removeItemAtTail;
- (integer) count; - (int) count;
-(void)makeObjectsPerformSelector:(SEL)selector; -(void)makeObjectsPerformSelector:(SEL)selector;
-(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg; -(void)makeObjectsPerformSelector:(SEL)selector withObject:(id)arg;
@end @end

View File

@ -7,11 +7,11 @@
@interface PLItem: Object @interface PLItem: Object
{ {
plitem_t item; plitem_t item;
integer own; int own;
} }
+ (PLItem *) newDictionary; + (PLItem *) newDictionary;
+ (PLItem *) newArray; + (PLItem *) newArray;
+ (PLItem *) newData:(void*) data size:(integer) len; + (PLItem *) newData:(void*) data size:(int) len;
+ (PLItem *) newString:(string) str; + (PLItem *) newString:(string) str;
+ (PLItem *) fromString:(string) str; + (PLItem *) fromString:(string) str;
+ (PLItem *) fromFile:(QFile) file; + (PLItem *) fromFile:(QFile) file;
@ -25,8 +25,8 @@
@interface PLDictionary: PLItem @interface PLDictionary: PLItem
+ (PLDictionary *) new; + (PLDictionary *) new;
- (integer) count; - (int) count;
- (integer) numKeys; - (int) numKeys;
- (PLItem *) getObjectForKey:(string) key; - (PLItem *) getObjectForKey:(string) key;
- (PLItem *) allKeys; - (PLItem *) allKeys;
- addKey:(string) key value:(PLItem *) value; - addKey:(string) key value:(PLItem *) value;
@ -35,15 +35,15 @@
@interface PLArray: PLItem @interface PLArray: PLItem
+ (PLArray *) new; + (PLArray *) new;
- (integer) count; - (int) count;
- (integer) numObjects; - (int) numObjects;
- (PLItem *) getObjectAtIndex:(integer) index; - (PLItem *) getObjectAtIndex:(int) index;
- addObject:(PLItem *) object; - addObject:(PLItem *) object;
- insertObject:(PLItem *) object atIndex:(integer) index; - insertObject:(PLItem *) object atIndex:(int) index;
@end @end
@interface PLData: PLItem @interface PLData: PLItem
+ (PLData *) new:(void*) data size:(integer) len; + (PLData *) new:(void*) data size:(int) len;
@end @end
@interface PLString: PLItem @interface PLString: PLItem

View File

@ -35,14 +35,14 @@
@interface Stack: Object @interface Stack: Object
{ {
id top; // Top of the stack id top; // Top of the stack
integer stackSize; int stackSize;
} }
- (void) removeAllObjects; // Empty the stack - (void) removeAllObjects; // Empty the stack
- (void) addObject: (id)anObject; // Push anObject onto the stack - (void) addObject: (id)anObject; // Push anObject onto the stack
- (id) pop; // pull top object off - (id) pop; // pull top object off
- (id) peek; // Grab the top object without removing it - (id) peek; // Grab the top object without removing it
- (integer) count; // Number of objects on stack - (int) count; // Number of objects on stack
@end @end

View File

@ -2,8 +2,8 @@
#define __ruamoko_cmd_h #define __ruamoko_cmd_h
@extern void Cmd_AddCommand (string name, void func ()); @extern void Cmd_AddCommand (string name, void func ());
@extern integer Cmd_Argc (void); @extern int Cmd_Argc (void);
@extern string Cmd_Argv (integer arg); @extern string Cmd_Argv (int arg);
@extern string Cmd_Args (integer arg); @extern string Cmd_Args (int arg);
#endif//__ruamoko_cmd_h #endif//__ruamoko_cmd_h

View File

@ -3,11 +3,11 @@
@extern void Cvar_SetString (string varname, string value); @extern void Cvar_SetString (string varname, string value);
@extern void Cvar_SetFloat (string varname, float value); @extern void Cvar_SetFloat (string varname, float value);
@extern void Cvar_SetInteger (string varname, integer value); @extern void Cvar_SetInteger (string varname, int value);
@extern void Cvar_SetVector (string varname, vector value); @extern void Cvar_SetVector (string varname, vector value);
@extern string Cvar_GetString (string varname); @extern string Cvar_GetString (string varname);
@extern float Cvar_GetFloat (string varname); @extern float Cvar_GetFloat (string varname);
@extern integer Cvar_GetInteger (string varname); @extern int Cvar_GetInteger (string varname);
@extern vector Cvar_GetVector (string varname); @extern vector Cvar_GetVector (string varname);
@extern void Cvar_Toggle (string varname); @extern void Cvar_Toggle (string varname);

View File

@ -4,24 +4,24 @@
#include "Object.h" #include "Object.h"
struct _qpic_t { struct _qpic_t {
integer width; int width;
integer height; int height;
}; };
typedef struct _qpic_t *qpic_t; typedef struct _qpic_t *qpic_t;
@extern qpic_t Draw_CachePic (string name, integer alpha); @extern qpic_t Draw_CachePic (string name, int alpha);
@extern void Draw_Pic (integer x, integer y, qpic_t pic); @extern void Draw_Pic (int x, int y, qpic_t pic);
@extern void Draw_SubPic (integer x, integer y, qpic_t pic, integer srcx, integer srcy, integer width, integer height); @extern void Draw_SubPic (int x, int y, qpic_t pic, int srcx, int srcy, int width, int height);
@extern void Draw_CenterPic (integer x, integer y, qpic_t pic); @extern void Draw_CenterPic (int x, int y, qpic_t pic);
@extern void Draw_Character (integer x, integer y, integer chr); @extern void Draw_Character (int x, int y, int chr);
@extern void Draw_String (integer x, integer y, string text); @extern void Draw_String (int x, int y, string text);
@extern void Draw_nString (integer x, integer y, string text, integer n); @extern void Draw_nString (int x, int y, string text, int n);
@extern void Draw_AltString (integer x, integer y, string text); @extern void Draw_AltString (int x, int y, string text);
@extern void Draw_Fill (integer x, integer y, integer w, integer h, integer c); @extern void Draw_Fill (int x, int y, int w, int h, int c);
@extern void Draw_Crosshair (integer ch, integer x, integer y); @extern void Draw_Crosshair (int ch, int x, int y);
@extern void text_box (integer x, integer y, integer width, integer lines); @extern void text_box (int x, int y, int width, int lines);
@interface QPic : Object @interface QPic : Object
{ {
@ -31,10 +31,10 @@ typedef struct _qpic_t *qpic_t;
} }
-initName:(string)n; -initName:(string)n;
-initName:(string)n Centered:(BOOL)c; -initName:(string)n Centered:(BOOL)c;
-draw:(integer)x :(integer)y; -draw:(int)x :(int)y;
-draw:(integer)x :(integer)y :(integer)srcx :(integer)srcy :(integer)width :(integer)height; -draw:(int)x :(int)y :(int)srcx :(int)srcy :(int)width :(int)height;
-(integer)width; -(int)width;
-(integer)height; -(int)height;
@end @end
#endif//__ruamoko_draw_h #endif//__ruamoko_draw_h

View File

@ -1,7 +1,7 @@
#ifndef __ruamoko_gib_h #ifndef __ruamoko_gib_h
#define __ruamoko_gib_h #define __ruamoko_gib_h
@extern void GIB_Builtin_Add (string name, void func (integer argc, string *argv)); @extern void GIB_Builtin_Add (string name, void func (int argc, string *argv));
@extern integer GIB_Return (string value); @extern int GIB_Return (string value);
#endif//__ruamoko_gib_h #endif//__ruamoko_gib_h

View File

@ -12,7 +12,7 @@
- (void) dealloc; - (void) dealloc;
- (View*) addView: (View*)aView; - (View*) addView: (View*)aView;
- (id) addViews: (Array*)viewlist; - (id) addViews: (Array*)viewlist;
- (void) moveTo: (integer)x y:(integer)y; - (void) moveTo: (int)x y:(int)y;
- (void) draw; - (void) draw;
@end @end

View File

@ -6,18 +6,18 @@
struct _inputline_t {}; // opaque type :) struct _inputline_t {}; // opaque type :)
typedef struct _inputline_t *inputline_t; typedef struct _inputline_t *inputline_t;
@extern inputline_t (integer lines, integer size, integer prompt) InputLine_Create; @extern inputline_t (int lines, int size, int prompt) InputLine_Create;
@extern void InputLine_SetUserData (inputline_t il, void *data); @extern void InputLine_SetUserData (inputline_t il, void *data);
@extern void (inputline_t il, integer width) InputLine_SetWidth; @extern void (inputline_t il, int width) InputLine_SetWidth;
@extern void (inputline_t il) InputLine_Destroy; @extern void (inputline_t il) InputLine_Destroy;
@extern void (inputline_t il, integer save) InputLine_Clear; @extern void (inputline_t il, int save) InputLine_Clear;
@extern void (inputline_t il, integer ch) InputLine_Process; @extern void (inputline_t il, int ch) InputLine_Process;
@extern void (inputline_t il) InputLine_Draw; @extern void (inputline_t il) InputLine_Draw;
@extern void (inputline_t il, string str) InputLine_SetText; @extern void (inputline_t il, string str) InputLine_SetText;
@extern string (inputline_t il) InputLine_GetText; @extern string (inputline_t il) InputLine_GetText;
struct il_data_t { struct il_data_t {
integer x, y; int x, y;
BOOL cursor; BOOL cursor;
}; };
@ -27,14 +27,14 @@ struct il_data_t {
inputline_t il; inputline_t il;
} }
- (id) initWithBounds: (Rect)aRect promptCharacter: (integer)char; - (id) initWithBounds: (Rect)aRect promptCharacter: (int)char;
- (void) setBasePosFromView: (View *) view; - (void) setBasePosFromView: (View *) view;
- (void) setWidth: (integer)width; - (void) setWidth: (int)width;
- (void) cursor: (BOOL)cursor; - (void) cursor: (BOOL)cursor;
- (void) draw; - (void) draw;
- (void) processInput: (integer)key; - (void) processInput: (int)key;
- (id) setText: (string)text; - (id) setText: (string)text;
- (string) text; - (string) text;
@ -45,12 +45,12 @@ struct il_data_t {
{ {
InputLine *input_line; InputLine *input_line;
} }
- (id) initWithBounds: (Rect)aRect promptCharacter: (integer)char; - (id) initWithBounds: (Rect)aRect promptCharacter: (int)char;
- (void) setWidth: (integer)width; - (void) setWidth: (int)width;
- (void) cursor: (BOOL)cursor; - (void) cursor: (BOOL)cursor;
- (void) processInput: (integer)key; - (void) processInput: (int)key;
- (id) setText: (string)text; - (id) setText: (string)text;
- (string) text; - (string) text;

View File

@ -2,13 +2,13 @@
#define __ruamoko_gui_Point_h #define __ruamoko_gui_Point_h
struct Point { struct Point {
integer x; int x;
integer y; int y;
}; };
typedef struct Point Point; typedef struct Point Point;
@extern Point makePoint (integer x, integer y); @extern Point makePoint (int x, int y);
@extern Point addPoint (Point a, Point b); @extern Point addPoint (Point a, Point b);
@extern Point subtractPoint (Point a, Point b); @extern Point subtractPoint (Point a, Point b);

View File

@ -10,7 +10,7 @@ struct Rect {
}; };
typedef struct Rect Rect; typedef struct Rect Rect;
@extern Rect makeRect (integer x, integer y, integer w, integer h); @extern Rect makeRect (int x, int y, int w, int h);
@extern Rect makeRectFromOriginSize (Point origin, Size size); @extern Rect makeRectFromOriginSize (Point origin, Size size);
#if 0 #if 0

View File

@ -2,13 +2,13 @@
#define __ruamoko_gui_Size_h #define __ruamoko_gui_Size_h
struct Size { struct Size {
integer width; int width;
integer height; int height;
}; };
typedef struct Size Size; typedef struct Size Size;
@extern Size makeSize (integer width, integer height); @extern Size makeSize (int width, int height);
@extern Size addSize (Size a, Size b); @extern Size addSize (Size a, Size b);
@extern Size subtractSize (Size a, Size b); @extern Size subtractSize (Size a, Size b);

View File

@ -5,13 +5,13 @@
@interface Slider: View @interface Slider: View
{ {
integer index; int index;
integer size; int size;
integer dir; int dir;
} }
- (id) initWithBounds: (Rect)aRect size: (integer) aSize; - (id) initWithBounds: (Rect)aRect size: (int) aSize;
- (void) setIndex: (integer) ind; - (void) setIndex: (int) ind;
- (void) draw; - (void) draw;
@end @end

View File

@ -7,23 +7,23 @@
@interface View: Object @interface View: Object
{ {
@public @public
integer xpos, ypos; int xpos, ypos;
integer xlen, ylen; int xlen, ylen;
integer xabs, yabs; int xabs, yabs;
View *parent; View *parent;
integer flags; int flags;
} }
- (id) initWithComponents: (integer)x : (integer)y : (integer)w : (integer)h; - (id) initWithComponents: (int)x : (int)y : (int)w : (int)h;
- (id) initWithOrigin: (Point)anOrigin size: (Size)aSize; - (id) initWithOrigin: (Point)anOrigin size: (Size)aSize;
- (id) initWithBounds: (Rect)aRect; - (id) initWithBounds: (Rect)aRect;
- (id) canFocus: (integer)cf; - (id) canFocus: (int)cf;
- (integer) canFocus; - (int) canFocus;
- (void) setBasePos: (integer)x y: (integer)y; - (void) setBasePos: (int)x y: (int)y;
- (void) setBasePosFromView: (View*)view; - (void) setBasePosFromView: (View*)view;
- (void) draw; - (void) draw;
- (integer) keyEvent:(integer)key unicode:(integer)unicode down:(integer)down; - (int) keyEvent:(int)key unicode:(int)unicode down:(int)down;
@end @end
#endif //__ruamoko_gui_View_h #endif //__ruamoko_gui_View_h

View File

@ -4,12 +4,12 @@
struct _hashtab_t {}; struct _hashtab_t {};
typedef struct _hashtab_t *hashtab_t; typedef struct _hashtab_t *hashtab_t;
@extern hashtab_t Hash_NewTable (integer size, string gk (void *ele, void *data), void f (void *ele, void *data), void *ud); @extern hashtab_t Hash_NewTable (int size, string gk (void *ele, void *data), void f (void *ele, void *data), void *ud);
@extern void Hash_SetHashCompare (hashtab_t tab, unsigned gh (void *ele, void *data), integer cmp (void *ele1, void *ele2, void *data)); @extern void Hash_SetHashCompare (hashtab_t tab, unsigned gh (void *ele, void *data), int cmp (void *ele1, void *ele2, void *data));
@extern void Hash_DelTable (hashtab_t tab); @extern void Hash_DelTable (hashtab_t tab);
@extern void Hash_FlushTable (hashtab_t tab); @extern void Hash_FlushTable (hashtab_t tab);
@extern integer Hash_Add (hashtab_t tab, void *ele); @extern int Hash_Add (hashtab_t tab, void *ele);
@extern integer Hash_AddElement (hashtab_t tab, void *ele); @extern int Hash_AddElement (hashtab_t tab, void *ele);
@extern void *Hash_Find (hashtab_t tab, string key); @extern void *Hash_Find (hashtab_t tab, string key);
@extern void *Hash_FindElement (hashtab_t tab, void *ele); @extern void *Hash_FindElement (hashtab_t tab, void *ele);
@extern void **Hash_FindList (hashtab_t tab, string key); @extern void **Hash_FindList (hashtab_t tab, string key);
@ -17,8 +17,8 @@ typedef struct _hashtab_t *hashtab_t;
@extern void *Hash_Del (hashtab_t tab, string key); @extern void *Hash_Del (hashtab_t tab, string key);
@extern void *Hash_DelElement (hashtab_t tab, void *ele); @extern void *Hash_DelElement (hashtab_t tab, void *ele);
@extern void Hash_Free (hashtab_t tab, void *ele); @extern void Hash_Free (hashtab_t tab, void *ele);
@extern integer Hash_String (string str); @extern int Hash_String (string str);
@extern integer Hash_Buffer (void *buf, integer len); @extern int Hash_Buffer (void *buf, int len);
@extern void **Hash_GetList (hashtab_t tab); @extern void **Hash_GetList (hashtab_t tab);
@extern void Hash_Stats (hashtab_t tab); @extern void Hash_Stats (hashtab_t tab);

View File

@ -2,9 +2,9 @@
#define __ruamoko_key_h #define __ruamoko_key_h
#include "QF/keys.h" #include "QF/keys.h"
@extern string Key_SetBinding (integer target, integer keynum, string binding); @extern string Key_SetBinding (int target, int keynum, string binding);
@extern integer Key_LookupBinding (integer target, integer bindnum, string binding); @extern int Key_LookupBinding (int target, int bindnum, string binding);
@extern integer Key_CountBinding (integer target, string binding); @extern int Key_CountBinding (int target, string binding);
@extern string Key_KeynumToString (integer keynum); @extern string Key_KeynumToString (int keynum);
#endif//__ruamoko_key_h #endif//__ruamoko_key_h

View File

@ -39,12 +39,12 @@
/** /**
Returns the integer component of \a f Returns the integer component of \a f
*/ */
@extern integer ftoi (float f); @extern int ftoi (float f);
/** /**
Returns the float representation of \a i Returns the float representation of \a i
*/ */
@extern float itof (integer i); @extern float itof (int i);
/** /**
Rounds \a f to the nearest integer value and returns it. Does not change the type. Rounds \a f to the nearest integer value and returns it. Does not change the type.

View File

@ -27,10 +27,10 @@
@extern vector aim (entity e, float speed); @extern vector aim (entity e, float speed);
@extern void ChangeYaw (void); @extern void ChangeYaw (void);
@extern void movetogoal (float step); @extern void movetogoal (float step);
@extern integer hullpointcontents (entity ent, vector point); @extern int hullpointcontents (entity ent, vector point);
@extern vector getboxbounds (integer hull, integer max); @extern vector getboxbounds (int hull, int max);
@extern integer getboxhull (void); @extern int getboxhull (void);
@extern void freeboxhull (integer hull); @extern void freeboxhull (int hull);
@extern void rotate_bbox (integer hull, vector right, vector forward, vector up, vector mins, vector maxs); @extern void rotate_bbox (int hull, vector right, vector forward, vector up, vector mins, vector maxs);
#endif//__ruamoko_physics_h #endif//__ruamoko_physics_h

View File

@ -3,7 +3,7 @@
#include "qfile.h" #include "qfile.h"
struct plitem_s {integer dummy;}; struct plitem_s {int dummy;};
#define PL_TEST(item) (item.dummy) #define PL_TEST(item) (item.dummy)
typedef struct plitem_s plitem_t; typedef struct plitem_s plitem_t;
typedef enum {QFDictionary, QFArray, QFBinary, QFString} pltype_t; // possible types typedef enum {QFDictionary, QFArray, QFBinary, QFString} pltype_t; // possible types
@ -15,17 +15,17 @@ typedef enum {QFDictionary, QFArray, QFBinary, QFString} pltype_t; // possible t
@extern string PL_String (plitem_t str); @extern string PL_String (plitem_t str);
@extern plitem_t PL_ObjectForKey (plitem_t item, string key); @extern plitem_t PL_ObjectForKey (plitem_t item, string key);
@extern plitem_t PL_RemoveObjectForKey (plitem_t item, string key); @extern plitem_t PL_RemoveObjectForKey (plitem_t item, string key);
@extern plitem_t PL_ObjectAtIndex (plitem_t item, integer index); @extern plitem_t PL_ObjectAtIndex (plitem_t item, int index);
@extern plitem_t PL_D_AllKeys (plitem_t item); @extern plitem_t PL_D_AllKeys (plitem_t item);
@extern integer PL_D_NumKeys (plitem_t item); @extern int PL_D_NumKeys (plitem_t item);
@extern integer PL_D_AddObject (plitem_t dict, string key, plitem_t value); @extern int PL_D_AddObject (plitem_t dict, string key, plitem_t value);
@extern integer PL_A_AddObject (plitem_t array_item, plitem_t item); @extern int PL_A_AddObject (plitem_t array_item, plitem_t item);
@extern integer PL_A_NumObjects (plitem_t item); @extern int PL_A_NumObjects (plitem_t item);
@extern integer PL_A_InsertObjectAtIndex (plitem_t array_item, plitem_t item, integer index); @extern int PL_A_InsertObjectAtIndex (plitem_t array_item, plitem_t item, int index);
@extern plitem_t PL_RemoveObjectAtIndex (plitem_t array_item, integer index); @extern plitem_t PL_RemoveObjectAtIndex (plitem_t array_item, int index);
@extern plitem_t PL_NewDictionary (); @extern plitem_t PL_NewDictionary ();
@extern plitem_t PL_NewArray (); @extern plitem_t PL_NewArray ();
@extern plitem_t PL_NewData (void *data, integer len); @extern plitem_t PL_NewData (void *data, int len);
@extern plitem_t PL_NewString (string str); @extern plitem_t PL_NewString (string str);
@extern void PL_Free (plitem_t pl); @extern void PL_Free (plitem_t pl);

View File

@ -4,22 +4,22 @@
struct _qfile_t {}; struct _qfile_t {};
typedef struct _qfile_t *QFile; typedef struct _qfile_t *QFile;
@extern integer Qrename (string old, string new); @extern int Qrename (string old, string new);
@extern integer Qremove (string path); @extern int Qremove (string path);
@extern QFile Qopen (string path, string mode); @extern QFile Qopen (string path, string mode);
@extern void Qclose (QFile file); @extern void Qclose (QFile file);
@extern string Qgetline (QFile file); @extern string Qgetline (QFile file);
@extern string Qreadstring (QFile file, integer len); @extern string Qreadstring (QFile file, int len);
@extern integer Qread (QFile file, void *buf, integer count); @extern int Qread (QFile file, void *buf, int count);
@extern integer Qwrite (QFile file, void *buf, integer count); @extern int Qwrite (QFile file, void *buf, int count);
@extern integer Qputs (QFile file, string str); @extern int Qputs (QFile file, string str);
//@extern integer Qgets (QFile file, void *buf, integer count); //@extern int Qgets (QFile file, void *buf, int count);
@extern integer Qgetc (QFile file); @extern int Qgetc (QFile file);
@extern integer Qputc (QFile file, integer c); @extern int Qputc (QFile file, int c);
@extern integer Qseek (QFile file, integer offset, integer whence); @extern int Qseek (QFile file, int offset, int whence);
@extern integer Qtell (QFile file); @extern int Qtell (QFile file);
@extern integer Qflush (QFile file); @extern int Qflush (QFile file);
@extern integer Qeof (QFile file); @extern int Qeof (QFile file);
@extern integer Qfilesize (QFile file); @extern int Qfilesize (QFile file);
#endif//__ruamoko_qfile_h #endif//__ruamoko_qfile_h

View File

@ -4,18 +4,18 @@
#include "qfile.h" #include "qfile.h"
struct _qfslist_t { struct _qfslist_t {
integer count; int count;
string *list; string *list;
}; };
typedef struct _qfslist_t *QFSlist; typedef struct _qfslist_t *QFSlist;
@extern QFile QFS_Open (string path, string mode); @extern QFile QFS_Open (string path, string mode);
@extern QFile QFS_WOpen (string path, integer zip); @extern QFile QFS_WOpen (string path, int zip);
@extern integer QFS_Rename (string old, string new); @extern int QFS_Rename (string old, string new);
@extern void *QFS_LoadFile (string filename); @extern void *QFS_LoadFile (string filename);
@extern QFile QFS_OpenFile (string filename); @extern QFile QFS_OpenFile (string filename);
@extern integer QFS_WriteFile (string filename, void *buf, integer count); @extern int QFS_WriteFile (string filename, void *buf, int count);
@extern QFSlist QFS_Filelist (string path, string ext, integer strip); @extern QFSlist QFS_Filelist (string path, string ext, int strip);
@extern void QFS_FilelistFree (QFSlist list); @extern void QFS_FilelistFree (QFSlist list);
#endif//__ruamoko_qfs_h #endif//__ruamoko_qfs_h

View File

@ -18,17 +18,17 @@ typedef enum {
YES ///< a true value YES ///< a true value
} BOOL; } BOOL;
@extern void obj_error (id object, integer code, string fmt, ...); @extern void obj_error (id object, int code, string fmt, ...);
@extern void obj_verror (id object, integer code, string fmt, @va_list args); @extern void obj_verror (id object, int code, string fmt, @va_list args);
//obj_error_handler obj_set_error_handler (objc_error_handler func); //obj_error_handler obj_set_error_handler (objc_error_handler func);
@extern IMP obj_msg_lookup (id receiver, SEL op); @extern IMP obj_msg_lookup (id receiver, SEL op);
@extern IMP obj_msg_lookup_super (Super class, SEL op); @extern IMP obj_msg_lookup_super (Super class, SEL op);
@extern @param obj_msg_sendv (id receiver, SEL op, @va_list args); @extern @param obj_msg_sendv (id receiver, SEL op, @va_list args);
@extern void *obj_malloc (integer size); @extern void *obj_malloc (int size);
@extern void *obj_atomic_malloc (integer size); @extern void *obj_atomic_malloc (int size);
@extern void *obj_valloc (integer size); @extern void *obj_valloc (int size);
@extern void *obj_realloc (void *mem, integer size); @extern void *obj_realloc (void *mem, int size);
@extern void *obj_calloc (integer nelem, integer size); @extern void *obj_calloc (int nelem, int size);
@extern void obj_free (void *mem); @extern void obj_free (void *mem);
//(void *) obj_get_uninstalled_dtable (void); //(void *) obj_get_uninstalled_dtable (void);
@ -51,13 +51,13 @@ typedef enum {
@extern Class class_pose_as (Class imposter, Class superclass); @extern Class class_pose_as (Class imposter, Class superclass);
@extern id class_create_instance (Class class); @extern id class_create_instance (Class class);
@extern string class_get_class_name (Class class); @extern string class_get_class_name (Class class);
@extern integer class_get_instance_size (Class class); @extern int class_get_instance_size (Class class);
@extern Class class_get_meta_class (Class class); @extern Class class_get_meta_class (Class class);
@extern Class class_get_super_class (Class class); @extern Class class_get_super_class (Class class);
@extern integer class_get_version (Class class); @extern int class_get_version (Class class);
@extern BOOL class_is_class (Class class); @extern BOOL class_is_class (Class class);
@extern BOOL class_is_meta_class (Class class); @extern BOOL class_is_meta_class (Class class);
@extern void class_set_version (Class class, integer version); @extern void class_set_version (Class class, int version);
@extern void *class_get_gc_object_type (Class class); @extern void *class_get_gc_object_type (Class class);
@extern void class_ivar_set_gcinvisible (Class class, string ivarname, BOOL gcInvisible); @extern void class_ivar_set_gcinvisible (Class class, string ivarname, BOOL gcInvisible);

View File

@ -7,10 +7,10 @@ typedef struct rua_script *script_t;
@extern void Script_Delete (script_t script); @extern void Script_Delete (script_t script);
// returns the token string // returns the token string
@extern string Script_Start (script_t script, string file, string data); @extern string Script_Start (script_t script, string file, string data);
@extern integer Script_TokenAvailable (script_t script, integer crossline); @extern int Script_TokenAvailable (script_t script, int crossline);
@extern integer Script_GetToken (script_t script, integer crossline); @extern int Script_GetToken (script_t script, int crossline);
@extern void Script_UngetToken (script_t script); @extern void Script_UngetToken (script_t script);
@extern string Script_Error (script_t script); @extern string Script_Error (script_t script);
@extern integer Script_NoQuoteLines (script_t script); @extern int Script_NoQuoteLines (script_t script);
#endif//__ruamoko_script_h #endif//__ruamoko_script_h

View File

@ -7,8 +7,8 @@
@extern float strlen (string s); @extern float strlen (string s);
@extern float charcount (string goal, string s); @extern float charcount (string goal, string s);
@extern string sprintf (string fmt, ...); @extern string sprintf (string fmt, ...);
@extern string itos (integer i); @extern string itos (int i);
@extern integer stoi (string s); @extern int stoi (string s);
@extern vector stov (string s); @extern vector stov (string s);
@extern string str_new (void); @extern string str_new (void);
@ -16,8 +16,8 @@
@extern string str_copy (string dst, string src); @extern string str_copy (string dst, string src);
@extern string str_cat (string dst, string src); @extern string str_cat (string dst, string src);
@extern string str_clear (string str); @extern string str_clear (string str);
@extern @overload string str_mid (string str, integer start); @extern @overload string str_mid (string str, int start);
@extern @overload string str_mid (string str, integer start, integer len); @extern @overload string str_mid (string str, int start, int len);
@extern string str_str (string haystack, string needle); @extern string str_str (string haystack, string needle);
#endif//__ruamoko_string_h #endif//__ruamoko_string_h

View File

@ -41,7 +41,7 @@
+ (id) arrayWithObjects: (id)firstObj, ... + (id) arrayWithObjects: (id)firstObj, ...
{ {
local integer i; local int i;
id newArray = [self arrayWithObject: firstObj]; id newArray = [self arrayWithObject: firstObj];
for (i = 0; i < @args.count; i++) { for (i = 0; i < @args.count; i++) {
@ -52,7 +52,7 @@
+ (id) arrayWithObjects: (id *) objs count: (unsigned)cnt + (id) arrayWithObjects: (id *) objs count: (unsigned)cnt
{ {
local integer i; local int i;
id newArray = [self array]; id newArray = [self array];
for (i = 0; i < cnt; i++) { for (i = 0; i < cnt; i++) {
@ -124,7 +124,7 @@
- (id) initWithObjects: (id)firstObj, ... - (id) initWithObjects: (id)firstObj, ...
{ {
local integer i; local int i;
if (!(self = [self initWithCapacity: @args.count + 1])) if (!(self = [self initWithCapacity: @args.count + 1]))
return nil; return nil;
@ -138,7 +138,7 @@
- (id) initWithObjects: (id *) objs count: (unsigned)cnt - (id) initWithObjects: (id *) objs count: (unsigned)cnt
{ {
local integer i; local int i;
if (!(self = [self initWithCapacity: cnt])) if (!(self = [self initWithCapacity: cnt]))
return nil; return nil;
@ -355,7 +355,7 @@
- (void) removeObjectAtIndex: (unsigned)index - (void) removeObjectAtIndex: (unsigned)index
{ {
local integer i; local int i;
local id temp; local id temp;
if (index >= count) // FIXME: need exceptions if (index >= count) // FIXME: need exceptions
@ -393,7 +393,7 @@
- (void) makeObjectsPerformSelector: (SEL)selector - (void) makeObjectsPerformSelector: (SEL)selector
{ {
local integer i; local int i;
for (i = 0; i < [self count]; i++) { for (i = 0; i < [self count]; i++) {
[[self objectAtIndex: i] performSelector: selector]; [[self objectAtIndex: i] performSelector: selector];
@ -403,7 +403,7 @@
- (void) makeObjectsPerformSelector: (SEL)selector - (void) makeObjectsPerformSelector: (SEL)selector
withObject: (id)anObject withObject: (id)anObject
{ {
local integer i; local int i;
for (i = 0; i < [self count]; i++) { for (i = 0; i < [self count]; i++) {
[[self objectAtIndex: i] performSelector: selector withObject: anObject]; [[self objectAtIndex: i] performSelector: selector withObject: anObject];

View File

@ -8,7 +8,7 @@
typedef void () void_function; typedef void () void_function;
integer PR_SetField (entity ent, string field, string value) = #0; int PR_SetField (entity ent, string field, string value) = #0;
function PR_FindFunction (string func) = #0; function PR_FindFunction (string func) = #0;
@static void ParseEntities (string ent_data); @static void ParseEntities (string ent_data);
@ -63,7 +63,7 @@ function PR_FindFunction (string func) = #0;
local string classname; local string classname;
local id class; local id class;
local entity ent; local entity ent;
local integer count; local int count;
local string field, value; local string field, value;
local plitem_t keys; local plitem_t keys;
local function func; local function func;
@ -106,7 +106,7 @@ function PR_FindFunction (string func) = #0;
local script_t script; local script_t script;
local plitem_t plist, ent, key, value; local plitem_t plist, ent, key, value;
local string token; local string token;
local integer anglehack, i, count; local int anglehack, i, count;
script = Script_New (); script = Script_New ();
token = Script_Start (script, "ent data", ent_data); token = Script_Start (script, "ent data", ent_data);

View File

@ -29,7 +29,7 @@ typedef struct list_bucket_s list_bucket_t;
[super dealloc]; [super dealloc];
} }
- (id) getItemAt: (integer) index - (id) getItemAt: (int) index
{ {
local list_bucket_t *e; local list_bucket_t *e;
if (index < 0 || index >= count) if (index < 0 || index >= count)
@ -130,7 +130,7 @@ typedef struct list_bucket_s list_bucket_t;
return obj; return obj;
} }
- (integer) count - (int) count
{ {
return count; return count;
} }

View File

@ -2,19 +2,19 @@
#include "AutoreleasePool.h" #include "AutoreleasePool.h"
void __obj_exec_class (obj_module_t *msg) = #0; void __obj_exec_class (obj_module_t *msg) = #0;
void (id object, integer code, string fmt, ...) obj_error = #0; void (id object, int code, string fmt, ...) obj_error = #0;
void (id object, integer code, string fmt, @va_list args) obj_verror = #0; void (id object, int code, string fmt, @va_list args) obj_verror = #0;
//obj_error_handler (objc_error_handler func) obj_set_error_handler = #0; //obj_error_handler (objc_error_handler func) obj_set_error_handler = #0;
IMP (id receiver, SEL op) obj_msg_lookup = #0; IMP (id receiver, SEL op) obj_msg_lookup = #0;
IMP (Super class, SEL op) obj_msg_lookup_super = #0; IMP (Super class, SEL op) obj_msg_lookup_super = #0;
id (id receiver, SEL op, ...) obj_msgSend = #0; id (id receiver, SEL op, ...) obj_msgSend = #0;
id obj_msgSend_super (Super *class, SEL op, ...) = #0; id obj_msgSend_super (Super *class, SEL op, ...) = #0;
@param (id receiver, SEL op, @va_list args) obj_msg_sendv = #0; @param (id receiver, SEL op, @va_list args) obj_msg_sendv = #0;
void *obj_malloc (integer size) = #0; void *obj_malloc (int size) = #0;
void *obj_atomic_malloc (integer size) = #0; void *obj_atomic_malloc (int size) = #0;
void *obj_valloc (integer size) = #0; void *obj_valloc (int size) = #0;
void *obj_realloc (void *mem, integer size) = #0; void *obj_realloc (void *mem, int size) = #0;
void *obj_calloc (integer nelem, integer size) = #0; void *obj_calloc (int nelem, int size) = #0;
void obj_free (void *mem) = #0; void obj_free (void *mem) = #0;
//(void *) (void) obj_get_uninstalled_dtable = #0; //(void *) (void) obj_get_uninstalled_dtable = #0;
@ -37,13 +37,13 @@ Method *class_get_instance_method (Class class, SEL aSel) = #0;
Class (Class imposter, Class superclass) class_pose_as = #0; Class (Class imposter, Class superclass) class_pose_as = #0;
id (Class class) class_create_instance = #0; id (Class class) class_create_instance = #0;
string (Class class) class_get_class_name = #0; string (Class class) class_get_class_name = #0;
integer (Class class) class_get_instance_size = #0; int (Class class) class_get_instance_size = #0;
Class (Class class) class_get_meta_class = #0; Class (Class class) class_get_meta_class = #0;
Class (Class class) class_get_super_class = #0; Class (Class class) class_get_super_class = #0;
integer (Class class) class_get_version = #0; int (Class class) class_get_version = #0;
BOOL (Class class) class_is_class = #0; BOOL (Class class) class_is_class = #0;
BOOL (Class class) class_is_meta_class = #0; BOOL (Class class) class_is_meta_class = #0;
void (Class class, integer version) class_set_version = #0; void (Class class, int version) class_set_version = #0;
void *class_get_gc_object_type (Class class) = #0; void *class_get_gc_object_type (Class class) = #0;
void (Class class, string ivarname, BOOL gcInvisible) class_ivar_set_gcinvisible = #0; void (Class class, string ivarname, BOOL gcInvisible) class_ivar_set_gcinvisible = #0;
@ -179,7 +179,7 @@ BOOL (id object) object_is_meta_class = #0;
return self; return self;
} }
- (unsigned) hash = #0; // can't cast pointer to integer - (unsigned) hash = #0; // can't cast pointer to int
- (BOOL) isEqual: (id)anObject - (BOOL) isEqual: (id)anObject
{ {

View File

@ -12,7 +12,7 @@
return [PLArray new]; return [PLArray new];
} }
+ (PLItem *) newData:(void*) data size:(integer) len + (PLItem *) newData:(void*) data size:(int) len
{ {
return [PLData new:data size:len]; return [PLData new:data size:len];
} }
@ -104,12 +104,12 @@
return [[PLDictionary alloc] initWithOwnItem: PL_NewDictionary ()]; return [[PLDictionary alloc] initWithOwnItem: PL_NewDictionary ()];
} }
- (integer) count - (int) count
{ {
return PL_D_NumKeys (item); return PL_D_NumKeys (item);
} }
- (integer) numKeys - (int) numKeys
{ {
return PL_D_NumKeys (item); return PL_D_NumKeys (item);
} }
@ -145,17 +145,17 @@
return [[PLArray alloc] initWithOwnItem: PL_NewArray ()]; return [[PLArray alloc] initWithOwnItem: PL_NewArray ()];
} }
- (integer) count - (int) count
{ {
return PL_A_NumObjects (item); return PL_A_NumObjects (item);
} }
- (integer) numObjects - (int) numObjects
{ {
return PL_A_NumObjects (item); return PL_A_NumObjects (item);
} }
- (PLItem *) getObjectAtIndex:(integer) index - (PLItem *) getObjectAtIndex:(int) index
{ {
return [[PLItem itemClass: PL_ObjectAtIndex (item, index)] autorelease]; return [[PLItem itemClass: PL_ObjectAtIndex (item, index)] autorelease];
} }
@ -172,7 +172,7 @@
return self; return self;
} }
- insertObject:(PLItem *) object atIndex:(integer) index - insertObject:(PLItem *) object atIndex:(int) index
{ {
if (!object.own) { if (!object.own) {
obj_error (self, 0, "add of unowned object to PLArray"); obj_error (self, 0, "add of unowned object to PLArray");
@ -188,7 +188,7 @@
@implementation PLData @implementation PLData
+ (PLData *) new:(void*) data size:(integer) len + (PLData *) new:(void*) data size:(int) len
{ {
return [[PLData alloc] initWithOwnItem: PL_NewData (data, len)]; return [[PLData alloc] initWithOwnItem: PL_NewData (data, len)];
} }

View File

@ -2,12 +2,12 @@
struct obj_protocol_list { struct obj_protocol_list {
struct obj_protocol_list *next; struct obj_protocol_list *next;
integer count; int count;
Protocol *list[1]; Protocol *list[1];
}; };
struct obj_method_description_list { struct obj_method_description_list {
integer count; int count;
struct obj_method_description list[1]; struct obj_method_description list[1];
}; };
@ -19,7 +19,7 @@ struct obj_method_description_list {
- (BOOL) conformsTo: (Protocol *)aProtocolObject - (BOOL) conformsTo: (Protocol *)aProtocolObject
{ {
local integer i; local int i;
local struct obj_protocol_list *proto_list; local struct obj_protocol_list *proto_list;
if (aProtocolObject.protocol_name == protocol_name) if (aProtocolObject.protocol_name == protocol_name)
@ -37,7 +37,7 @@ struct obj_method_description_list {
- (struct obj_method_description *) descriptionForInstanceMethod: (SEL)aSel - (struct obj_method_description *) descriptionForInstanceMethod: (SEL)aSel
{ {
local integer i; local int i;
local struct obj_protocol_list *proto_list; local struct obj_protocol_list *proto_list;
local string name = sel_get_name (aSel); local string name = sel_get_name (aSel);
local struct obj_method_description *result; local struct obj_method_description *result;
@ -60,7 +60,7 @@ struct obj_method_description_list {
- (struct obj_method_description *) descriptionForClassMethod: (SEL)aSel - (struct obj_method_description *) descriptionForClassMethod: (SEL)aSel
{ {
local integer i; local int i;
local struct obj_protocol_list *proto_list; local struct obj_protocol_list *proto_list;
local string name = sel_get_name (aSel); local string name = sel_get_name (aSel);
local struct obj_method_description *result; local struct obj_method_description *result;

View File

@ -71,7 +71,7 @@
return [top object]; return [top object];
} }
- (integer) count - (int) count
{ {
return stackSize; return stackSize;
} }

View File

@ -1,6 +1,6 @@
#include "cmd.h" #include "cmd.h"
void (string name, void () func) Cmd_AddCommand = #0; void (string name, void () func) Cmd_AddCommand = #0;
integer () Cmd_Argc = #0; int () Cmd_Argc = #0;
string (integer arg) Cmd_Argv = #0; string (int arg) Cmd_Argv = #0;
string (integer arg) Cmd_Args = #0; string (int arg) Cmd_Args = #0;

View File

@ -2,10 +2,10 @@
void (string varname, string value) Cvar_SetString = #0; void (string varname, string value) Cvar_SetString = #0;
void (string varname, float value) Cvar_SetFloat = #0; void (string varname, float value) Cvar_SetFloat = #0;
void (string varname, integer value) Cvar_SetInteger = #0; void (string varname, int value) Cvar_SetInteger = #0;
void (string varname, vector value) Cvar_SetVector = #0; void (string varname, vector value) Cvar_SetVector = #0;
string (string varname) Cvar_GetString = #0; string (string varname) Cvar_GetString = #0;
float (string varname) Cvar_GetFloat = #0; float (string varname) Cvar_GetFloat = #0;
integer (string varname) Cvar_GetInteger = #0; int (string varname) Cvar_GetInteger = #0;
vector (string varname) Cvar_GetVector = #0; vector (string varname) Cvar_GetVector = #0;
void (string varname) Cvar_Toggle = #0; void (string varname) Cvar_Toggle = #0;

View File

@ -1,21 +1,21 @@
#include "draw.h" #include "draw.h"
qpic_t (string name, integer alpha) Draw_CachePic = #0; qpic_t (string name, int alpha) Draw_CachePic = #0;
void (integer x, integer y, qpic_t pic) Draw_Pic = #0; void (int x, int y, qpic_t pic) Draw_Pic = #0;
void (integer x, integer y, qpic_t pic, integer srcx, integer srcy, integer width, integer height) Draw_SubPic = #0; void (int x, int y, qpic_t pic, int srcx, int srcy, int width, int height) Draw_SubPic = #0;
void (integer x, integer y, qpic_t pic) Draw_CenterPic = #0; void (int x, int y, qpic_t pic) Draw_CenterPic = #0;
void (integer x, integer y, integer chr) Draw_Character = #0; void (int x, int y, int chr) Draw_Character = #0;
void (integer x, integer y, string text) Draw_String = #0; void (int x, int y, string text) Draw_String = #0;
void (integer x, integer y, string text, integer n) Draw_nString = #0; void (int x, int y, string text, int n) Draw_nString = #0;
void (integer x, integer y, string text) Draw_AltString = #0; void (int x, int y, string text) Draw_AltString = #0;
void (integer x, integer y, integer w, integer h, integer c) Draw_Fill = #0; void (int x, int y, int w, int h, int c) Draw_Fill = #0;
void (integer ch, integer x, integer y) Draw_Crosshair = #0; void (int ch, int x, int y) Draw_Crosshair = #0;
void (integer x, integer y, integer width, integer lines) text_box = void (int x, int y, int width, int lines) text_box =
{ {
local integer cx, cy, n; local int cx, cy, n;
local qpic_t p; local qpic_t p;
cx = x; cx = x;
@ -77,26 +77,26 @@ void (integer x, integer y, integer width, integer lines) text_box =
return [self initName:n Centered:NO]; return [self initName:n Centered:NO];
} }
-draw:(integer)x :(integer)y -draw:(int)x :(int)y
{ {
local qpic_t pic = Draw_CachePic (name, 1); local qpic_t pic = Draw_CachePic (name, 1);
Draw_Pic (x, y, pic); Draw_Pic (x, y, pic);
return self; return self;
} }
-draw:(integer)x :(integer)y :(integer)srcx :(integer)srcy :(integer)width :(integer)height -draw:(int)x :(int)y :(int)srcx :(int)srcy :(int)width :(int)height
{ {
local qpic_t pic = Draw_CachePic (name, 1); local qpic_t pic = Draw_CachePic (name, 1);
Draw_SubPic (x, y, pic, srcx, srcy, width, height); Draw_SubPic (x, y, pic, srcx, srcy, width, height);
return self; return self;
} }
-(integer)width -(int)width
{ {
return size.width; return size.width;
} }
-(integer)height -(int)height
{ {
return size.height; return size.height;
} }

View File

@ -1,4 +1,4 @@
#include "gib.h" #include "gib.h"
void GIB_Builtin_Add (string name, void func (integer argc, string *argv)) = #0; void GIB_Builtin_Add (string name, void func (int argc, string *argv)) = #0;
integer (string value) GIB_Return = #0; int (string value) GIB_Return = #0;

View File

@ -1,11 +1,11 @@
#include "hash.h" #include "hash.h"
hashtab_t Hash_NewTable (integer size, string gk (void *ele, void *data), void f (void *ele, void *data), void *ud) = #0; hashtab_t Hash_NewTable (int size, string gk (void *ele, void *data), void f (void *ele, void *data), void *ud) = #0;
void Hash_SetHashCompare (hashtab_t tab, unsigned gh (void *ele, void *data), integer cmp (void *ele1, void *ele2, void *data)) = #0; void Hash_SetHashCompare (hashtab_t tab, unsigned gh (void *ele, void *data), int cmp (void *ele1, void *ele2, void *data)) = #0;
void Hash_DelTable (hashtab_t tab) = #0; void Hash_DelTable (hashtab_t tab) = #0;
void Hash_FlushTable (hashtab_t tab) = #0; void Hash_FlushTable (hashtab_t tab) = #0;
integer Hash_Add (hashtab_t tab, void *ele) = #0; int Hash_Add (hashtab_t tab, void *ele) = #0;
integer Hash_AddElement (hashtab_t tab, void *ele) = #0; int Hash_AddElement (hashtab_t tab, void *ele) = #0;
void *Hash_Find (hashtab_t tab, string key) = #0; void *Hash_Find (hashtab_t tab, string key) = #0;
void *Hash_FindElement (hashtab_t tab, void *ele) = #0; void *Hash_FindElement (hashtab_t tab, void *ele) = #0;
void **Hash_FindList (hashtab_t tab, string key) = #0; void **Hash_FindList (hashtab_t tab, string key) = #0;
@ -13,7 +13,7 @@ void **Hash_FindElementList (hashtab_t tab, void *ele) = #0;
void *Hash_Del (hashtab_t tab, string key) = #0; void *Hash_Del (hashtab_t tab, string key) = #0;
void *Hash_DelElement (hashtab_t tab, void *ele) = #0; void *Hash_DelElement (hashtab_t tab, void *ele) = #0;
void Hash_Free (hashtab_t tab, void *ele) = #0; void Hash_Free (hashtab_t tab, void *ele) = #0;
integer Hash_String (string str) = #0; int Hash_String (string str) = #0;
integer Hash_Buffer (void *buf, integer len) = #0; int Hash_Buffer (void *buf, int len) = #0;
void **Hash_GetList (hashtab_t tab) = #0; void **Hash_GetList (hashtab_t tab) = #0;
void Hash_Stats (hashtab_t tab) = #0; void Hash_Stats (hashtab_t tab) = #0;

View File

@ -1,6 +1,6 @@
#include "key.h" #include "key.h"
string (integer target, integer keynum, string binding) Key_SetBinding = #0; string (int target, int keynum, string binding) Key_SetBinding = #0;
integer (integer target, integer bindnum, string binding) Key_LookupBinding = #0; int (int target, int bindnum, string binding) Key_LookupBinding = #0;
integer (integer target, string binding) Key_CountBinding = #0; int (int target, string binding) Key_CountBinding = #0;
string (integer keynum) Key_KeynumToString = #0; string (int keynum) Key_KeynumToString = #0;

View File

@ -3,8 +3,8 @@
vector v_forward, v_up, v_right; vector v_forward, v_up, v_right;
float () random = #7; float () random = #7;
integer (float f) ftoi = #0x000f0000 + 110; int (float f) ftoi = #0x000f0000 + 110;
float (integer i) itof = #0x000f0000 + 111; float (int i) itof = #0x000f0000 + 111;
vector (vector v) normalize = #9; vector (vector v) normalize = #9;
float (vector v) vlen = #12; float (vector v) vlen = #12;
float (vector v) vectoyaw = #13; float (vector v) vectoyaw = #13;

View File

@ -22,8 +22,8 @@ float (vector v) pointcontents = #41;
vector (entity e, float speed) aim = #44; vector (entity e, float speed) aim = #44;
void () ChangeYaw = #49; void () ChangeYaw = #49;
void (float step) movetogoal = #67; void (float step) movetogoal = #67;
integer (entity ent, vector point) hullpointcontents = #0x000f0000 + 93; int (entity ent, vector point) hullpointcontents = #0x000f0000 + 93;
vector (integer hull, integer max) getboxbounds = #0x000f0000 + 94; vector (int hull, int max) getboxbounds = #0x000f0000 + 94;
integer () getboxhull = #0x000f0000 + 95; int () getboxhull = #0x000f0000 + 95;
void (integer hull) freeboxhull = #0x000f0000 + 96; void (int hull) freeboxhull = #0x000f0000 + 96;
void (integer hull, vector right, vector forward, vector up, vector mins, vector maxs) rotate_bbox = #0x000f0000 + 97; void (int hull, vector right, vector forward, vector up, vector mins, vector maxs) rotate_bbox = #0x000f0000 + 97;

View File

@ -7,16 +7,16 @@ pltype_t PL_Type (plitem_t str) = #0;
string PL_String (plitem_t str) = #0; string PL_String (plitem_t str) = #0;
plitem_t PL_ObjectForKey (plitem_t item, string key) = #0; plitem_t PL_ObjectForKey (plitem_t item, string key) = #0;
plitem_t PL_RemoveObjectForKey (plitem_t item, string key) = #0; plitem_t PL_RemoveObjectForKey (plitem_t item, string key) = #0;
plitem_t PL_ObjectAtIndex (plitem_t item, integer index) = #0; plitem_t PL_ObjectAtIndex (plitem_t item, int index) = #0;
plitem_t PL_D_AllKeys (plitem_t item) = #0; plitem_t PL_D_AllKeys (plitem_t item) = #0;
integer PL_D_NumKeys (plitem_t item) = #0; int PL_D_NumKeys (plitem_t item) = #0;
integer PL_D_AddObject (plitem_t dict, string key, plitem_t value) = #0; int PL_D_AddObject (plitem_t dict, string key, plitem_t value) = #0;
integer PL_A_AddObject (plitem_t array_item, plitem_t item) = #0; int PL_A_AddObject (plitem_t array_item, plitem_t item) = #0;
integer PL_A_NumObjects (plitem_t item) = #0; int PL_A_NumObjects (plitem_t item) = #0;
integer PL_A_InsertObjectAtIndex (plitem_t array_item, plitem_t item, integer index) = #0; int PL_A_InsertObjectAtIndex (plitem_t array_item, plitem_t item, int index) = #0;
plitem_t PL_RemoveObjectAtIndex (plitem_t array_item, integer index) = #0; plitem_t PL_RemoveObjectAtIndex (plitem_t array_item, int index) = #0;
plitem_t PL_NewDictionary (void) = #0; plitem_t PL_NewDictionary (void) = #0;
plitem_t PL_NewArray (void) = #0; plitem_t PL_NewArray (void) = #0;
plitem_t PL_NewData (void *data, integer len) = #0; plitem_t PL_NewData (void *data, int len) = #0;
plitem_t PL_NewString (string str) = #0; plitem_t PL_NewString (string str) = #0;
void PL_Free (plitem_t pl) = #0; void PL_Free (plitem_t pl) = #0;

View File

@ -1,19 +1,19 @@
#include "qfile.h" #include "qfile.h"
integer Qrename (string old, string new) = #0; int Qrename (string old, string new) = #0;
integer Qremove (string path) = #0; int Qremove (string path) = #0;
QFile Qopen (string path, string mode) = #0; QFile Qopen (string path, string mode) = #0;
void Qclose (QFile file) = #0; void Qclose (QFile file) = #0;
string Qgetline (QFile file) = #0; string Qgetline (QFile file) = #0;
string Qreadstring (QFile file, integer length) = #0; string Qreadstring (QFile file, int length) = #0;
integer Qread (QFile file, void *buf, integer count) = #0; int Qread (QFile file, void *buf, int count) = #0;
integer Qwrite (QFile file, void *buf, integer count) = #0; int Qwrite (QFile file, void *buf, int count) = #0;
integer Qputs (QFile file, string str) = #0; int Qputs (QFile file, string str) = #0;
//integer Qgets (QFile file, void *buf, integer count) = #0; //int Qgets (QFile file, void *buf, int count) = #0;
integer Qgetc (QFile file) = #0; int Qgetc (QFile file) = #0;
integer Qputc (QFile file, integer c) = #0; int Qputc (QFile file, int c) = #0;
integer Qseek (QFile file, integer offset, integer whence) = #0; int Qseek (QFile file, int offset, int whence) = #0;
integer Qtell (QFile file) = #0; int Qtell (QFile file) = #0;
integer Qflush (QFile file) = #0; int Qflush (QFile file) = #0;
integer Qeof (QFile file) = #0; int Qeof (QFile file) = #0;
integer Qfilesize (QFile file) = #0; int Qfilesize (QFile file) = #0;

View File

@ -1,10 +1,10 @@
#include "qfs.h" #include "qfs.h"
QFile QFS_Open (string path, string mode) = #0; QFile QFS_Open (string path, string mode) = #0;
QFile QFS_WOpen (string path, integer zip) = #0; QFile QFS_WOpen (string path, int zip) = #0;
integer QFS_Rename (string old, string new) = #0; int QFS_Rename (string old, string new) = #0;
void *QFS_LoadFile (string filename) = #0; void *QFS_LoadFile (string filename) = #0;
QFile QFS_OpenFile (string filename) = #0; QFile QFS_OpenFile (string filename) = #0;
integer QFS_WriteFile (string filename, void *buf, integer count) = #0; int QFS_WriteFile (string filename, void *buf, int count) = #0;
QFSlist QFS_Filelist (string path, string ext, integer strip) = #0; QFSlist QFS_Filelist (string path, string ext, int strip) = #0;
void QFS_FilelistFree (QFSlist list) = #0; void QFS_FilelistFree (QFSlist list) = #0;

View File

@ -4,8 +4,8 @@ script_t Script_New (void) = #0;
void Script_Delete (script_t script) = #0; void Script_Delete (script_t script) = #0;
// returns the token string // returns the token string
string Script_Start (script_t script, string file, string data) = #0; string Script_Start (script_t script, string file, string data) = #0;
integer Script_TokenAvailable (script_t script, integer crossline) = #0; int Script_TokenAvailable (script_t script, int crossline) = #0;
integer Script_GetToken (script_t script, integer crossline) = #0; int Script_GetToken (script_t script, int crossline) = #0;
void Script_UngetToken (script_t script) = #0; void Script_UngetToken (script_t script) = #0;
string Script_Error (script_t script) = #0; string Script_Error (script_t script) = #0;
integer Script_NoQuoteLines (script_t script) = #0; int Script_NoQuoteLines (script_t script) = #0;

View File

@ -6,8 +6,8 @@ float (string s) stof = #81;
float (string s) strlen = #0x000f0000 + 100; float (string s) strlen = #0x000f0000 + 100;
float (string goal, string s) charcount = #0x000f0000 + 101; float (string goal, string s) charcount = #0x000f0000 + 101;
string (string fmt, ...) sprintf = #0x000f0000 + 109; string (string fmt, ...) sprintf = #0x000f0000 + 109;
string (integer i) itos = #0x000f0000 + 112; string (int i) itos = #0x000f0000 + 112;
integer (string s) stoi = #0x000f0000 + 113; int (string s) stoi = #0x000f0000 + 113;
vector (string s) stov = #0x000f0000 + 114; vector (string s) stov = #0x000f0000 + 114;
string (void) str_new = #0; string (void) str_new = #0;
@ -15,6 +15,6 @@ string (string str) str_free = #0;
string (string dst, string src) str_copy = #0; string (string dst, string src) str_copy = #0;
string (string dst, string src) str_cat = #0; string (string dst, string src) str_cat = #0;
string (string str) str_clear = #0; string (string str) str_clear = #0;
string (string str, integer start) str_mid = #0; string (string str, int start) str_mid = #0;
string (string str, integer start, integer len) str_mid = #0; string (string str, int start, int len) str_mid = #0;
string (string haystack, string needle) str_str = #0; string (string haystack, string needle) str_str = #0;

View File

@ -7,7 +7,7 @@
#include "SchemeString.h" #include "SchemeString.h"
struct lineinfo_s { struct lineinfo_s {
integer linenumber; int linenumber;
String *sourcefile; String *sourcefile;
}; };
@ -20,16 +20,16 @@ typedef struct lineinfo_s lineinfo_t;
Array *constants; Array *constants;
instruction_t *code; instruction_t *code;
lineinfo_t *lineinfo; lineinfo_t *lineinfo;
integer minargs, size; int minargs, size;
} }
- (void) addInstruction: (Instruction *) inst; - (void) addInstruction: (Instruction *) inst;
- (integer) addConstant: (SchemeObject *) c; - (int) addConstant: (SchemeObject *) c;
- (void) compile; - (void) compile;
- (instruction_t *) code; - (instruction_t *) code;
- (lineinfo_t *) lineinfo; - (lineinfo_t *) lineinfo;
- (Frame *) literals; - (Frame *) literals;
- (integer) minimumArguments; - (int) minimumArguments;
- (void) minimumArguments: (integer) min; - (void) minimumArguments: (int) min;
@end @end

View File

@ -32,16 +32,16 @@
} }
} }
- (integer) addConstant: (SchemeObject *) c - (int) addConstant: (SchemeObject *) c
{ {
local integer number = [constants count]; local int number = [constants count];
[constants addObject: c]; [constants addObject: c];
return number; return number;
} }
- (void) compile - (void) compile
{ {
local integer index; local int index;
local Instruction *inst; local Instruction *inst;
literals = [Frame newWithSize: [constants count] link: nil]; literals = [Frame newWithSize: [constants count] link: nil];
code = obj_malloc (@sizeof(instruction_t) * [instructions count]); code = obj_malloc (@sizeof(instruction_t) * [instructions count]);
@ -97,7 +97,7 @@
} }
if (lineinfo) { if (lineinfo) {
local integer i; local int i;
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
[lineinfo[i].sourcefile release]; [lineinfo[i].sourcefile release];
} }
@ -106,12 +106,12 @@
[super dealloc]; [super dealloc];
} }
- (integer) minimumArguments - (int) minimumArguments
{ {
return minargs; return minargs;
} }
- (void) minimumArguments: (integer) min - (void) minimumArguments: (int) min
{ {
minargs = min; minargs = min;
} }

View File

@ -20,10 +20,10 @@
- (id) initWithLambda: (SchemeObject *) xp scope: (Scope *) sc; - (id) initWithLambda: (SchemeObject *) xp scope: (Scope *) sc;
- (SchemeObject*) compile; - (SchemeObject*) compile;
- (void) emitExpression: (SchemeObject *) expression flags: (integer) fl; - (void) emitExpression: (SchemeObject *) expression flags: (int) fl;
- (void) emitLambda: (SchemeObject *) expression; - (void) emitLambda: (SchemeObject *) expression;
- (void) emitConstant: (SchemeObject *) expression; - (void) emitConstant: (SchemeObject *) expression;
- (void) emitApply: (SchemeObject *) expression flags: (integer) fl; - (void) emitApply: (SchemeObject *) expression flags: (int) fl;
@end @end
#endif //__Compiler_h #endif //__Compiler_h

View File

@ -47,7 +47,7 @@ Symbol *beginSym;
- (void) emitBuildEnvironment: (SchemeObject *) arguments - (void) emitBuildEnvironment: (SchemeObject *) arguments
{ {
local integer count, index; local int count, index;
local SchemeObject *cur; local SchemeObject *cur;
scope = [Scope newWithOuter: scope]; scope = [Scope newWithOuter: scope];
@ -81,7 +81,7 @@ Symbol *beginSym;
} }
} }
- (void) emitSequence: (SchemeObject*) expressions flags: (integer) fl - (void) emitSequence: (SchemeObject*) expressions flags: (int) fl
{ {
local SchemeObject *cur; local SchemeObject *cur;
@ -97,8 +97,8 @@ Symbol *beginSym;
- (void) emitVariable: (Symbol*) sym - (void) emitVariable: (Symbol*) sym
{ {
local integer depth = [scope depthOf: sym]; local int depth = [scope depthOf: sym];
local integer index = [scope indexOf: sym]; local int index = [scope indexOf: sym];
[code addInstruction: [Instruction opcode: LOADENV]]; [code addInstruction: [Instruction opcode: LOADENV]];
if (depth != -1) { if (depth != -1) {
@ -116,7 +116,7 @@ Symbol *beginSym;
- (void) emitDefine: (SchemeObject*) expression - (void) emitDefine: (SchemeObject*) expression
{ {
local integer index = 0; local int index = 0;
if (![expression isKindOfClass: [Cons class]] || if (![expression isKindOfClass: [Cons class]] ||
![[(Cons*) expression cdr] isKindOfClass: [Cons class]]) { ![[(Cons*) expression cdr] isKindOfClass: [Cons class]]) {
@ -148,10 +148,10 @@ Symbol *beginSym;
[code addInstruction: [Instruction opcode: SETGLOBAL]]; [code addInstruction: [Instruction opcode: SETGLOBAL]];
} }
- (void) emitIf: (SchemeObject*) expression flags: (integer) fl - (void) emitIf: (SchemeObject*) expression flags: (int) fl
{ {
local Instruction *falseLabel, *endLabel; local Instruction *falseLabel, *endLabel;
local integer index; local int index;
if (![expression isKindOfClass: [Cons class]] || if (![expression isKindOfClass: [Cons class]] ||
![[(Cons*) expression cdr] isKindOfClass: [Cons class]]) { ![[(Cons*) expression cdr] isKindOfClass: [Cons class]]) {
err = [Error type: "syntax" err = [Error type: "syntax"
@ -184,10 +184,10 @@ Symbol *beginSym;
- (void) emitLetrec: (SchemeObject*) expression flags: (integer) fl - (void) emitLetrec: (SchemeObject*) expression flags: (int) fl
{ {
local SchemeObject *bindings; local SchemeObject *bindings;
local integer count; local int count;
if (!isList(expression) || if (!isList(expression) ||
!isList([(Cons*) expression car]) || !isList([(Cons*) expression car]) ||
@ -223,7 +223,7 @@ Symbol *beginSym;
scope = [scope outer]; scope = [scope outer];
} }
- (void) emitExpression: (SchemeObject*) expression flags: (integer) fl - (void) emitExpression: (SchemeObject*) expression flags: (int) fl
{ {
if ([expression isKindOfClass: [Cons class]]) { if ([expression isKindOfClass: [Cons class]]) {
[code source: [expression source]]; [code source: [expression source]];
@ -264,7 +264,7 @@ Symbol *beginSym;
} }
} }
- (void) emitApply: (SchemeObject*) expression flags: (integer) fl - (void) emitApply: (SchemeObject*) expression flags: (int) fl
{ {
local Instruction *label = [Instruction opcode: LABEL]; local Instruction *label = [Instruction opcode: LABEL];
if (!(fl & TAIL)) { if (!(fl & TAIL)) {
@ -283,7 +283,7 @@ Symbol *beginSym;
local Compiler *compiler = [Compiler newWithLambda: expression local Compiler *compiler = [Compiler newWithLambda: expression
scope: scope]; scope: scope];
local SchemeObject *res; local SchemeObject *res;
local integer index; local int index;
res = [compiler compile]; res = [compiler compile];
if ([res isError]) { if ([res isError]) {
@ -298,7 +298,7 @@ Symbol *beginSym;
- (void) emitConstant: (SchemeObject*) expression - (void) emitConstant: (SchemeObject*) expression
{ {
local integer index; local int index;
index = [code addConstant: expression]; index = [code addConstant: expression];
[code addInstruction: [Instruction opcode: LOADLITS]]; [code addInstruction: [Instruction opcode: LOADLITS]];
[code addInstruction: [Instruction opcode: GET operand: index]]; [code addInstruction: [Instruction opcode: GET operand: index]];

View File

@ -16,6 +16,6 @@
@extern Cons *cons (SchemeObject *car, SchemeObject *cdr); @extern Cons *cons (SchemeObject *car, SchemeObject *cdr);
@extern BOOL isList (SchemeObject *ls); @extern BOOL isList (SchemeObject *ls);
@extern integer length (SchemeObject *foo); @extern int length (SchemeObject *foo);
#endif //__Cons_h #endif //__Cons_h

View File

@ -9,9 +9,9 @@ Cons *cons (SchemeObject *car, SchemeObject *cdr)
return [Cons newWithCar: car cdr: cdr]; return [Cons newWithCar: car cdr: cdr];
} }
integer length (SchemeObject *foo) int length (SchemeObject *foo)
{ {
local integer len; local int len;
for (len = 0; [foo isKindOfClass: [Cons class]]; foo = [(Cons *) foo cdr]) { for (len = 0; [foo isKindOfClass: [Cons class]]; foo = [(Cons *) foo cdr]) {
len++; len++;

View File

@ -8,8 +8,8 @@
{ {
state_t state; state_t state;
} }
+ (id) newWithState: (state_t *) st pc: (integer) p; + (id) newWithState: (state_t *) st pc: (int) p;
- (id) initWithState: (state_t *) st pc: (integer) p; - (id) initWithState: (state_t *) st pc: (int) p;
- (void) restoreOnMachine: (Machine *) m; - (void) restoreOnMachine: (Machine *) m;
@end @end

View File

@ -4,11 +4,11 @@
#include "defs.h" #include "defs.h"
@implementation Continuation @implementation Continuation
+ (id) newWithState: (state_t *) st pc: (integer) p + (id) newWithState: (state_t *) st pc: (int) p
{ {
return [[self alloc] initWithState: st pc: p]; return [[self alloc] initWithState: st pc: p];
} }
- (id) initWithState: (state_t *) st pc: (integer) p - (id) initWithState: (state_t *) st pc: (int) p
{ {
self = [self init]; self = [self init];
state.program = st.program; state.program = st.program;

View File

@ -5,13 +5,13 @@
@interface Frame: SchemeObject @interface Frame: SchemeObject
{ {
SchemeObject**array; SchemeObject**array;
integer size; int size;
Frame *link; Frame *link;
} }
+ (id) newWithSize: (integer) sz link: (Frame *) l; + (id) newWithSize: (int) sz link: (Frame *) l;
- (id) initWithSize: (integer) sz link: (Frame *) l; - (id) initWithSize: (int) sz link: (Frame *) l;
- (void) set: (integer) index to: (SchemeObject *) o; - (void) set: (int) index to: (SchemeObject *) o;
- (SchemeObject *) get: (integer) index; - (SchemeObject *) get: (int) index;
- (Frame *) getLink; - (Frame *) getLink;
@end @end

View File

@ -1,12 +1,12 @@
#include "Frame.h" #include "Frame.h"
@implementation Frame @implementation Frame
+ (id) newWithSize: (integer) sz link: (Frame *) l + (id) newWithSize: (int) sz link: (Frame *) l
{ {
return [[self alloc] initWithSize: sz link: l]; return [[self alloc] initWithSize: sz link: l];
} }
- (id) initWithSize: (integer) sz link: (Frame *) l - (id) initWithSize: (int) sz link: (Frame *) l
{ {
self = [super init]; self = [super init];
size = sz; size = sz;
@ -15,12 +15,12 @@
return self; return self;
} }
- (void) set: (integer) index to: (SchemeObject *) o - (void) set: (int) index to: (SchemeObject *) o
{ {
array[index] = o; array[index] = o;
} }
- (SchemeObject *) get: (integer) index - (SchemeObject *) get: (int) index
{ {
return array[index]; return array[index];
} }
@ -32,7 +32,7 @@
- (void) markReachable - (void) markReachable
{ {
local integer index; local int index;
for (index = 0; index < size; index++) { for (index = 0; index < size; index++) {
[array[index] mark]; [array[index] mark];
} }

View File

@ -27,7 +27,7 @@ typedef enum {
struct instruction_s { struct instruction_s {
opcode_e opcode; opcode_e opcode;
integer operand; int operand;
}; };
typedef struct instruction_s instruction_t; typedef struct instruction_s instruction_t;
@ -35,15 +35,15 @@ typedef struct instruction_s instruction_t;
@interface Instruction: SchemeObject @interface Instruction: SchemeObject
{ {
opcode_e opcode; opcode_e opcode;
integer operand, offset; int operand, offset;
Instruction *label; Instruction *label;
} }
+ (id) opcode: (opcode_e) oc; + (id) opcode: (opcode_e) oc;
+ (id) opcode: (opcode_e) oc operand: (integer) op; + (id) opcode: (opcode_e) oc operand: (int) op;
+ (id) opcode: (opcode_e) oc label: (Instruction *) l; + (id) opcode: (opcode_e) oc label: (Instruction *) l;
- (id) initWithOpcode: (opcode_e) oc operand: (integer) op label: (Instruction *) l; - (id) initWithOpcode: (opcode_e) oc operand: (int) op label: (Instruction *) l;
- (void) offset: (integer) ofs; - (void) offset: (int) ofs;
- (integer) offset; - (int) offset;
- (opcode_e) opcode; - (opcode_e) opcode;
- (void) emitStruct: (instruction_t *) program; - (void) emitStruct: (instruction_t *) program;

View File

@ -7,7 +7,7 @@
return [[self alloc] initWithOpcode: oc operand: 0 label: nil]; return [[self alloc] initWithOpcode: oc operand: 0 label: nil];
} }
+ (id) opcode: (opcode_e) oc operand: (integer) op + (id) opcode: (opcode_e) oc operand: (int) op
{ {
return [[self alloc] initWithOpcode: oc operand: op label: nil]; return [[self alloc] initWithOpcode: oc operand: op label: nil];
} }
@ -17,7 +17,7 @@
return [[self alloc] initWithOpcode: oc operand: 0 label: l]; return [[self alloc] initWithOpcode: oc operand: 0 label: l];
} }
- (id) initWithOpcode: (opcode_e) oc operand: (integer) op label: (Instruction *) l - (id) initWithOpcode: (opcode_e) oc operand: (int) op label: (Instruction *) l
{ {
self = [super init]; self = [super init];
opcode = oc; opcode = oc;
@ -26,12 +26,12 @@
return self; return self;
} }
- (void) offset: (integer) ofs - (void) offset: (int) ofs
{ {
offset = ofs; offset = ofs;
} }
- (integer) offset - (int) offset
{ {
return offset; return offset;
} }

View File

@ -7,12 +7,12 @@
{ {
string source; string source;
string filename; string filename;
integer linenum; int linenum;
} }
+ (id) newFromSource: (string) s file: (string) f; + (id) newFromSource: (string) s file: (string) f;
- (id) initWithSource: (string) s file: (string) f; - (id) initWithSource: (string) s file: (string) f;
- (SchemeObject *) nextToken; - (SchemeObject *) nextToken;
- (integer) lineNumber; - (int) lineNumber;
@end @end
#endif //__Lexer_h #endif //__Lexer_h

View File

@ -46,7 +46,7 @@ BOOL issymbol (string x)
- (SchemeObject*) nextToken - (SchemeObject*) nextToken
{ {
local integer len; local int len;
local Number *num; local Number *num;
local Symbol *sym; local Symbol *sym;
local String *str; local String *str;
@ -121,12 +121,12 @@ BOOL issymbol (string x)
} }
} }
- (integer) lineNumber - (int) lineNumber
{ {
return linenum; return linenum;
} }
- (integer) line - (int) line
{ {
return linenum; return linenum;
} }

View File

@ -111,8 +111,8 @@ void GlobalFree (void *ele, void *data)
- (SchemeObject*) run - (SchemeObject*) run
{ {
local integer opcode; local int opcode;
local integer operand; local int operand;
local SchemeObject *res; local SchemeObject *res;
while (1) { while (1) {
if (value && [value isError]) { if (value && [value isError]) {
@ -250,7 +250,7 @@ void GlobalFree (void *ele, void *data)
} }
} }
- (integer) line - (int) line
{ {
if (state.lineinfo) { if (state.lineinfo) {
return state.lineinfo[state.pc-1].linenumber; return state.lineinfo[state.pc-1].linenumber;

View File

@ -4,11 +4,11 @@
@interface Number: SchemeObject @interface Number: SchemeObject
{ {
integer value; int value;
} }
+ (id) newFromInt: (integer) i; + (id) newFromInt: (int) i;
- (id) initWithInt: (integer) i; - (id) initWithInt: (int) i;
- (integer) intValue; - (int) intValue;
- (string) printForm; - (string) printForm;
@end @end

View File

@ -3,18 +3,18 @@
@implementation Number @implementation Number
+ (id) newFromInt: (integer) i + (id) newFromInt: (int) i
{ {
return [[self alloc] initWithInt: i]; return [[self alloc] initWithInt: i];
} }
- (id) initWithInt: (integer) i - (id) initWithInt: (int) i
{ {
value = i; value = i;
return [super init]; return [super init];
} }
- (integer) intValue - (int) intValue
{ {
return value; return value;
} }

Some files were not shown because too many files have changed in this diff Show More