X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=opts.cpp;h=c35fd73e2fb23a7752b091993dc021dfce174043;hp=bc728248ba6786db126f46d40267446104abdbbb;hb=27c0886ffbd1065183f21bc94c95234641fe9932;hpb=65362d93aa4678209bfeeba92fb5aa41f5955777 diff --git a/opts.cpp b/opts.cpp index bc72824..c35fd73 100644 --- a/opts.cpp +++ b/opts.cpp @@ -14,21 +14,21 @@ const opts_flag_def_t opts_opt_list[COUNT_OPTIMIZATIONS+1] = { # define GMQCC_TYPE_OPTIMIZATIONS # define GMQCC_DEFINE_FLAG(NAME, MIN_O) { #NAME, LONGBIT(OPTIM_##NAME) }, # include "opts.def" - { NULL, LONGBIT(0) } + { nullptr, LONGBIT(0) } }; const opts_flag_def_t opts_warn_list[COUNT_WARNINGS+1] = { # define GMQCC_TYPE_WARNS # define GMQCC_DEFINE_FLAG(X) { #X, LONGBIT(WARN_##X) }, # include "opts.def" - { NULL, LONGBIT(0) } + { nullptr, LONGBIT(0) } }; const opts_flag_def_t opts_flag_list[COUNT_FLAGS+1] = { # define GMQCC_TYPE_FLAGS # define GMQCC_DEFINE_FLAG(X) { #X, LONGBIT(X) }, # include "opts.def" - { NULL, LONGBIT(0) } + { nullptr, LONGBIT(0) } }; unsigned int opts_optimizationcount[COUNT_OPTIMIZATIONS]; @@ -149,9 +149,9 @@ void opts_set(uint32_t *flags, size_t idx, bool on) { LONGBIT_SET(lb, idx); if (on) - flags[lb.idx] |= (1<<(lb.bit)); + flags[lb.idx] |= (1u<<(lb.bit)); else - flags[lb.idx] &= ~(1<<(lb.bit)); + flags[lb.idx] &= ~(1u<<(lb.bit)); } void opts_setoptimlevel(unsigned int level) { @@ -200,7 +200,7 @@ static size_t opts_ini_parse ( size_t linesize; size_t lineno = 1; size_t error = 0; - char *line = NULL; + char *line = nullptr; char section_data[2048] = ""; char oldname_data[2048] = ""; @@ -287,11 +287,11 @@ 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 !!strtol(value, NULL, 10); + return !!strtol(value, nullptr, 10); } static char *opts_ini_load(const char *section, const char *name, const char *value, char **parse_file) { - char *error = NULL; + char *error = nullptr; bool found = false; /* @@ -396,8 +396,8 @@ void opts_ini_init(const char *file) { * gmqcc.ini * gmqcc.cfg */ - char *error = NULL; - char *parse_file = NULL; + char *error = nullptr; + char *parse_file = nullptr; size_t line; FILE *ini;