X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=opts.c;h=c2e019e28a9ff932bf060c93de7412de2050e832;hp=aa923bdeafebd93d42261f4f97e183a89e71f6e6;hb=ef565adaa5a4fc05efee86fb96df25fbd03d978e;hpb=3593a1b6b89ff690b8e89a31707468aad014b7b1 diff --git a/opts.c b/opts.c index aa923bd..c2e019e 100644 --- a/opts.c +++ b/opts.c @@ -1,7 +1,7 @@ /* * 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 @@ -64,6 +64,7 @@ static void opts_setdefault() { 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() { @@ -96,6 +97,7 @@ void opts_init(const char *output, int standard, size_t arraysize) { 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) { @@ -142,6 +144,9 @@ void opts_setoptimlevel(unsigned int level) { 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; } /* @@ -254,7 +259,7 @@ static size_t opts_ini_parse ( 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) { @@ -264,7 +269,7 @@ static char *opts_ini_load(const char *section, const char *name, const char *va /* * 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 @@ -342,7 +347,7 @@ void opts_ini_init(const char *file) { size_t line; FILE *ini; - + if (!file) { /* try ini */ if (!(ini = fs_file_open((file = "gmqcc.ini"), "r"))) @@ -361,4 +366,4 @@ void opts_ini_init(const char *file) { } fs_file_close(ini); -} +}