/*
* Copyright (C) 2012, 2013
* Wolfgang Bumiller
- * Dale Weiler
+ * Dale Weiler
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
opts_set(opts.flags, BAIL_ON_WERROR, true);
opts_set(opts.flags, LEGACY_VECTOR_MATHS, true);
opts_set(opts.flags, DARKPLACES_STRING_TABLE_BUG, true);
+
}
void opts_backup_non_Wall() {
OPTS_OPTION_STR(OPTION_OUTPUT) = (char*)output;
OPTS_OPTION_U32(OPTION_STANDARD) = standard;
OPTS_OPTION_U32(OPTION_MAX_ARRAY_SIZE) = arraysize;
+ OPTS_OPTION_U16(OPTION_MEMDUMPCOLS) = 16;
}
static bool opts_setflag_all(const char *name, bool on, uint32_t *flags, const opts_flag_def *list, size_t listsize) {
size_t i;
for (i = 0; i < COUNT_OPTIMIZATIONS; ++i)
opts_set(opts.optimization, i, level >= opts_opt_oflag[i]);
+
+ if (!level)
+ opts.optimizeoff = true;
}
/*
char *read_name;
char *read_value;
- while (file_getline(&line, &linesize, filehandle) != EOF) {
+ while (fs_file_getline(&line, &linesize, filehandle) != EOF) {
parse_beg = line;
/* handle BOM */
/* section found */
if (*(parse_end = opts_ini_next(parse_beg + 1, ']')) == ']') {
* parse_end = '\0'; /* terminate bro */
- 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) {
opts_ini_rstrip(read_value);
/* valid name value pair, lets call down to handler */
- 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)
static bool opts_ini_bool(const char *value) {
if (!strcmp(value, "true")) return true;
if (!strcmp(value, "false")) return false;
- return !!atoi(value);
+ return !!strtol(value, NULL, 10);
}
static char *opts_ini_load(const char *section, const char *name, const char *value) {
/*
* undef all of these because they may still be defined like in my
* case they where.
- */
+ */
#undef GMQCC_TYPE_FLAGS
#undef GMQCC_TYPE_OPTIMIZATIONS
#undef GMQCC_TYPE_WARNS
size_t line;
FILE *ini;
-
+
if (!file) {
/* try ini */
- if (!(ini = file_open((file = "gmqcc.ini"), "r")))
+ if (!(ini = fs_file_open((file = "gmqcc.ini"), "r")))
/* try cfg */
- if (!(ini = file_open((file = "gmqcc.cfg"), "r")))
+ if (!(ini = fs_file_open((file = "gmqcc.cfg"), "r")))
return;
- } else if (!(ini = file_open(file, "r")))
+ } else if (!(ini = fs_file_open(file, "r")))
return;
con_out("found ini file `%s`\n", file);
vec_free(error);
}
- file_close(ini);
-}
+ fs_file_close(ini);
+}