Non-bogus syntax and warning fixes for ruamoko/cl_menu.

Sadly, there are many bogus warnings and other errors. qfcc is still very
sick :(.
This commit is contained in:
Bill Currie 2011-02-14 23:08:18 +09:00
parent 9ac6929cf7
commit 3a1e467ae8
21 changed files with 134 additions and 130 deletions

View file

@ -6,9 +6,9 @@
@interface CrosshairView : View
{
CrosshairCvar []crosshair;
CrosshairCvar *crosshair;
}
-(id)initWithBounds:(Rect)aRect :(CrosshairCvar[])_crosshair;
-(id)initWithBounds:(Rect)aRect :(CrosshairCvar*)_crosshair;
-(void) next;
@end

View file

@ -6,10 +6,10 @@
@implementation CrosshairView
{
CrosshairCvar []crosshair;
CrosshairCvar *crosshair;
}
-(id)initWithBounds:(Rect)aRect :(CrosshairCvar[])_crosshair
-(id)initWithBounds:(Rect)aRect :(CrosshairCvar*)_crosshair
{
self = [self initWithBounds:aRect];
crosshair = _crosshair;

View file

@ -7,9 +7,9 @@
@interface CvarColorView : View
{
CvarColor []color;
CvarColor *color;
}
-(id)initWithBounds:(Rect)aRect :(CvarColor [])_color;
-(id)initWithBounds:(Rect)aRect :(CvarColor *)_color;
-(void)next;
-(void)prev;
@end

View file

@ -6,7 +6,7 @@
#include "CvarColor.h"
@implementation CvarColorView
-(id)initWithBounds:(Rect)aRect :(CvarColor [])_color
-(id)initWithBounds:(Rect)aRect :(CvarColor *)_color
{
self = [self initWithBounds:aRect];
color = _color;
@ -47,5 +47,6 @@
[self prev];
return 1;
}
return 0;
}
@end

View file

@ -9,13 +9,13 @@
@interface CvarRangeView : Group
{
Text []title;
Text []value;
Slider []slider;
CvarRange []range;
Text *title;
Text *value;
Slider *slider;
CvarRange *range;
}
-(void)update;
-(id)initWithBounds:(Rect)aRect title:(string)_title sliderWidth:(integer)width :(CvarRange [])_range;
-(id)initWithBounds:(Rect)aRect title:(string)_title sliderWidth:(integer)width :(CvarRange *)_range;
-(void)inc;
-(void)dec;
@end

View file

@ -15,7 +15,7 @@
[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:(integer)width :(CvarRange *)_range
{
local Rect rect;
@ -69,6 +69,7 @@
[self dec];
return 1;
}
return 0;
}
@end

View file

@ -8,12 +8,12 @@
@interface CvarToggleView : Group
{
Text []title;
Text []value;
CvarToggle []toggle;
Text *title;
Text *value;
CvarToggle *toggle;
}
-(void)update;
-(id)initWithBounds:(Rect)aRect title:(string)_title :(CvarToggle [])_toggle;
-(id)initWithBounds:(Rect)aRect title:(string)_title :(CvarToggle *)_toggle;
-(void)toggle;
@end

View file

@ -13,7 +13,7 @@
[value setText:[toggle value] ? "On" : "Off"];
}
-(id)initWithBounds:(Rect)aRect title:(string)_title :(CvarToggle [])_toggle
-(id)initWithBounds:(Rect)aRect title:(string)_title :(CvarToggle *)_toggle
{
local Rect rect;

View file

@ -3,7 +3,7 @@
@interface Frame : Object
{
QPic []picture;
QPic *picture;
float duration;
}
- (id) initWithFile: (string) file duration: (float) time;

View file

@ -37,7 +37,7 @@
@interface HUDGraphic : HUDObject
{
QPic []picture;
QPic *picture;
}
- (id) initWithComponents: (integer)x :(integer)y :(string) _file;
@ -52,7 +52,7 @@
@interface HUDAnimation : HUDObject
{
Array []frames;
Array *frames;
integer currentFrame;
float nextFrameTime;
BOOL looping;
@ -60,7 +60,7 @@
- (id) initWithComponents: (integer) x :(integer) y;
- (void) dealloc;
- (Size) size;
- (void) addFrame: (Frame []) frame;
- (void) addFrame: (Frame *) frame;
- (void) changeFrame;
- (void) display;
- (void) start;

View file

@ -147,13 +147,13 @@ integer HUDHandleClass;
- (Size) size
{
local Frame []frame;
local Frame *frame;
frame = [frames objectAtIndex: currentFrame];
return [frame size];
}
- (void) addFrame: (Frame[]) frame
- (void) addFrame: (Frame*) frame
{
[frames addObject: frame];
}
@ -161,7 +161,7 @@ integer HUDHandleClass;
- (void) changeFrame
{
while (time >= nextFrameTime) {
local Frame []f;
local Frame *f;
if (++currentFrame == [frames count]) {
if (looping)
currentFrame = 0;
@ -178,7 +178,7 @@ integer HUDHandleClass;
- (void) display
{
local Frame []f;
local Frame *f;
if (!visible)
return;
@ -192,7 +192,7 @@ integer HUDHandleClass;
- (void) start
{
local Frame []f;
local Frame *f;
currentFrame = 0;
f = [frames objectAtIndex: 0];

View file

@ -11,6 +11,7 @@
{
if ((self = [super init]))
current = base = 0;
return self;
}
-(void)setBase:(integer)b
@ -57,7 +58,7 @@
- (void) draw
{
local View []cur;
local View *cur;
[super draw];
cur = [views objectAtIndex:current];

View file

@ -5,10 +5,10 @@
@interface ProxyView : View
{
View []title;
View []view;
View *title;
View *view;
}
-(id)initWithBounds:(Rect)aRect title:(View[])aTitle view:(View[])aView;
-(id)initWithBounds:(Rect)aRect title:(View*)aTitle view:(View*)aView;
@end
#endif//__ProxyView_h

View file

@ -2,7 +2,7 @@
@implementation ProxyView
-(id)initWithBounds:(Rect)aRect title:(View [])aTitle view:(View [])aView
-(id)initWithBounds:(Rect)aRect title:(View *)aTitle view:(View *)aView
{
self = [super initWithBounds:aRect];
if (!self)
@ -24,7 +24,7 @@
[view draw];
}
- (void) setBasePosFromView: (View []) aview
- (void) setBasePosFromView: (View *) aview
{
[super setBasePosFromView:aview];
[title setBasePosFromView:self];

View file

@ -2,6 +2,6 @@
#define __client_menu_h
@class InputLine;
@extern InputLine []input_active;
@extern InputLine *input_active;
#endif

View file

@ -21,7 +21,7 @@
float () random = #7;
string [6] dot_name = {
string dot_name[6] = {
"gfx/menudot1.lmp",
"gfx/menudot2.lmp",
"gfx/menudot3.lmp",
@ -68,7 +68,7 @@ void (integer x, integer y) spinner =
integer do_single_player;
string [32] quitMessage = {
string quitMessage[32] = {
/* .........1.........2.... */
" Are you gonna quit ",
" this game just like ",
@ -115,18 +115,18 @@ integer quit_index;
// ********* LOAD / SAVE
#define MAX_SAVEGAMES 12
string [MAX_SAVEGAMES] filenames;
integer [MAX_SAVEGAMES] loadable;
string filenames[MAX_SAVEGAMES];
integer loadable[MAX_SAVEGAMES];
integer load_cursor;
integer save_cursor;
string (QFile f) get_comment =
{
local string line;
local PLItem []plist;
local PLItem *plist;
plist = [PLItem fromFile:f];
line = [(PLString[]) [(PLDictionary[]) plist getObjectForKey:"comment"] string];
line = [(PLString*) [(PLDictionary*) plist getObjectForKey:"comment"] string];
return line;
}
@ -367,10 +367,10 @@ string my_tcpip_address;
string lanConfig_portname;
string lanConfig_joinname;
#define NUM_LANCONFIG_CMDS 3
integer [NUM_LANCONFIG_CMDS] lanConfig_cursor_table = { 72, 92, 124 };
InputLine []lanConfig_port_il;
InputLine []lanConfig_join_il;
InputLine []input_active;
integer lanConfig_cursor_table[NUM_LANCONFIG_CMDS] = { 72, 92, 124 };
InputLine *lanConfig_port_il;
InputLine *lanConfig_join_il;
InputLine *input_active;
integer (integer x, integer y) join_draw =
{

View file

@ -37,9 +37,9 @@
integer set_key_flag; // holds flag for the key-setting
// three global hashes for the main binding groups
Array []movement_bindings;
Array []misc_bindings;
Array []weapon_bindings;
Array *movement_bindings;
Array *misc_bindings;
Array *weapon_bindings;
struct binding_s {
string text;
@ -71,7 +71,7 @@ typedef struct binding_s binding_t;
}
@end
binding_t [16] movement_binding_list = {
binding_t movement_binding_list[16] = {
{"Jump/Swin up", "+jump"},
{"Walk forward", "+forward"},
{"Backpedal", "+back"},
@ -110,7 +110,7 @@ binding_t [10] weapon_binding_list = {
{"Thunderbolt", "impulse 8"},
};
Binding [](binding_t binding)
Binding *(binding_t binding)
new_binding =
{
return [[Binding alloc] initWithBinding:binding];
@ -168,11 +168,11 @@ get_keyname =
gets the keys for a keybinding-hash
*/
void (Array []list)
get_hash_keys =
void
get_hash_keys (Array *list)
{
local integer i,hlen;
local Binding []binding;
local Binding *binding;
local string desc1 = "", desc2 = "";
hlen = [list count];
@ -229,8 +229,8 @@ load_keybindings =
It takes the binding as argument.
This function is called by the real callbacks.
*/
integer (Binding []binding, integer key)
CB_MAIN_control_binding =
integer
CB_MAIN_control_binding (Binding *binding, integer key)
{
local integer retval = 0, bindcnt = 0;
@ -270,7 +270,7 @@ CB_MAIN_control_binding =
integer (string text, integer key)
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);
// fetch all keynames (possible to optimize.. but not very neccessary)
@ -307,7 +307,7 @@ DRAW_basic_control_binding =
hl = [movement_bindings count];
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,
binding.text, binding.keys);
}
@ -347,7 +347,7 @@ MENU_basic_control_binding =
integer (string text, integer key)
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);
// fetch all keynames (possible to optimize.. but not very neccessary)
@ -384,7 +384,7 @@ DRAW_misc_control_binding =
hl = [misc_bindings count];
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,
binding.text, binding.keys);
}
@ -423,7 +423,7 @@ MENU_misc_control_binding =
integer (string text, integer key)
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);
// fetch all keynames (possible to optimize.. but not very neccessary)
@ -460,7 +460,7 @@ DRAW_weapon_control_binding =
hl = [weapon_bindings count];
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,
binding.text, binding.keys);
}

View file

@ -53,32 +53,32 @@
#include "CvarColor.h"
#include "CvarToggle.h"
Group []video_options;
Group []audio_options;
Group *video_options;
Group *audio_options;
Group []control_options;
CvarToggleView []grab_mouse_view;
CvarToggleView []invert_mouse_view;
CvarToggleView []autorun_view;
CvarToggleView []freelook_view;
CvarToggleView []lookspring_view;
CvarToggleView []lookstrafe_view;
CvarRangeView []mouse_amp_view;
Group *control_options;
CvarToggleView *grab_mouse_view;
CvarToggleView *invert_mouse_view;
CvarToggleView *autorun_view;
CvarToggleView *freelook_view;
CvarToggleView *lookspring_view;
CvarToggleView *lookstrafe_view;
CvarRangeView *mouse_amp_view;
Group []feature_options;
CvarToggleView []fraglog_view;
CvarToggleView []autorecord_view;
Group *feature_options;
CvarToggleView *fraglog_view;
CvarToggleView *autorecord_view;
Group []player_options;
InputLine []player_config_plname_il;
InputLine []player_config_tname_il;
InputLine []player_config_iactive;
CvarColorView []topcolor_view;
CvarColorView []bottomcolor_view;
Group *player_options;
InputLine *player_config_plname_il;
InputLine *player_config_tname_il;
InputLine *player_config_iactive;
CvarColorView *topcolor_view;
CvarColorView *bottomcolor_view;
Group []network_options;
InputLine []network_config_rate_il;
InputLine []network_config_iactive;
Group *network_options;
InputLine *network_config_rate_il;
InputLine *network_config_iactive;
/*
some definitions of border values for different things
@ -133,8 +133,8 @@ KEY_video_options =
Menu function for the video options menu.
*/
void (PLItem []plist)
MENU_video_options =
void
MENU_video_options (PLItem *plist)
{
local @param ret;
Menu_Begin (54, 50, "Video");
@ -143,7 +143,7 @@ MENU_video_options =
Menu_KeyEvent (KEY_video_options);
if (plist) {
ret = object_from_plist ([(PLDictionary[]) plist getObjectForKey:"video_options"]);
ret = object_from_plist ([(PLDictionary*) plist getObjectForKey:"video_options"]);
video_options = ret.pointer_val;
}
@ -180,8 +180,8 @@ KEY_audio_options =
Makes the audio menu
*/
void (PLItem []plist)
MENU_audio_options =
void
MENU_audio_options (PLItem *plist)
{
local @param ret;
Menu_Begin (54, 60, "Audio");
@ -190,7 +190,7 @@ MENU_audio_options =
Menu_KeyEvent (KEY_audio_options);
if (plist) {
ret = object_from_plist ([(PLDictionary[]) plist getObjectForKey:"audio_options"]);
ret = object_from_plist ([(PLDictionary*) plist getObjectForKey:"audio_options"]);
audio_options = ret.pointer_val;
}
@ -264,8 +264,8 @@ KEY_control_options =
Menu make function for control options
*/
void (PLItem []plist)
MENU_control_options =
void
MENU_control_options (PLItem *plist)
{
local @param ret;
Menu_Begin (54, 40, "Controls");
@ -274,7 +274,7 @@ MENU_control_options =
Menu_KeyEvent (KEY_control_options);
if (plist) {
ret = object_from_plist ([(PLDictionary[]) plist getObjectForKey:"control_options"]);
ret = object_from_plist ([(PLDictionary*) plist getObjectForKey:"control_options"]);
control_options = ret.pointer_val;
}
@ -328,8 +328,8 @@ DRAW_feature_options =
Makes the feature option menu
*/
void (PLItem []plist)
MENU_feature_options =
void
MENU_feature_options (PLItem *plist)
{
local Rect rect;
local id view;
@ -385,7 +385,7 @@ string teamname_cvar; // name of the cvar holding teamname (MAY ? gametype depen
// table for cursor-positions
#define NUM_PLAYERCONFIG_CMDS 4
integer [NUM_PLAYERCONFIG_CMDS] player_config_cursor_tbl = {
integer player_config_cursor_tbl[NUM_PLAYERCONFIG_CMDS] = {
PLAYER_CONF_Y_PAD + 8,
PLAYER_CONF_Y_PAD + 20 + 8,
PLAYER_CONF_Y_PAD + 45,
@ -395,7 +395,7 @@ integer [NUM_PLAYERCONFIG_CMDS] player_config_cursor_tbl = {
integer player_config_cursor;
// array, which holds commands for this menu
string [NUM_PLAYERCONFIG_CMDS] player_config_vals = {
string player_config_vals[NUM_PLAYERCONFIG_CMDS] = {
"",
"",
"topcolor",
@ -512,8 +512,8 @@ CB_ME_player_options =
Makes the player option menu
*/
void (PLItem []plist)
MENU_player_options =
void
MENU_player_options (PLItem *plist)
{
local Rect rect;
local id view;
@ -590,14 +590,14 @@ integer network_config_cursor;
// table for cursor-positions
#define NUM_NETWORKCONFIG_CMDS 1
integer [NUM_NETWORKCONFIG_CMDS] network_config_cursor_tbl = {
integer network_config_cursor_tbl[NUM_NETWORKCONFIG_CMDS] = {
PLAYER_CONF_Y_PAD + 8,
};
integer network_config_cursor;
// array, which holds commands for this menu
string [NUM_NETWORKCONFIG_CMDS] network_config_vals = {
string network_config_vals[NUM_NETWORKCONFIG_CMDS] = {
"",
};
@ -682,8 +682,8 @@ CB_ME_network_options =
Makes the network option menu
*/
void (PLItem []plist)
MENU_network_options =
void
MENU_network_options (PLItem *plist)
{
local id view;
@ -743,7 +743,7 @@ void ()
MENU_options =
{
local integer spacing = 120;
local PLItem []plist;
local PLItem *plist;
plist = read_plist ("menu.plist");

View file

@ -3,7 +3,7 @@
#include "PropertyList.h"
@extern @param object_from_plist (PLItem []plist);
@extern PLItem []read_plist (string fname);
@extern @param object_from_plist (PLItem *plist);
@extern PLItem *read_plist (string fname);
#endif//__plistmenu_r

View file

@ -33,20 +33,20 @@
#include "plistmenu.h"
@static @param
class_from_plist (PLDictionary []pldict)
class_from_plist (PLDictionary *pldict)
{
local @param [8]params;
local @param params[8];
local @param ret;
local @va_list va_list = { 0, params };
local string classname, selname, paramstr;
local id class;
local id obj;
local PLArray []messages, msg;
local PLArray *messages, *msg;
local integer message_count, i, j;
local SEL sel;
local PLItem []item;
local PLItem *item;
classname = [(PLString[]) [pldict getObjectForKey:"Class"] string];
classname = [(PLString*) [pldict getObjectForKey:"Class"] string];
class = obj_lookup_class (classname);
if (!class) {
dprint ("could not find " + classname + "\n");
@ -55,15 +55,15 @@ class_from_plist (PLDictionary []pldict)
}
obj = [class alloc];
messages = (PLArray[]) [pldict getObjectForKey:"Messages"];
messages = (PLArray*) [pldict getObjectForKey:"Messages"];
message_count = [messages count];
for (i = 0; i < message_count; i++) {
msg = (PLArray[]) [messages getObjectAtIndex:i];
selname = [(PLString[]) [msg getObjectAtIndex:0] string];
msg = (PLArray*) [messages getObjectAtIndex:i];
selname = [(PLString*) [msg getObjectAtIndex:0] string];
sel = sel_get_uid (selname);
va_list.count = [msg count] - 1;
for (j = 0; j < va_list.count; j++) {
paramstr = [(PLString[]) [msg getObjectAtIndex:j + 1] string];
paramstr = [(PLString*) [msg getObjectAtIndex:j + 1] string];
switch (str_mid (paramstr, 0, 1)) {
case "\"":
va_list.list[j].string_val = str_mid (paramstr, 1, -1);
@ -88,9 +88,9 @@ class_from_plist (PLDictionary []pldict)
}
@static @param
array_from_plist (PLArray []plarray)
array_from_plist (PLArray *plarray)
{
local Array []array;
local Array *array;
local integer i, count;
local @param ret;
@ -110,29 +110,29 @@ union ParamRect {
};
@static @param
rect_from_plist (PLString []plstring)
rect_from_plist (PLString *plstring)
{
local string str = [plstring string];
local string tmp;
local integer xp, yp, xl, yl;
local PLItem []item;
local PLItem *item;
local union ParamRect pr;
pr.r = makeRect (0, 0, 0, 0);
if (str_mid (str, 0, 1) == "[") {
tmp = "(" + str_mid (str, 1, -1) + ")";
item = [PLItem fromString:tmp];
xp = stoi ([(PLString[]) [(PLArray[]) item getObjectAtIndex:0] string]);
yp = stoi ([(PLString[]) [(PLArray[]) item getObjectAtIndex:1] string]);
xl = stoi ([(PLString[]) [(PLArray[]) item getObjectAtIndex:2] string]);
yl = stoi ([(PLString[]) [(PLArray[]) item getObjectAtIndex:3] string]);
xp = stoi ([(PLString*) [(PLArray*) item getObjectAtIndex:0] string]);
yp = stoi ([(PLString*) [(PLArray*) item getObjectAtIndex:1] string]);
xl = stoi ([(PLString*) [(PLArray*) item getObjectAtIndex:2] string]);
yl = stoi ([(PLString*) [(PLArray*) item getObjectAtIndex:3] string]);
pr.r = makeRect (xp, yp, xl, yl);
}
return pr.p;
}
@static @param
string_from_plist (PLString []plstring)
string_from_plist (PLString *plstring)
{
local @param ret;
local string str = [plstring string];
@ -145,28 +145,29 @@ string_from_plist (PLString []plstring)
}
@param
object_from_plist (PLItem []plist)
object_from_plist (PLItem *plist)
{
local @param ret;
switch ([plist type]) {
case QFDictionary:
return class_from_plist ((PLDictionary []) plist);
return class_from_plist ((PLDictionary *) plist);
case QFArray:
return array_from_plist ((PLArray []) plist);
return array_from_plist ((PLArray *) plist);
case QFBinary:
ret.pointer_val = nil;
return ret;
case QFString:
return string_from_plist ((PLString []) plist);
return string_from_plist ((PLString *) plist);
}
return nil;
}
PLItem []
PLItem *
read_plist (string fname)
{
local QFile file;
local PLItem []plist;
local PLItem *plist;
file = QFS_OpenFile (fname);
if (!file) {

View file

@ -25,8 +25,8 @@ integer (integer x, integer y) servlist_all_draw =
integer serv_nfull;
integer serv_nempty;
InputLine []serv_maxping;
InputLine []serv_game;
InputLine *serv_maxping;
InputLine *serv_game;
integer (integer x, integer y) servlist_filter_draw =
{