From c33cb7afd02b1ee92e462574ba54b671895ee8c0 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Thu, 7 Jun 2018 11:58:08 +0200 Subject: [PATCH] core: use a structure for preprocessor defines - used to be an array of two str - store type of define operation in structure --- src/core/cfg.lex | 64 +++++++++++++++++++++++++----------------------- src/core/ppcfg.h | 6 +++++ 2 files changed, 39 insertions(+), 31 deletions(-) diff --git a/src/core/cfg.lex b/src/core/cfg.lex index 9801dd34361..65507e7dfb0 100644 --- a/src/core/cfg.lex +++ b/src/core/cfg.lex @@ -1704,7 +1704,7 @@ static int sr_pop_yy_state() /* define/ifdef support */ #define MAX_DEFINES 256 -static str pp_defines[MAX_DEFINES][2]; +static ksr_ppdefine_t pp_defines[MAX_DEFINES]; static int pp_num_defines = 0; static int pp_define_type = 0; static int pp_define_index = -1; @@ -1721,7 +1721,7 @@ str* pp_get_define_name(int idx) { if(idx<0 || idx>=pp_num_defines) return NULL; - return &pp_defines[idx][0]; + return &pp_defines[idx].name; } static int pp_lookup(int len, const char * text) @@ -1730,7 +1730,7 @@ static int pp_lookup(int len, const char * text) int i; for (i=0; i