]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - exec.c
Make compiler and virtual-machine compile as C++ code, also removed gmqcc_voidptr...
[xonotic/gmqcc.git] / exec.c
diff --git a/exec.c b/exec.c
index 0b9b3621f308536e4e9b58e1e48098577f943c67..270bd149e2123e9fbd2621c2fbf52e63ea4dee6b 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -169,8 +169,9 @@ void prog_delete(qc_program *prog)
 
 char* prog_getstring(qc_program *prog, qcint str)
 {
+    /* cast for return required for C++ */
     if (str < 0 || str >= (qcint)vec_size(prog->strings))
-        return "<<<invalid string>>>";
+        return (char*)"<<<invalid string>>>";
     return prog->strings + str;
 }
 
@@ -977,6 +978,17 @@ int main(int argc, char **argv)
         printf("Program's system-checksum = 0x%04x\n", (unsigned int)prog->crc16);
         printf("Entity field space: %u\n", (unsigned int)prog->entityfields);
         printf("Globals: %u\n", (unsigned int)vec_size(prog->globals));
+        printf("Counts:\n"
+               "      code: %lu\n"
+               "      defs: %lu\n"
+               "    fields: %lu\n"
+               " functions: %lu\n"
+               "   strings: %lu\n",
+               (unsigned long)vec_size(prog->code),
+               (unsigned long)vec_size(prog->defs),
+               (unsigned long)vec_size(prog->fields),
+               (unsigned long)vec_size(prog->functions),
+               (unsigned long)vec_size(prog->strings));
     }
 
     if (opts_info) {