]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - opts.c
More cleanups
[xonotic/gmqcc.git] / opts.c
diff --git a/opts.c b/opts.c
index 3e7e2073b834539e1464b6dce0570d071be49a70..6c30225324dab1d83c67d072f83254e30959f073 100644 (file)
--- a/opts.c
+++ b/opts.c
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 
 #include "gmqcc.h"
+#include "platform.h"
 
 const unsigned int opts_opt_oflag[COUNT_OPTIMIZATIONS+1] = {
 # define GMQCC_TYPE_OPTIMIZATIONS
@@ -90,6 +91,8 @@ static void opts_setdefault(void) {
     opts_set(opts.warn,  WARN_UNINITIALIZED_CONSTANT,    true);
     opts_set(opts.warn,  WARN_DEPRECATED,                true);
     opts_set(opts.warn,  WARN_PARENTHESIS,               true);
+    opts_set(opts.warn,  WARN_CONST_OVERWRITE,           true);
+    opts_set(opts.warn,  WARN_DIRECTIVE_INMACRO,         true);
 
     /* flags */
     opts_set(opts.flags, ADJUST_VECTOR_FIELDS,           true);
@@ -211,7 +214,7 @@ static char *opts_ini_next(const char *s, char c) {
 }
 
 static size_t opts_ini_parse (
-    FILE   *filehandle,
+    fs_file_t *filehandle,
     char *(*loadhandle)(const char *, const char *, const char *),
     char **errorhandle
 ) {
@@ -249,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 */
-                util_strncpy(section_data, parse_beg + 1, sizeof(section_data));
+                platform_strncpy(section_data, parse_beg + 1, sizeof(section_data));
                 section_data[sizeof(section_data) - 1] = '\0';
                 *oldname_data                          = '\0';
             } else if (!error) {
@@ -270,7 +273,7 @@ static size_t opts_ini_parse (
                 opts_ini_rstrip(read_value);
 
                 /* valid name value pair, lets call down to handler */
-                util_strncpy(oldname_data, read_name, sizeof(oldname_data));
+                platform_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)
@@ -378,7 +381,7 @@ void opts_ini_init(const char *file) {
      */
     char       *error = NULL;
     size_t     line;
-    FILE       *ini;
+    fs_file_t  *ini;
 
     if (!file) {
         /* try ini */