]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - exec.c
reclassify_token should only deal with tokens < TOKEN_START... should fix #113
[xonotic/gmqcc.git] / exec.c
diff --git a/exec.c b/exec.c
index 49cff447a223df7b8f24b55ad9c7ba1103f3f90e..05d6d8df1a6dd0701650cc5d866a755c9907d20e 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdarg.h>
+#include <stdlib.h>
 
 #include "gmqcc.h"
 
@@ -171,7 +172,7 @@ const 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 prog->strings + str;
 }
 
@@ -759,7 +760,7 @@ static int qc_strcat(qc_program *prog) {
     size_t len1,   len2;
     qcany *str1,  *str2;
     qcany  out;
-    
+
     const char *cstr1;
     const char *cstr2;
 
@@ -785,7 +786,7 @@ static int qc_strcmp(qc_program *prog) {
 
     const char *cstr1;
     const char *cstr2;
-    
+
     if (prog->argc != 2 && prog->argc != 3) {
         fprintf(stderr, "ERROR: invalid number of arguments for strcmp/strncmp: %i, expected 2 or 3\n",
                prog->argc);
@@ -834,7 +835,7 @@ static size_t qc_builtins_count = sizeof(qc_builtins) / sizeof(qc_builtins[0]);
 
 static const char *arg0 = NULL;
 
-static void version() {
+static void version(void) {
     printf("GMQCC-QCVM %d.%d.%d Built %s %s\n",
            GMQCC_VERSION_MAJOR,
            GMQCC_VERSION_MINOR,
@@ -844,7 +845,7 @@ static void version() {
     );
 }
 
-static void usage() {
+static void usage(void) {
     printf("usage: %s [options] [parameters] file\n", arg0);
     printf("options:\n");
     printf("  -h, --help         print this message\n"
@@ -904,19 +905,19 @@ void escapestring(char* dest, const char* src)  {
   char c;
   while ((c = *(src++))) {
     switch(c) {
-      case '\t': 
+      case '\t':
         *(dest++) = '\\', *(dest++) = 't';
         break;
-      case '\n': 
+      case '\n':
         *(dest++) = '\\', *(dest++) = 'n';
         break;
-      case '\r': 
+      case '\r':
         *(dest++) = '\\', *(dest++) = 'r';
         break;
-      case '\\': 
+      case '\\':
         *(dest++) = '\\', *(dest++) = '\\';
         break;
-      case '\"': 
+      case '\"':
         *(dest++) = '\\', *(dest++) = '\"';
         break;
       default: