X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=opts.c;h=4d7d9a08debaed3e9fa9d96dac23e973d0b7d907;hp=a8e3e6c2e9d3cbf8ed93195804ce6d9995f5b5ee;hb=c3964cf29d0928b7c1decbd5a4d8dd38c3aff78a;hpb=6cd821d4594ba94ad387c9346119d71897f0489e diff --git a/opts.c b/opts.c index a8e3e6c..4d7d9a0 100644 --- a/opts.c +++ b/opts.c @@ -52,6 +52,8 @@ static void opts_setdefault() { opts_set(opts.warn, WARN_MULTIBYTE_CHARACTER, true); opts_set(opts.warn, WARN_UNKNOWN_PRAGMAS, true); opts_set(opts.warn, WARN_UNREACHABLE_CODE, true); + opts_set(opts.warn, WARN_CPP, true); + opts_set(opts.warn, WARN_UNKNOWN_ATTRIBUTE, true); /* flags */ opts_set(opts.flags, ADJUST_VECTOR_FIELDS, true); opts_set(opts.flags, FTEPP, false); @@ -62,7 +64,7 @@ void opts_init(const char *output, int standard, size_t arraysize) { opts_setdefault(); opts.output = output; - opts.standard = standard; + opts.standard = (opts_std_t)standard; /* C++ ... y u no like me? */ opts.max_array_size = arraysize; } @@ -168,7 +170,7 @@ static size_t opts_ini_parse ( char *read_name; char *read_value; - while (util_getline(&line, &linesize, filehandle) != EOF) { + while (file_getline(&line, &linesize, filehandle) != EOF) { parse_beg = line; /* handle BOM */ @@ -314,11 +316,11 @@ void opts_ini_init(const char *file) { if (!file) { /* try ini */ - if (!(ini = fopen((file = "gmqcc.ini"), "r"))) + if (!(ini = file_open((file = "gmqcc.ini"), "r"))) /* try cfg */ - if (!(ini = fopen((file = "gmqcc.cfg"), "r"))) + if (!(ini = file_open((file = "gmqcc.cfg"), "r"))) return; - } else if (!(ini = fopen(file, "r"))) + } else if (!(ini = file_open(file, "r"))) return; con_out("found ini file `%s`\n", file); @@ -329,5 +331,5 @@ void opts_ini_init(const char *file) { vec_free(error); } - fclose(ini); + file_close(ini); }