]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_edict.c
reduce code a bit more
[xonotic/darkplaces.git] / prvm_edict.c
index 718ac55aaf931a39be3e6f3c873114651d52d712..50ee3dbff1d508712cdafdd93d0dc058329421b4 100644 (file)
@@ -224,7 +224,7 @@ void PRVM_ED_ClearEdict (prvm_edict_t *e)
        PRVM_GCALL(init_edict)(e);
 }
 
-const char *PRVM_AllocationOrigin()
+const char *PRVM_AllocationOrigin(void)
 {
        char *buf = NULL;
        if(prog->leaktest_active)
@@ -1630,8 +1630,8 @@ PRVM_ResetProg
 ===============
 */
 
-void PRVM_LeakTest();
-void PRVM_ResetProg()
+void PRVM_LeakTest(void);
+void PRVM_ResetProg(void)
 {
        PRVM_LeakTest();
        PRVM_GCALL(reset_cmd)();
@@ -1773,7 +1773,7 @@ void PRVM_LoadProgs (const char * filename, int numrequiredfunc, char **required
                prog->functions[i].numparms = LittleLong (dfunctions[i].numparms);
                prog->functions[i].locals = LittleLong (dfunctions[i].locals);
                memcpy(prog->functions[i].parm_size, dfunctions[i].parm_size, sizeof(dfunctions[i].parm_size));
-               if(prog->functions[i].first_statement < 0 || prog->functions[i].first_statement >= prog->progs->numstatements)
+               if(prog->functions[i].first_statement >= prog->progs->numstatements)
                        PRVM_ERROR("PRVM_LoadProgs: out of bounds function statement (function %d) in %s", i, PRVM_NAME);
                // TODO bounds check parm_start, s_name, s_file, numparms, locals, parm_size
        }
@@ -2189,6 +2189,7 @@ void PRVM_Init (void)
        Cmd_AddCommand ("prvm_edicts", PRVM_ED_PrintEdicts_f, "prints all data about all entities in the selected VM (server, client, menu)");
        Cmd_AddCommand ("prvm_edictcount", PRVM_ED_Count_f, "prints number of active entities in the selected VM (server, client, menu)");
        Cmd_AddCommand ("prvm_profile", PRVM_Profile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu)");
+       Cmd_AddCommand ("prvm_childprofile", PRVM_ChildProfile_f, "prints execution statistics about the most used QuakeC functions in the selected VM (server, client, menu), sorted by time taken in function with child calls");
        Cmd_AddCommand ("prvm_callprofile", PRVM_CallProfile_f, "prints execution statistics about the most time consuming QuakeC calls from the engine in the selected VM (server, client, menu)");
        Cmd_AddCommand ("prvm_fields", PRVM_Fields_f, "prints usage statistics on properties (how many entities have non-zero values) in the selected VM (server, client, menu)");
        Cmd_AddCommand ("prvm_globals", PRVM_Globals_f, "prints all global variables in the selected VM (server, client, menu)");
@@ -2235,10 +2236,10 @@ void PRVM_InitProg(int prognr)
        prog->starttime = Sys_DoubleTime();
 
        prog->error_cmd = Host_Error;
-       prog->leaktest_active = prvm_leaktest.integer;
+       prog->leaktest_active = prvm_leaktest.integer != 0;
 }
 
-int PRVM_GetProgNr()
+int PRVM_GetProgNr(void)
 {
        return prog - prog_list;
 }
@@ -2675,7 +2676,7 @@ static qboolean PRVM_IsEdictReferenced(prvm_edict_t *edict, int mark)
        return false;
 }
 
-static void PRVM_MarkReferencedEdicts()
+static void PRVM_MarkReferencedEdicts(void)
 {
        int j;
        qboolean found_new;
@@ -2712,7 +2713,7 @@ static void PRVM_MarkReferencedEdicts()
        Con_DPrintf("leak check used %d stages to find all references\n", stage);
 }
 
-void PRVM_LeakTest()
+void PRVM_LeakTest(void)
 {
        int i, j;
        qboolean leaked = false;