]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_edict.c
fixed some issues with how D3D=1 worked in the makefile
[xonotic/darkplaces.git] / prvm_edict.c
index 80803a23f66e05a0cb66397bde6996fdb77a2129..092ef0667ef84cb0f191376c417114cfd8642c7d 100644 (file)
@@ -36,6 +36,7 @@ cvar_t prvm_language = {0, "prvm_language", "", "when set, loads progs.dat.LANGU
 cvar_t prvm_traceqc = {0, "prvm_traceqc", "0", "prints every QuakeC statement as it is executed (only for really thorough debugging!)"};
 // LordHavoc: counts usage of each QuakeC statement
 cvar_t prvm_statementprofiling = {0, "prvm_statementprofiling", "0", "counts how many times each QuakeC statement has been executed, these counts are displayed in prvm_printfunction output (if enabled)"};
+cvar_t prvm_timeprofiling = {0, "prvm_timeprofiling", "0", "counts how long each function has been executed, these counts are displayed in prvm_profile output (if enabled)"};
 cvar_t prvm_backtraceforwarnings = {0, "prvm_backtraceforwarnings", "0", "print a backtrace for warnings too"};
 cvar_t prvm_leaktest = {0, "prvm_leaktest", "0", "try to detect memory leaks in strings or entities"};
 cvar_t prvm_leaktest_ignore_classnames = {0, "prvm_leaktest_ignore_classnames", "", "classnames of entities to NOT leak check because they are found by find(world, classname, ...) but are actually spawned by QC code (NOT map entities)"};
@@ -1893,6 +1894,8 @@ po_t *PRVM_PO_Load(const char *filename, mempool_t *pool)
        if(!buf)
                return NULL;
 
+       memset(&thisstr, 0, sizeof(thisstr)); // hush compiler warning
+
        po = (po_t *)Mem_Alloc(pool, sizeof(*po));
        memset(po, 0, sizeof(*po));
 
@@ -2069,7 +2072,7 @@ void PRVM_LoadLNO( const char *progname ) {
 PRVM_LoadProgs
 ===============
 */
-void PRVM_LoadProgs (const char * filename, int numrequiredfunc, char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, char **required_global)
+void PRVM_LoadProgs (const char * filename, int numrequiredfunc, const char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, char **required_global)
 {
        int i;
        dstatement_t *st;
@@ -2740,6 +2743,7 @@ void PRVM_Init (void)
        Cvar_RegisterVariable (&prvm_language);
        Cvar_RegisterVariable (&prvm_traceqc);
        Cvar_RegisterVariable (&prvm_statementprofiling);
+       Cvar_RegisterVariable (&prvm_timeprofiling);
        Cvar_RegisterVariable (&prvm_backtraceforwarnings);
        Cvar_RegisterVariable (&prvm_leaktest);
        Cvar_RegisterVariable (&prvm_leaktest_ignore_classnames);
@@ -2802,7 +2806,7 @@ void _PRVM_FreeAll(const char *filename, int fileline)
 }
 
 // LordHavoc: turned PRVM_EDICT_NUM into a #define for speed reasons
-unsigned int PRVM_EDICT_NUM_ERROR(unsigned int n, char *filename, int fileline)
+unsigned int PRVM_EDICT_NUM_ERROR(unsigned int n, const char *filename, int fileline)
 {
        PRVM_ERROR ("PRVM_EDICT_NUM: %s: bad number %i (called at %s:%i)", PRVM_NAME, n, filename, fileline);
        return 0;