correct extern declarations
authorMazet Laurent <laurent.mazet@thalesgroup.com>
Mon, 19 May 2025 09:21:52 +0000 (11:21 +0200)
committerMazet Laurent <laurent.mazet@thalesgroup.com>
Mon, 19 May 2025 09:21:52 +0000 (11:21 +0200)
cryptomod.c
morep.c
morep_test.c
morep_valid.c
simulator.c
verbose.h

index 0648fc57723b3f50185bd70709a746e9a3aedf2b..4bdb8e65e65a2aa09883c44015f23dc557203086 100644 (file)
@@ -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 75454cef9f8875c832d71294046b7b1ede2daec1..7b1e793dea0b49ee86b7b3189a76a4116d7a6b19 100644 (file)
--- 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 <assert.h>
 #include <unistd.h>
 
 #include "verbose.h"
-
 #include "morep.h"
 
+DECLARE_VERBOSE_LEVEL (morep, INFO);
+
 #define MAC_ADDR_STRING 18
 
 /**
index 8fa7068ab459503560dd27c1248374e500233bd1..02b8578ad71f71d92f4c1613b25b1e2de6a8550e 100644 (file)
@@ -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
index a80d815a1459a218d53cc794cac7dbf8de6b0e66..6d3d246eec6515d29103d549ad45ef455a2c9338 100644 (file)
@@ -35,8 +35,6 @@ char *progname = NULL;
 
 int stop = 0;
 
-DECLARE_VERBOSE_LEVEL (morep, INFO);
-
 #define BUFMAX 4096
 
 void sig_handler (int sig)
index 99fdd88b2f7550c7897bda32e4be4476e0d6550d..516c49acad40c40dafdbfc07c9915e18667510ef 100644 (file)
@@ -41,7 +41,6 @@ char *progname = NULL;
 
 int stop = 0;
 
-DECLARE_VERBOSE_LEVEL (morep, INFO);
 DECLARE_VERBOSE_LEVEL (simul, INFO);
 
 #define BUFMAX 4096
index b69fa306b34153c326f871fe7b5be9c1c4f3794a..19a02334e47477d3371acc093d177f6ddedf370a 100644 (file)
--- 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