]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - opts.c
moving the length multiplication for 64 bit types from util_endianswap into util_swap...
[xonotic/gmqcc.git] / opts.c
diff --git a/opts.c b/opts.c
index 6c30225324dab1d83c67d072f83254e30959f073..79980247333fecd7aa105ef4f0bc52f79e0db62f 100644 (file)
--- a/opts.c
+++ b/opts.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012, 2013
+ * Copyright (C) 2012, 2013, 2014
  *     Wolfgang Bumiller
  *     Dale Weiler
  *
@@ -25,7 +25,6 @@
 #include <stdlib.h>
 
 #include "gmqcc.h"
-#include "platform.h"
 
 const unsigned int opts_opt_oflag[COUNT_OPTIMIZATIONS+1] = {
 # define GMQCC_TYPE_OPTIMIZATIONS
@@ -61,7 +60,7 @@ opts_cmd_t   opts; /* command line options */
 static void opts_setdefault(void) {
     memset(&opts, 0, sizeof(opts_cmd_t));
     OPTS_OPTION_BOOL(OPTION_CORRECTION) = true;
-    OPTS_OPTION_STR(OPTION_PROGSRC) = "progs.src";
+    OPTS_OPTION_STR(OPTION_PROGSRC)     = "progs.src";
 
     /* warnings */
     opts_set(opts.warn,  WARN_UNUSED_VARIABLE,           true);
@@ -93,6 +92,7 @@ static void opts_setdefault(void) {
     opts_set(opts.warn,  WARN_PARENTHESIS,               true);
     opts_set(opts.warn,  WARN_CONST_OVERWRITE,           true);
     opts_set(opts.warn,  WARN_DIRECTIVE_INMACRO,         true);
+    opts_set(opts.warn,  WARN_BUILTINS,                  true);
 
     /* flags */
     opts_set(opts.flags, ADJUST_VECTOR_FIELDS,           true);
@@ -130,7 +130,7 @@ void opts_restore_non_Werror_all() {
 void opts_init(const char *output, int standard, size_t arraysize) {
     opts_setdefault();
 
-    OPTS_OPTION_STR(OPTION_OUTPUT)         = (char*)output;
+    OPTS_OPTION_STR(OPTION_OUTPUT)         = output;
     OPTS_OPTION_U32(OPTION_STANDARD)       = standard;
     OPTS_OPTION_U32(OPTION_MAX_ARRAY_SIZE) = arraysize;
     OPTS_OPTION_U16(OPTION_MEMDUMPCOLS)    = 16;
@@ -231,7 +231,7 @@ static size_t opts_ini_parse (
     char *read_name;
     char *read_value;
 
-    while (fs_file_getline(&line, &linesize, filehandle) != EOF) {
+    while (fs_file_getline(&line, &linesize, filehandle) != FS_FILE_EOF) {
         parse_beg = line;
 
         /* handle BOM */
@@ -252,7 +252,7 @@ static size_t opts_ini_parse (
             /* section found */
             if (*(parse_end = opts_ini_next(parse_beg + 1, ']')) == ']') {
                 * parse_end = '\0'; /* terminate bro */
-                platform_strncpy(section_data, parse_beg + 1, sizeof(section_data));
+                util_strncpy(section_data, parse_beg + 1, sizeof(section_data));
                 section_data[sizeof(section_data) - 1] = '\0';
                 *oldname_data                          = '\0';
             } else if (!error) {
@@ -273,7 +273,7 @@ static size_t opts_ini_parse (
                 opts_ini_rstrip(read_value);
 
                 /* valid name value pair, lets call down to handler */
-                platform_strncpy(oldname_data, read_name, sizeof(oldname_data));
+                util_strncpy(oldname_data, read_name, sizeof(oldname_data));
                 oldname_data[sizeof(oldname_data) - 1] ='\0';
 
                 if ((*errorhandle = loadhandle(section_data, read_name, read_value)) && !error)