]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.c
Revert "Actually works now"
[xonotic/gmqcc.git] / main.c
diff --git a/main.c b/main.c
index 0a22b1bada1716cdf55a6d389f71dd9294a27701..37638e92ae4fb8b0202116f596d48e3d1d27e127 100644 (file)
--- a/main.c
+++ b/main.c
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+
 #include "gmqcc.h"
 #include "lexer.h"
-#include <time.h>
 
 /* TODO: cleanup this whole file .. it's a fuckign mess */
 
@@ -41,24 +47,20 @@ static ppitem  *ppems = NULL;
 #define TYPE_ASM 1
 #define TYPE_SRC 2
 
+
 static const char *app_name;
 
-static void version() {
-    con_out("GMQCC %d.%d.%d Built %s %s\n",
+static void version(void) {
+    con_out("GMQCC %d.%d.%d Built %s %s\n" GMQCC_DEV_VERSION_STRING,
         GMQCC_VERSION_MAJOR,
         GMQCC_VERSION_MINOR,
         GMQCC_VERSION_PATCH,
         __DATE__,
         __TIME__
     );
-#ifdef GMQCC_GITINFO
-    con_out("git build: %s\n", GMQCC_GITINFO);
-#elif defined(GMQCC_VERION_TYPE_DEVEL)
-    con_out("development build\n");
-#endif
 }
 
-static int usage() {
+static int usage(void) {
     con_out("usage: %s [options] [files...]", app_name);
     con_out("options:\n"
             "  -h, --help             show this help message\n"
@@ -173,9 +175,11 @@ static bool options_parse(int argc, char **argv) {
                     opts_set(opts.flags, INITIALIZED_NONCONSTANTS,      true);
                     opts_set(opts.werror, WARN_INVALID_PARAMETER_COUNT, true);
                     opts_set(opts.werror, WARN_MISSING_RETURN_VALUES,   true);
+                    opts_set(opts.flags,  EXPRESSIONS_FOR_BUILTINS,     true);
 
 
                     OPTS_OPTION_U32(OPTION_STANDARD) = COMPILER_GMQCC;
+                    OPTS_OPTION_BOOL(OPTION_STATISTICS) = true;
 
                 } else if (!strcmp(argarg, "qcc")) {
 
@@ -643,9 +647,6 @@ int main(int argc, char **argv) {
         }
     }
 
-    if (OPTS_FLAG(TRUE_EMPTY_STRINGS))
-        type_not_instr[TYPE_STRING] = INSTR_NOT_F;
-
     util_debug("COM", "starting ...\n");
 
     /* add macros */
@@ -801,6 +802,7 @@ cleanup:
         mem_d((void*)operators);
 
     lex_cleanup();
-    util_meminfo();
+    stat_info();
+
     return retval;
 }