diff --git a/doc/progs/vm-exec.c b/doc/progs/vm-exec.c index 1f9ae4b8e..b250848cd 100644 --- a/doc/progs/vm-exec.c +++ b/doc/progs/vm-exec.c @@ -5,7 +5,7 @@ call_progs_main (progs_t *pr, int argc, const char **argv) { int i; dfunction_t *dfunc; - func_t progs_main = 0; + pr_func_t progs_main = 0; string_t *pr_argv; if ((dfunc = PR_FindFunction (pr, "main"))) { diff --git a/include/QF/progs.h b/include/QF/progs.h index f9ae57c63..d2d32cf51 100644 --- a/include/QF/progs.h +++ b/include/QF/progs.h @@ -167,7 +167,7 @@ void PR_PopFrame (progs_t *pr); \param pr pointer to ::progs_t VM struct \param fnum number of the function to call */ -void PR_ExecuteProgram (progs_t *pr, func_t fnum); +void PR_ExecuteProgram (progs_t *pr, pr_func_t fnum); /** Setup to call a function. If \p fnum is a builtin rather than a progs function, then the function is called immediately. When called from a @@ -180,7 +180,7 @@ void PR_ExecuteProgram (progs_t *pr, func_t fnum); \return true if \p fnum was a progs function, false if \p fnum was a builtin */ -int PR_CallFunction (progs_t *pr, func_t fnum, pr_type_t *return_ptr); +int PR_CallFunction (progs_t *pr, pr_func_t fnum, pr_type_t *return_ptr); ///@} @@ -482,7 +482,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_ \c void() \param p pointer to ::progs_t VM struct \param o offset into global data space - \return func_t lvalue + \return pr_func_t lvalue \hideinitializer */ @@ -698,7 +698,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_ \c void() \param p pointer to ::progs_t VM struct \param n parameter number (0-7) - \return func_t lvalue + \return pr_func_t lvalue \hideinitializer */ @@ -902,12 +902,12 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_ */ #define R_STRING(p) R_var (p, string) -/** Access the VM function return value as a ::func_t (a VM function reference) +/** Access the VM function return value as a ::pr_func_t (a VM function reference) \par QC type: \c void() \param p pointer to ::progs_t VM struct - \return ::func_t lvalue + \return ::pr_func_t lvalue \hideinitializer */ @@ -1103,7 +1103,7 @@ void PR_Undefined (progs_t *pr, const char *type, const char *name) __attribute_ \c void() \param e pointer to the entity \param o field offset into entity data space - \return func_t lvalue + \return pr_func_t lvalue \hideinitializer */ @@ -1911,7 +1911,7 @@ struct progs_s { pr_type_t *pr_edict_area; int pr_edict_size; ///< # of pr_type_t slots pr_uint_t pr_edict_area_size; ///< for bounds checking, starts at 0 - func_t edict_parse; + pr_func_t edict_parse; ///@} /// \name execution state diff --git a/include/QF/progs/pr_comp.h b/include/QF/progs/pr_comp.h index 9dbaea8db..fa7348161 100644 --- a/include/QF/progs/pr_comp.h +++ b/include/QF/progs/pr_comp.h @@ -29,9 +29,9 @@ typedef int16_t pr_short_t; typedef uint16_t pr_ushort_t; typedef int32_t pr_int_t; typedef uint32_t pr_uint_t; +typedef uint32_t pr_func_t; typedef int64_t pr_long_t; typedef uint64_t pr_ulong_t; -typedef pr_uint_t func_t; typedef pr_int_t pr_string_t; typedef pr_uint_t pr_ptr_t; @@ -520,7 +520,7 @@ typedef struct dfunction_s { typedef union pr_type_u { float float_var; pr_string_t string_var; - func_t func_var; + pr_func_t func_var; pr_uint_t entity_var; float vector_var; // really [3], but this structure must be 32 bits float quat_var; // really [4], but this structure must be 32 bits diff --git a/include/QF/progs/pr_obj.h b/include/QF/progs/pr_obj.h index 00f493469..2841f6064 100644 --- a/include/QF/progs/pr_obj.h +++ b/include/QF/progs/pr_obj.h @@ -129,7 +129,7 @@ typedef struct pr_method_list_s { struct pr_method_s { pr_ptr_t method_name; // pr_sel_t pr_string_t method_types; - func_t method_imp; // typedef id (id, SEL, ...) IMP + pr_func_t method_imp; // typedef id (id, SEL, ...) IMP } method_list[1]; } pr_method_list_t; typedef struct pr_method_s pr_method_t; diff --git a/include/QF/ruamoko.h b/include/QF/ruamoko.h index 8ee071632..71c2fe6ee 100644 --- a/include/QF/ruamoko.h +++ b/include/QF/ruamoko.h @@ -38,8 +38,8 @@ struct cbuf_s; void RUA_Init (struct progs_s *pr, int secure); void RUA_Cbuf_SetCbuf (struct progs_s *pr, struct cbuf_s *cbuf); -func_t RUA_Obj_msg_lookup (struct progs_s *pr, pr_ptr_t _self, - pr_ptr_t __cmd); +pr_func_t RUA_Obj_msg_lookup (struct progs_s *pr, pr_ptr_t _self, + pr_ptr_t __cmd); void RUA_Game_Init (struct progs_s *pr, int secure); diff --git a/libs/console/bi_inputline.c b/libs/console/bi_inputline.c index 1c63a69a7..a2de6285c 100644 --- a/libs/console/bi_inputline.c +++ b/libs/console/bi_inputline.c @@ -49,7 +49,7 @@ typedef struct il_data_s { struct il_data_s **prev; inputline_t *line; progs_t *pr; - func_t enter; // enter key callback + pr_func_t enter; // enter key callback pr_ptr_t data[2]; // allow two data params for the callback int method; // true if method rather than function } il_data_t; diff --git a/libs/console/menu.c b/libs/console/menu.c index a98c2d71a..80bcc772e 100644 --- a/libs/console/menu.c +++ b/libs/console/menu.c @@ -67,12 +67,12 @@ typedef struct menu_item_s { int max_items; int cur_item; int x, y; - func_t func; - func_t cursor; - func_t keyevent; - func_t draw; - func_t enter_hook; - func_t leave_hook; + pr_func_t func; + pr_func_t cursor; + pr_func_t keyevent; + pr_func_t draw; + pr_func_t enter_hook; + pr_func_t leave_hook; unsigned fadescreen:1; unsigned allkeys:1; const char *text; @@ -85,16 +85,16 @@ static progs_t menu_pr_state; static menu_item_t *menu; //static keydest_t menu_keydest; static hashtab_t *menu_hash; -static func_t menu_init; -static func_t menu_quit; -static func_t menu_draw_hud; -static func_t menu_pre; -static func_t menu_post; +static pr_func_t menu_init; +static pr_func_t menu_quit; +static pr_func_t menu_draw_hud; +static pr_func_t menu_pre; +static pr_func_t menu_post; static const char *top_menu; typedef struct menu_func_s { const char *name; - func_t *func; + pr_func_t *func; } menu_func_t; static menu_func_t menu_functions[] = { @@ -129,7 +129,7 @@ menu_resolve_globals (progs_t *pr) sym = menu_functions[i].name; if (!(f = PR_FindFunction (pr, sym))) goto error; - *menu_functions[i].func = (func_t) (f - menu_pr_state.pr_functions); + *menu_functions[i].func = (pr_func_t) (f - menu_pr_state.pr_functions); } if (!(def = PR_FindGlobal (pr, sym = "time"))) @@ -315,7 +315,7 @@ bi_Menu_Item (progs_t *pr) int x = P_INT (pr, 0); int y = P_INT (pr, 1); const char *text = P_GSTRING (pr, 2); - func_t func = P_FUNCTION (pr, 3); + pr_func_t func = P_FUNCTION (pr, 3); int allkeys = P_INT (pr, 4); menu_item_t *mi = calloc (sizeof (menu_item_t), 1); @@ -331,7 +331,7 @@ bi_Menu_Item (progs_t *pr) static void bi_Menu_Cursor (progs_t *pr) { - func_t func = P_FUNCTION (pr, 0); + pr_func_t func = P_FUNCTION (pr, 0); menu->cursor = func; } @@ -339,7 +339,7 @@ bi_Menu_Cursor (progs_t *pr) static void bi_Menu_KeyEvent (progs_t *pr) { - func_t func = P_FUNCTION (pr, 0); + pr_func_t func = P_FUNCTION (pr, 0); menu->keyevent = func; } @@ -385,7 +385,7 @@ bi_Menu_SelectMenu (progs_t *pr) static void bi_Menu_SetQuit (progs_t *pr) { - func_t func = P_FUNCTION (pr, 0); + pr_func_t func = P_FUNCTION (pr, 0); menu_quit = func; } diff --git a/libs/gamecode/pr_debug.c b/libs/gamecode/pr_debug.c index 16d584e88..f06fdf39f 100644 --- a/libs/gamecode/pr_debug.c +++ b/libs/gamecode/pr_debug.c @@ -95,7 +95,7 @@ typedef struct prdeb_resources_s { pr_debug_header_t *debug; pr_auxfunction_t *auxfunctions; pr_auxfunction_t **auxfunction_map; - func_t *sorted_functions; + pr_func_t *sorted_functions; pr_lineno_t *linenos; pr_def_t *local_defs; pr_def_t *type_encodings_def; @@ -502,8 +502,8 @@ func_compare_sort (const void *_fa, const void *_fb, void *_res) { prdeb_resources_t *res = _res; progs_t *pr = res->pr; - func_t fa = *(const func_t *)_fa; - func_t fb = *(const func_t *)_fb; + pr_func_t fa = *(const pr_func_t *)_fa; + pr_func_t fb = *(const pr_func_t *)_fb; const char *fa_file = PR_GetString (pr, pr->pr_functions[fa].file); const char *fb_file = PR_GetString (pr, pr->pr_functions[fb].file); int cmp = strcmp (fa_file, fb_file); @@ -523,7 +523,7 @@ func_compare_search (const void *_key, const void *_f, void *_res) prdeb_resources_t *res = _res; progs_t *pr = res->pr; const func_key_t *key = _key; - func_t f = *(const func_t *)_f; + pr_func_t f = *(const pr_func_t *)_f; const char *f_file = PR_GetString (pr, pr->pr_functions[f].file); int cmp = strcmp (key->file, f_file); if (cmp) { @@ -548,7 +548,7 @@ PR_DebugSetSym (progs_t *pr, pr_debug_header_t *debug) size_t size; size = pr->progs->numfunctions * sizeof (pr_auxfunction_t *); res->auxfunction_map = pr->allocate_progs_mem (pr, size); - size = pr->progs->numfunctions * sizeof (func_t); + size = pr->progs->numfunctions * sizeof (pr_func_t); res->sorted_functions = pr->allocate_progs_mem (pr, size); for (pr_uint_t i = 0; i < pr->progs->numfunctions; i++) { @@ -572,8 +572,8 @@ PR_DebugSetSym (progs_t *pr, pr_debug_header_t *debug) res->auxfunction_map[res->auxfunctions[i].function] = &res->auxfunctions[i]; } - qsort_r (res->sorted_functions, pr->progs->numfunctions, sizeof (func_t), - func_compare_sort, res); + qsort_r (res->sorted_functions, pr->progs->numfunctions, + sizeof (pr_func_t), func_compare_sort, res); for (pr_uint_t i = 0; i < debug->num_locals; i++) { if (type_encodings) { @@ -837,8 +837,8 @@ PR_FindSourceLineAddr (progs_t *pr, const char *file, pr_uint_t line) { prdeb_resources_t *res = pr->pr_debug_resources; func_key_t key = { file, line }; - func_t *f = fbsearch_r (&key, res->sorted_functions, - pr->progs->numfunctions, sizeof (func_t), + pr_func_t *f = fbsearch_r (&key, res->sorted_functions, + pr->progs->numfunctions, sizeof (pr_func_t), func_compare_search, res); if (!f) { return 0; @@ -1591,7 +1591,7 @@ PR_PrintStatement (progs_t *pr, dstatement_t *s, int contents) unsigned parm_ind = 0; pr_uint_t opval; qfot_type_t *optype = &res->void_type; - func_t func; + pr_func_t func; if (mode == 'P') { opchar = fmt[3]; diff --git a/libs/gamecode/pr_exec.c b/libs/gamecode/pr_exec.c index d0f94d8fb..3b5b8c6f3 100644 --- a/libs/gamecode/pr_exec.c +++ b/libs/gamecode/pr_exec.c @@ -421,7 +421,7 @@ error_handler (void *data) } VISIBLE int -PR_CallFunction (progs_t *pr, func_t fnum, pr_type_t *return_ptr) +PR_CallFunction (progs_t *pr, pr_func_t fnum, pr_type_t *return_ptr) { bfunction_t *f; @@ -2766,7 +2766,7 @@ pr_exec_ruamoko (progs_t *pr, int exitdepth) pr_type_t *stk; pr_type_t *mm; - func_t function; + pr_func_t function; pr_opcode_e st_op = st->op & OP_MASK; switch (st_op) { // 0 0000 @@ -3461,7 +3461,7 @@ exit_program: The interpretation main loop */ VISIBLE void -PR_ExecuteProgram (progs_t *pr, func_t fnum) +PR_ExecuteProgram (progs_t *pr, pr_func_t fnum) { Sys_PushSignalHook (signal_hook, pr); Sys_PushErrorHandler (error_handler, pr); diff --git a/libs/gamecode/test/main.c b/libs/gamecode/test/main.c index c9c34be53..9f988fd50 100644 --- a/libs/gamecode/test/main.c +++ b/libs/gamecode/test/main.c @@ -37,7 +37,7 @@ test_debug_handler (prdebug_t event, void *param, void *data) longjmp (jump_buffer, 1); case prd_subenter: if (verbose > 0) { - printf ("debug: subenter %d\n", *(func_t *) param); + printf ("debug: subenter %d\n", *(pr_func_t *) param); } case prd_subexit: break; diff --git a/libs/gib/bi_gib.c b/libs/gib/bi_gib.c index 726e18d8b..f2f9bc671 100644 --- a/libs/gib/bi_gib.c +++ b/libs/gib/bi_gib.c @@ -48,8 +48,8 @@ typedef struct bi_gib_builtin_s { struct bi_gib_builtin_s *next; gib_builtin_t *builtin; - progs_t *pr; - func_t func; + progs_t *pr; + pr_func_t func; } bi_gib_builtin_t; typedef struct bi_gib_resources_s { @@ -117,7 +117,7 @@ bi_GIB_Builtin_Add (progs_t *pr) bi_gib_resources_t *res = PR_Resources_Find (pr, "GIB"); bi_gib_builtin_t *builtin; const char *name = P_GSTRING (pr, 0); - func_t func = P_FUNCTION (pr, 1); + pr_func_t func = P_FUNCTION (pr, 1); if (GIB_Builtin_Exists (name)) { R_INT (pr) = 0; diff --git a/libs/ruamoko/rua_cmd.c b/libs/ruamoko/rua_cmd.c index 8efcfb2a5..44006b815 100644 --- a/libs/ruamoko/rua_cmd.c +++ b/libs/ruamoko/rua_cmd.c @@ -50,7 +50,7 @@ typedef struct bi_cmd_s { struct bi_cmd_s *next; char *name; progs_t *pr; - func_t func; + pr_func_t func; } bi_cmd_t; typedef struct { @@ -90,7 +90,7 @@ bi_Cmd_AddCommand (progs_t *pr) cmd_resources_t *res = PR_Resources_Find (pr, "Cmd"); bi_cmd_t *cmd = malloc (sizeof (bi_cmd_t)); char *name = strdup (P_GSTRING (pr, 0)); - func_t func = P_FUNCTION (pr, 1); + pr_func_t func = P_FUNCTION (pr, 1); if (!cmd || !name || !Cmd_AddCommand (name, bi_cmd_f, "CSQC command")) { if (name) diff --git a/libs/ruamoko/rua_hash.c b/libs/ruamoko/rua_hash.c index 27a40d3d5..3e9336398 100644 --- a/libs/ruamoko/rua_hash.c +++ b/libs/ruamoko/rua_hash.c @@ -49,10 +49,10 @@ typedef struct bi_hashtab_s { struct bi_hashtab_s **prev; progs_t *pr; hashtab_t *tab; - func_t gk; - func_t gh; - func_t cmp; - func_t f; + pr_func_t gk; + pr_func_t gh; + pr_func_t cmp; + pr_func_t f; pr_ptr_t ud; } bi_hashtab_t; diff --git a/libs/ruamoko/rua_input.c b/libs/ruamoko/rua_input.c index 8fefa5fa9..b838b3086 100644 --- a/libs/ruamoko/rua_input.c +++ b/libs/ruamoko/rua_input.c @@ -46,7 +46,7 @@ typedef struct rua_in_cookie_s { size_t users; progs_t *pr; - func_t func; + pr_func_t func; pr_ptr_t data; } rua_in_cookie_t; @@ -193,7 +193,7 @@ bi_IN_GetButtonInfo (progs_t *pr) } static rua_in_cookie_t * -make_cookie (progs_t *pr, func_t func, pr_ptr_t data) +make_cookie (progs_t *pr, pr_func_t func, pr_ptr_t data) { input_resources_t *res = PR_Resources_Find (pr, "input"); rua_in_cookie_t search = { @@ -212,7 +212,7 @@ make_cookie (progs_t *pr, func_t func, pr_ptr_t data) } static rua_in_cookie_t * -find_cookie (progs_t *pr, func_t func, pr_ptr_t data) +find_cookie (progs_t *pr, pr_func_t func, pr_ptr_t data) { input_resources_t *res = PR_Resources_Find (pr, "input"); rua_in_cookie_t search = { @@ -236,8 +236,8 @@ static void rua_add_axis_listener (progs_t *pr, axis_listener_t listener) { in_axis_t *axis = &P_STRUCT (pr, in_axis_t, 0); - func_t func = P_FUNCTION (pr, 1); - func_t data = P_POINTER (pr, 2); + pr_func_t func = P_FUNCTION (pr, 1); + pr_func_t data = P_POINTER (pr, 2); rua_in_cookie_t *cookie = make_cookie (pr, func, data); IN_AxisAddListener (axis, listener, cookie); } @@ -246,8 +246,8 @@ static void rua_remove_axis_listener (progs_t *pr, axis_listener_t listener) { in_axis_t *axis = &P_STRUCT (pr, in_axis_t, 0); - func_t func = P_FUNCTION (pr, 1); - func_t data = P_POINTER (pr, 2); + pr_func_t func = P_FUNCTION (pr, 1); + pr_func_t data = P_POINTER (pr, 2); rua_in_cookie_t *cookie = find_cookie (pr, func, data); if (cookie) { IN_AxisRemoveListener (axis, listener, cookie); @@ -259,8 +259,8 @@ static void rua_add_button_listener (progs_t *pr, button_listener_t listener) { in_button_t *button = &P_STRUCT (pr, in_button_t, 0); - func_t func = P_FUNCTION (pr, 1); - func_t data = P_POINTER (pr, 2); + pr_func_t func = P_FUNCTION (pr, 1); + pr_func_t data = P_POINTER (pr, 2); rua_in_cookie_t *cookie = make_cookie (pr, func, data); IN_ButtonAddListener (button, listener, cookie); } @@ -269,8 +269,8 @@ static void rua_remove_button_listener (progs_t *pr, button_listener_t listener) { in_button_t *button = &P_STRUCT (pr, in_button_t, 0); - func_t func = P_FUNCTION (pr, 1); - func_t data = P_POINTER (pr, 2); + pr_func_t func = P_FUNCTION (pr, 1); + pr_func_t data = P_POINTER (pr, 2); rua_in_cookie_t *cookie = find_cookie (pr, func, data); if (cookie) { IN_ButtonRemoveListener (button, listener, cookie); diff --git a/libs/ruamoko/rua_obj.c b/libs/ruamoko/rua_obj.c index 66994f65c..092562d50 100644 --- a/libs/ruamoko/rua_obj.c +++ b/libs/ruamoko/rua_obj.c @@ -68,7 +68,7 @@ typedef struct dtable_s { struct dtable_s *next; struct dtable_s **prev; size_t size; - func_t *imp; + pr_func_t *imp; } dtable_t; typedef struct probj_resources_s { @@ -79,7 +79,7 @@ typedef struct probj_resources_s { pr_string_t *selector_names; PR_RESMAP (dtable_t) dtables; dtable_t *dtable_list; - func_t obj_forward; + pr_func_t obj_forward; pr_sel_t *forward_selector; dstring_t *msg; hashtab_t *selector_hash; @@ -936,7 +936,7 @@ obj_install_dispatch_table_for_class (probj_t *probj, pr_class_t *class) dtable = dtable_new (probj); class->dtable = dtable_index (probj, dtable); dtable->size = probj->selector_index + 1; - dtable->imp = calloc (dtable->size, sizeof (func_t)); + dtable->imp = calloc (dtable->size, sizeof (pr_func_t)); if (super) { dtable_t *super_dtable = get_dtable (probj, __FUNCTION__, super->dtable); @@ -957,10 +957,10 @@ obj_check_dtable_installed (probj_t *probj, pr_class_t *class) return get_dtable (probj, __FUNCTION__, class->dtable); } -static func_t +static pr_func_t get_imp (probj_t *probj, pr_class_t *class, pr_sel_t *sel) { - func_t imp = 0; + pr_func_t imp = 0; if (class->dtable) { dtable_t *dtable = get_dtable (probj, __FUNCTION__, class->dtable); @@ -985,7 +985,7 @@ obj_reponds_to (probj_t *probj, pr_id_t *obj, pr_sel_t *sel) progs_t *pr = probj->pr; pr_class_t *class; dtable_t *dtable; - func_t imp = 0; + pr_func_t imp = 0; class = &G_STRUCT (pr, pr_class_t, obj->class_pointer); dtable = obj_check_dtable_installed (probj, class); @@ -996,7 +996,7 @@ obj_reponds_to (probj_t *probj, pr_id_t *obj, pr_sel_t *sel) return imp != 0; } -static func_t +static pr_func_t obj_msg_lookup (probj_t *probj, pr_id_t *receiver, pr_sel_t *op) { progs_t *pr = probj->pr; @@ -1015,7 +1015,7 @@ obj_msg_lookup (probj_t *probj, pr_id_t *receiver, pr_sel_t *op) return get_imp (probj, class, op); } -static func_t +static pr_func_t obj_msg_lookup_super (probj_t *probj, pr_super_t *super, pr_sel_t *op) { progs_t *pr = probj->pr; @@ -1260,7 +1260,7 @@ rua___obj_forward (progs_t *pr) pr_sel_t *fwd_sel = probj->forward_selector; pr_sel_t *err_sel; pr_class_t *class =&G_STRUCT (pr, pr_class_t, obj->class_pointer); - func_t imp; + pr_func_t imp; if (!fwd_sel) { //FIXME sel_register_typed_name is really not the way to go about @@ -1372,7 +1372,7 @@ static void rua_obj_set_error_handler (progs_t *pr) { //probj_t *probj = pr->pr_objective_resources; - //func_t func = P_INT (pr, 0); + //pr_func_t func = P_INT (pr, 0); //arglist //XXX PR_RunError (pr, "%s, not implemented", __FUNCTION__); @@ -1406,7 +1406,7 @@ rua_obj_msg_sendv (progs_t *pr) pr_id_t *receiver = &P_STRUCT (pr, pr_id_t, 0); pr_ptr_t sel = P_POINTER (pr, 1); pr_sel_t *op = &P_STRUCT (pr, pr_sel_t, 1); - func_t imp = obj_msg_lookup (probj, receiver, op); + pr_func_t imp = obj_msg_lookup (probj, receiver, op); __auto_type args = &P_PACKED (pr, pr_va_list_t, 2); int count = args->count; @@ -1530,7 +1530,7 @@ rua_obj_msgSend (progs_t *pr) probj_t *probj = pr->pr_objective_resources; pr_id_t *self = &P_STRUCT (pr, pr_id_t, 0); pr_sel_t *_cmd = &P_STRUCT (pr, pr_sel_t, 1); - func_t imp; + pr_func_t imp; if (!self) { R_INT (pr) = P_INT (pr, 0); @@ -1553,7 +1553,7 @@ rua_obj_msgSend_super (progs_t *pr) probj_t *probj = pr->pr_objective_resources; pr_super_t *super = &P_STRUCT (pr, pr_super_t, 0); pr_sel_t *_cmd = &P_STRUCT (pr, pr_sel_t, 1); - func_t imp; + pr_func_t imp; imp = obj_msg_lookup_super (probj, super, _cmd); if (!imp) { @@ -2248,13 +2248,13 @@ RUA_Obj_Init (progs_t *pr, int secure) PR_AddLoadFunc (pr, rua_obj_init_runtime); } -func_t +pr_func_t RUA_Obj_msg_lookup (progs_t *pr, pr_ptr_t _self, pr_ptr_t __cmd) { probj_t *probj = pr->pr_objective_resources; pr_id_t *self = &G_STRUCT (pr, pr_id_t, _self); pr_sel_t *_cmd = &G_STRUCT (pr, pr_sel_t, __cmd); - func_t imp; + pr_func_t imp; if (!self) return 0; diff --git a/libs/ruamoko/rua_stdlib.c b/libs/ruamoko/rua_stdlib.c index 8c375e405..2ef4d914a 100644 --- a/libs/ruamoko/rua_stdlib.c +++ b/libs/ruamoko/rua_stdlib.c @@ -56,7 +56,7 @@ typedef struct { progs_t *pr; - func_t func; + pr_func_t func; } function_t; static int @@ -87,7 +87,7 @@ bi_bsearch (progs_t *pr) const void *array = P_GPOINTER (pr, 1); size_t nmemb = P_INT (pr, 2); size_t size = P_INT (pr, 3) * sizeof (pr_int_t); - func_t cmp = P_FUNCTION (pr, 4); + pr_func_t cmp = P_FUNCTION (pr, 4); void *p = 0; if (!cmp) { @@ -106,7 +106,7 @@ bi_fbsearch (progs_t *pr) const void *array = P_GPOINTER (pr, 1); size_t nmemb = P_INT (pr, 2); size_t size = P_INT (pr, 3) * sizeof (pr_int_t); - func_t cmp = P_FUNCTION (pr, 4); + pr_func_t cmp = P_FUNCTION (pr, 4); void *p = 0; if (!cmp) { @@ -124,7 +124,7 @@ bi_qsort (progs_t *pr) void *array = P_GPOINTER (pr, 0); size_t nmemb = P_INT (pr, 1); size_t size = P_INT (pr, 2) * sizeof (pr_int_t); - func_t cmp = P_FUNCTION (pr, 3); + pr_func_t cmp = P_FUNCTION (pr, 3); if (!cmp) { qsort (array, nmemb, size, int_compare); diff --git a/nq/include/sv_progs.h b/nq/include/sv_progs.h index a660b4e77..4a74bfb38 100644 --- a/nq/include/sv_progs.h +++ b/nq/include/sv_progs.h @@ -76,18 +76,18 @@ typedef struct { extern sv_globals_t sv_globals; typedef struct { - func_t main; - func_t StartFrame; - func_t PlayerPreThink; - func_t PlayerPostThink; - func_t ClientKill; - func_t ClientConnect; - func_t PutClientInServer; - func_t ClientDisconnect; - func_t SetNewParms; - func_t SetChangeParms; + pr_func_t main; + pr_func_t StartFrame; + pr_func_t PlayerPreThink; + pr_func_t PlayerPostThink; + pr_func_t ClientKill; + pr_func_t ClientConnect; + pr_func_t PutClientInServer; + pr_func_t ClientDisconnect; + pr_func_t SetNewParms; + pr_func_t SetChangeParms; - func_t EndFrame; + pr_func_t EndFrame; } sv_funcs_t; extern sv_funcs_t sv_funcs; @@ -115,9 +115,9 @@ typedef struct pr_int_t mins; //vec3_t pr_int_t maxs; //vec3_t pr_int_t size; //vec3_t - pr_int_t touch; //func_t - pr_int_t think; //func_t - pr_int_t blocked; //func_t + pr_int_t touch; //pr_func_t + pr_int_t think; //pr_func_t + pr_int_t blocked; //pr_func_t pr_int_t nextthink; //float pr_int_t groundentity; //int pr_int_t health; //float diff --git a/nq/source/sv_progs.c b/nq/source/sv_progs.c index 65c7ee495..69dd7254c 100644 --- a/nq/source/sv_progs.c +++ b/nq/source/sv_progs.c @@ -397,13 +397,13 @@ resolve_functions (progs_t *pr, sv_def_t *def, int mode) if (mode == 2) { for (; def->name; def++) - *(func_t *) def->field = G_FUNCTION (pr, def->offset); + *(pr_func_t *) def->field = G_FUNCTION (pr, def->offset); return 1; } for (; def->name; def++) { dfunc = PR_FindFunction (pr, def->name); if (dfunc) { - *(func_t *) def->field = dfunc - pr->pr_functions; + *(pr_func_t *) def->field = dfunc - pr->pr_functions; } else if (mode) { PR_Undefined (pr, "function", def->name); ret = 0; diff --git a/qw/include/sv_progs.h b/qw/include/sv_progs.h index b4d931c35..c158461de 100644 --- a/qw/include/sv_progs.h +++ b/qw/include/sv_progs.h @@ -71,25 +71,25 @@ typedef struct { extern sv_globals_t sv_globals; typedef struct { - func_t main; - func_t StartFrame; - func_t PlayerPreThink; - func_t PlayerPostThink; - func_t ClientKill; - func_t ClientConnect; - func_t PutClientInServer; - func_t ClientDisconnect; - func_t SetNewParms; - func_t SetChangeParms; + pr_func_t main; + pr_func_t StartFrame; + pr_func_t PlayerPreThink; + pr_func_t PlayerPostThink; + pr_func_t ClientKill; + pr_func_t ClientConnect; + pr_func_t PutClientInServer; + pr_func_t ClientDisconnect; + pr_func_t SetNewParms; + pr_func_t SetChangeParms; - func_t EndFrame; - func_t SpectatorConnect; - func_t SpectatorThink; - func_t SpectatorDisconnect; - func_t UserInfoCallback; - func_t UserInfoChanged; - func_t ChatMessage; - func_t LocalinfoChanged; + pr_func_t EndFrame; + pr_func_t SpectatorConnect; + pr_func_t SpectatorThink; + pr_func_t SpectatorDisconnect; + pr_func_t UserInfoCallback; + pr_func_t UserInfoChanged; + pr_func_t ChatMessage; + pr_func_t LocalinfoChanged; } sv_funcs_t; extern sv_funcs_t sv_funcs; @@ -116,9 +116,9 @@ typedef struct pr_int_t mins; //vec3_t pr_int_t maxs; //vec3_t pr_int_t size; //vec3_t - pr_int_t touch; //func_t - pr_int_t think; //func_t - pr_int_t blocked; //func_t + pr_int_t touch; //pr_func_t + pr_int_t think; //pr_func_t + pr_int_t blocked; //pr_func_t pr_int_t nextthink; //float pr_int_t groundentity; //int pr_int_t health; //float diff --git a/qw/source/sv_pr_cpqw.c b/qw/source/sv_pr_cpqw.c index 19be9ac13..eebb91ef4 100644 --- a/qw/source/sv_pr_cpqw.c +++ b/qw/source/sv_pr_cpqw.c @@ -45,7 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "world.h" static struct { - func_t ClientCommand; + pr_func_t ClientCommand; } cpqw_funcs; /* @@ -796,7 +796,7 @@ static builtin_t builtins[] = { static struct { const char *name; - func_t *field; + pr_func_t *field; } cpqw_func_list[] = { {"ClientCommand", &cpqw_funcs.ClientCommand}, {"UserInfoChanged", &sv_funcs.UserInfoChanged}, @@ -841,7 +841,7 @@ cpqw_load (progs_t *pr) *cpqw_func_list[i].field = 0; if (f) - *cpqw_func_list[i].field = (func_t) (f - pr->pr_functions); + *cpqw_func_list[i].field = (pr_func_t) (f - pr->pr_functions); } ucmd_unknown = cpqw_user_cmd; return 1; diff --git a/qw/source/sv_pr_qwe.c b/qw/source/sv_pr_qwe.c index c5e5fb810..6c89a820b 100644 --- a/qw/source/sv_pr_qwe.c +++ b/qw/source/sv_pr_qwe.c @@ -56,9 +56,9 @@ #include "qw/include/sv_recorder.h" typedef struct { - func_t timeofday; - func_t ConsoleCmd; - func_t UserCmd; + pr_func_t timeofday; + pr_func_t ConsoleCmd; + pr_func_t UserCmd; } qwe_funcs_t; static qwe_funcs_t qwe_funcs; @@ -354,7 +354,7 @@ PF_calltimeofday (progs_t *pr) P_STRING (pr, 6) = PR_SetReturnString (pr, date.str); pr->pr_argc = 7; - PR_ExecuteProgram (pr, (func_t) (f - sv_pr_state.pr_functions)); + PR_ExecuteProgram (pr, (pr_func_t) (f - sv_pr_state.pr_functions)); PR_PopFrame (&sv_pr_state); } } @@ -508,7 +508,7 @@ static builtin_t builtins[] = { static struct { const char *name; - func_t *field; + pr_func_t *field; } qwe_func_list[] = { {"timeofday", &qwe_funcs.timeofday}, {"ConsoleCmd", &qwe_funcs.ConsoleCmd}, @@ -574,7 +574,7 @@ qwe_load (progs_t *pr) *qwe_func_list[i].field = 0; if (f) - *qwe_func_list[i].field = (func_t) (f - pr->pr_functions); + *qwe_func_list[i].field = (pr_func_t) (f - pr->pr_functions); } sv_cbuf->unknown_command = qwe_console_cmd; diff --git a/qw/source/sv_progs.c b/qw/source/sv_progs.c index 4510ee339..dee8842bd 100644 --- a/qw/source/sv_progs.c +++ b/qw/source/sv_progs.c @@ -430,13 +430,13 @@ resolve_functions (progs_t *pr, sv_def_t *def, int mode) if (mode == 2) { for (; def->name; def++) - *(func_t *) def->field = G_FUNCTION (pr, def->offset); + *(pr_func_t *) def->field = G_FUNCTION (pr, def->offset); return 1; } for (; def->name; def++) { dfunc = PR_FindFunction (pr, def->name); if (dfunc) { - *(func_t *) def->field = dfunc - pr->pr_functions; + *(pr_func_t *) def->field = dfunc - pr->pr_functions; } else if (mode) { PR_Undefined (pr, "function", def->name); ret = 0; diff --git a/qw/source/sv_user.c b/qw/source/sv_user.c index 2f37404b6..0d6ab4c3f 100644 --- a/qw/source/sv_user.c +++ b/qw/source/sv_user.c @@ -1332,7 +1332,7 @@ static void call_qc_hook (void *qc_hook) { *sv_globals.self = EDICT_TO_PROG (&sv_pr_state, sv_player); - PR_ExecuteProgram (&sv_pr_state, (func_t) (intptr_t) qc_hook); + PR_ExecuteProgram (&sv_pr_state, (pr_func_t) (intptr_t) qc_hook); } static const char * diff --git a/ruamoko/qwaq/builtins/debug.c b/ruamoko/qwaq/builtins/debug.c index 4fa0b0c98..ba43ddcb5 100644 --- a/ruamoko/qwaq/builtins/debug.c +++ b/ruamoko/qwaq/builtins/debug.c @@ -301,7 +301,7 @@ qdb_get_state (progs_t *pr) pr_string_t file = 0; unsigned line = 0; unsigned staddr = tpr->pr_xstatement; - func_t func = 0; + pr_func_t func = 0; if (tpr->pr_xfunction) { func = tpr->pr_xfunction - tpr->function_table; @@ -374,14 +374,14 @@ qdb_get_event (progs_t *pr) event->what = target->event; switch (event->what) { case prd_subenter: - event->function = *(func_t *) target->param; + event->function = *(pr_func_t *) target->param; break; case prd_runerror: case prd_error: event->message = PR_SetReturnString (pr, *(char **) target->param); break; case prd_begin: - event->function = *(func_t *) target->param; + event->function = *(pr_func_t *) target->param; break; case prd_terminate: event->exit_code = *(int *) target->param; diff --git a/ruamoko/qwaq/builtins/graphics.c b/ruamoko/qwaq/builtins/graphics.c index 44426ae4a..847a13357 100644 --- a/ruamoko/qwaq/builtins/graphics.c +++ b/ruamoko/qwaq/builtins/graphics.c @@ -83,7 +83,7 @@ quit_f (void) } static progs_t *bi_rprogs; -static func_t qc2d; +static pr_func_t qc2d; static int event_handler_id; static void diff --git a/ruamoko/qwaq/qwaq.h b/ruamoko/qwaq/qwaq.h index 4bdc09435..cb16c9af9 100644 --- a/ruamoko/qwaq/qwaq.h +++ b/ruamoko/qwaq/qwaq.h @@ -19,7 +19,7 @@ typedef struct qwaq_thread_s { int rua_security; struct memhunk_s *hunk; struct hashlink_s *hashlink_freelist; - func_t main_func; + pr_func_t main_func; void *data; } qwaq_thread_t; diff --git a/tools/qfcc/include/obj_file.h b/tools/qfcc/include/obj_file.h index aecd3801a..a4861d29a 100644 --- a/tools/qfcc/include/obj_file.h +++ b/tools/qfcc/include/obj_file.h @@ -420,7 +420,7 @@ enum { \param q pointer to ::qfo_t struct \param s space index \param o offset into object file data space - \return func_t lvalue + \return pr_func_t lvalue \hideinitializer */ diff --git a/tools/qfcc/source/dump_globals.c b/tools/qfcc/source/dump_globals.c index 5bff7e2a0..2f39850e1 100644 --- a/tools/qfcc/source/dump_globals.c +++ b/tools/qfcc/source/dump_globals.c @@ -118,7 +118,7 @@ dump_def (progs_t *pr, pr_def_t *def, int indent) break; case ev_func: { - func_t func = G_FUNCTION (pr, offset); + pr_func_t func = G_FUNCTION (pr, offset); int start; if (func < pr->progs->numfunctions) { start = pr->pr_functions[func].first_statement; diff --git a/tools/qfcc/test/test-harness.c b/tools/qfcc/test/test-harness.c index b73b0916f..c0aa96b10 100644 --- a/tools/qfcc/test/test-harness.c +++ b/tools/qfcc/test/test-harness.c @@ -259,7 +259,7 @@ int main (int argc, char **argv) { dfunction_t *dfunc; - func_t main_func = 0; + pr_func_t main_func = 0; const char *name = "progs.dat"; pr_string_t *pr_argv; int pr_argc = 1, i;