From b846357e884c22027e87291f2e4f7b2dac557860 Mon Sep 17 00:00:00 2001 From: Mazet Laurent Date: Mon, 19 May 2025 11:21:52 +0200 Subject: [PATCH] correct extern declarations --- cryptomod.c | 1 - morep.c | 5 +++-- morep_test.c | 2 -- morep_valid.c | 2 -- simulator.c | 1 - verbose.h | 6 ++++-- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/cryptomod.c b/cryptomod.c index 0648fc5..4bdb8e6 100644 --- a/cryptomod.c +++ b/cryptomod.c @@ -40,7 +40,6 @@ char *progname = NULL; -DECLARE_VERBOSE_LEVEL (morep, INFO); DECLARE_VERBOSE_LEVEL (crypto, INFO); #define BUFMAX 4096 diff --git a/morep.c b/morep.c index 75454ce..7b1e793 100644 --- a/morep.c +++ b/morep.c @@ -4,7 +4,7 @@ Copyright Thales 20250319 */ -/* include: def.h parse.h pdu_bypass.h pdu_channel.h pdu_clear_data.h pdu_encrypted_data.h pdu_key.h pdu_prng_param.h pdu_raw_data.h pdu_status.h verbose.h */ +/* include: def.h morep.h parse.h pdu_bypass.h pdu_channel.h pdu_clear_data.h pdu_encrypted_data.h pdu_key.h pdu_prng_param.h pdu_raw_data.h pdu_status.h verbose.h */ /* archive: parse.o pdu_bypass.o pdu_channel.o pdu_clear_data.o pdu_encrypted_data.o pdu_key.o pdu_prng_param.o pdu_raw_data.o pdu_status.o */ #include @@ -28,9 +28,10 @@ #include #include "verbose.h" - #include "morep.h" +DECLARE_VERBOSE_LEVEL (morep, INFO); + #define MAC_ADDR_STRING 18 /** diff --git a/morep_test.c b/morep_test.c index 8fa7068..02b8578 100644 --- a/morep_test.c +++ b/morep_test.c @@ -31,8 +31,6 @@ char *progname = NULL; int stop = 0; -DECLARE_VERBOSE_LEVEL (morep, INFO); - char *words[] = {"Quo", "cognito", "Constantius", "ultra", "mortalem", "modum", "exarsit", "ac", "nequo", "casu", "idem", "Gallus", "de", "futuris", "incertus", "agitare", "quaedam", "conducentia", "saluti", "suae", "per", "itinera", "conaretur,", "remoti", "sunt", "omnes", "de", "industria", "milites", "agentes", "in", "civitatibus", "perviis.", NULL}; #define BUFMAX 4096 diff --git a/morep_valid.c b/morep_valid.c index a80d815..6d3d246 100644 --- a/morep_valid.c +++ b/morep_valid.c @@ -35,8 +35,6 @@ char *progname = NULL; int stop = 0; -DECLARE_VERBOSE_LEVEL (morep, INFO); - #define BUFMAX 4096 void sig_handler (int sig) diff --git a/simulator.c b/simulator.c index 99fdd88..516c49a 100644 --- a/simulator.c +++ b/simulator.c @@ -41,7 +41,6 @@ char *progname = NULL; int stop = 0; -DECLARE_VERBOSE_LEVEL (morep, INFO); DECLARE_VERBOSE_LEVEL (simul, INFO); #define BUFMAX 4096 diff --git a/verbose.h b/verbose.h index b69fa30..19a0233 100644 --- a/verbose.h +++ b/verbose.h @@ -132,7 +132,8 @@ __BEGIN_DECLS @param module module name @return verbose errors */ -#define GET_VERBOSE_ERRORS(module) verbose_errors_##module +#define GET_VERBOSE_ERRORS(module) \ + ({ extern int verbose_errors_##module; verbose_errors_##module; }) /** Get verbose level. @@ -140,7 +141,8 @@ __BEGIN_DECLS @param module module name @return verbose level */ -#define GET_VERBOSE_LEVEL(module) verbose_##module +#define GET_VERBOSE_LEVEL(module) \ + ({ extern int verbose_##module; verbose_##module; }) __END_DECLS -- 2.30.2