]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_execprogram.h
disabled memory clumping, which surprisingly improves memory use, rather than hinders...
[xonotic/darkplaces.git] / pr_execprogram.h
index 524ca44feddd1efdd49242dbf3d74c033c5ac1e7..fd306cf2154a0fc1bcbb1a0c2f1963374369be22 100644 (file)
@@ -1,3 +1,6 @@
+
+// This code isn't #ifdef/#define protectable, don't try.
+
                while (1)
                {
                        st++;
                                        PR_RunError("Progs attempted to write to an out of bounds edict\n");
                                        return;
                                }
-                               if (OPB->_int % pr_edict_size < ((byte *)&sv.edicts->v - (byte *)sv.edicts))
+                               if (OPB->_int % pr_edict_size < ((qbyte *)&sv.edicts->v - (qbyte *)sv.edicts))
                                {
                                        pr_xstatement = st - pr_statements;
                                        PR_RunError("Progs attempted to write to an engine edict field\n");
                                        return;
                                }
 #endif
-                               ptr = (eval_t *)((byte *)sv.edicts + OPB->_int);
+                               ptr = (eval_t *)((qbyte *)sv.edicts + OPB->_int);
                                ptr->_int = OPA->_int;
                                break;
                        case OP_STOREP_V:
                                        return;
                                }
 #endif
-                               ptr = (eval_t *)((byte *)sv.edicts + OPB->_int);
+                               ptr = (eval_t *)((qbyte *)sv.edicts + OPB->_int);
                                ptr->vector[0] = OPA->vector[0];
                                ptr->vector[1] = OPA->vector[1];
                                ptr->vector[2] = OPA->vector[2];
                                }
 #endif
                                ed = PROG_TO_EDICT(OPA->edict);
-                               OPC->_int = (byte *)((int *)&ed->v + OPB->_int) - (byte *)sv.edicts;
+                               OPC->_int = (qbyte *)((int *)&ed->v + OPB->_int) - (qbyte *)sv.edicts;
                                break;
 
                        case OP_LOAD_F:
                                        PR_RunError("Progs attempted to write to an out of bounds edict\n");
                                        return;
                                }
-                               if (OPB->_int % pr_edict_size < ((byte *)&sv.edicts->v - (byte *)sv.edicts))
+                               if (OPB->_int % pr_edict_size < ((qbyte *)&sv.edicts->v - (qbyte *)sv.edicts))
                                {
                                        pr_xstatement = st - pr_statements;
                                        PR_RunError("Progs attempted to write to an engine edict field\n");
                                        return;
                                }
 #endif
-                               ptr = (eval_t *)((byte *)sv.edicts + OPB->_int);
+                               ptr = (eval_t *)((qbyte *)sv.edicts + OPB->_int);
                                ptr->_int = OPA->_int;
                                break;
                        case OP_LOAD_I:
                                PR_RunError ("Bad opcode %i", st->op);
                        }
                }
+