]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - exec.c
trigraphs
[xonotic/gmqcc.git] / exec.c
diff --git a/exec.c b/exec.c
index 666468a3f3bfa33ff519c357331313f9e5791143..0b275c90ff8976ad387a28a612106839032fe61e 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -715,6 +715,19 @@ static int qc_vtos(qc_program *prog)
     return 0;
 }
 
+static int qc_etos(qc_program *prog)
+{
+    char buffer[512];
+    qcany *num;
+    qcany str;
+    CheckArgs(1);
+    num = GetArg(0);
+    snprintf(buffer, sizeof(buffer), "%i", num->_int);
+    str.string = prog_tempstring(prog, buffer);
+    Return(str);
+    return 0;
+}
+
 static int qc_spawn(qc_program *prog)
 {
     qcany ent;
@@ -753,7 +766,8 @@ static prog_builtin qc_builtins[] = {
     &qc_kill,  /*   4   */
     &qc_vtos,  /*   5   */
     &qc_error, /*   6   */
-    &qc_vlen   /*   7   */
+    &qc_vlen,  /*   7   */
+    &qc_etos   /*   8   */
 };
 static size_t qc_builtins_count = sizeof(qc_builtins) / sizeof(qc_builtins[0]);
 
@@ -903,7 +917,7 @@ int main(int argc, char **argv)
     if (opts_printdefs) {
         for (i = 0; i < prog->defs_count; ++i) {
             printf("Global: %8s %-16s at %u\n",
-                   type_name[prog->defs[i].type],
+                   type_name[prog->defs[i].type & DEF_TYPEMASK],
                    prog_getstring(prog, prog->defs[i].name),
                    (unsigned int)prog->defs[i].offset);
         }