]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
qcvm -pringdefs now prints [SAVE] next to globals with DEF_SAVEFLAG set
authorWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 18 Dec 2012 11:41:29 +0000 (12:41 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 18 Dec 2012 11:41:29 +0000 (12:41 +0100)
exec.c

diff --git a/exec.c b/exec.c
index 6d66ef2bfe4626dff7a02f131b8f20c6b3f7f6f0..41c43660ef408531baa9b3fb2fd9968a7d0967f6 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -930,18 +930,20 @@ int main(int argc, char **argv)
     }
     if (opts_printdefs) {
         for (i = 0; i < vec_size(prog->defs); ++i) {
-            printf("Global: %8s %-16s at %u\n",
+            printf("Global: %8s %-16s at %u%s\n",
                    type_name[prog->defs[i].type & DEF_TYPEMASK],
                    prog_getstring(prog, prog->defs[i].name),
-                   (unsigned int)prog->defs[i].offset);
+                   (unsigned int)prog->defs[i].offset,
+                   ((prog->defs[i].type & DEF_SAVEGLOBAL) ? " [SAVE]" : ""));
         }
     }
     else if (opts_printfields) {
         for (i = 0; i < vec_size(prog->fields); ++i) {
-            printf("Field: %8s %-16s at %u\n",
+            printf("Field: %8s %-16s at %u%s\n",
                    type_name[prog->fields[i].type],
                    prog_getstring(prog, prog->fields[i].name),
-                   (unsigned int)prog->fields[i].offset);
+                   (unsigned int)prog->fields[i].offset,
+                   ((prog->fields[i].type & DEF_SAVEGLOBAL) ? " [SAVE]" : ""));
         }
     }
     else if (opts_printfuns) {