X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=opts.c;h=c1b0e630783137d07288b921c68debfb50464ed3;hb=da927b5d411f6503f969e7d2f46174fdf907c577;hp=43c4563454866d574f58bf2b9b35cd743ed73f0b;hpb=e8cd9411b0b03659a14f64225915ec23b696a81d;p=xonotic%2Fgmqcc.git diff --git a/opts.c b/opts.c index 43c4563..c1b0e63 100644 --- a/opts.c +++ b/opts.c @@ -57,6 +57,7 @@ static void opts_setdefault() { /* flags */ opts_set(opts.flags, ADJUST_VECTOR_FIELDS, true); opts_set(opts.flags, FTEPP, false); + opts_set(opts.flags, FTEPP_PREDEFS, false); opts_set(opts.flags, CORRECT_TERNARY, true); } @@ -64,7 +65,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; } @@ -170,7 +171,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 */ @@ -316,11 +317,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); @@ -331,5 +332,5 @@ void opts_ini_init(const char *file) { vec_free(error); } - fclose(ini); + file_close(ini); }