Commit 73d6876b authored by Alessandro Rubini's avatar Alessandro Rubini

ppsi.h and */startup: define and use CONST_VERBOSITY

According to configuration, pp_diag_verbosity can be "const" or not
(having it const saves a lot of space and we need it in our
white-rabbit core).

This avoids errors when building for all architectures, with or
without CONFIG_PPSI_RUNTIME_VERBOSITY.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent a3330973
......@@ -22,7 +22,7 @@ void ppsi_clear_bss(void)
static struct pp_instance ppi_static;
static struct pp_net_path net_path_static;
int pp_diag_verbosity = 0;
CONST_VERBOSITY int pp_diag_verbosity = 0;
/* ppi fields */
static UInteger16 sent_seq_id[16];
......
......@@ -22,7 +22,7 @@ void ppsi_clear_bss(void)
static struct pp_instance ppi_static;
static struct pp_net_path net_path_static;
int pp_diag_verbosity = 0;
CONST_VERBOSITY int pp_diag_verbosity = 0;
/* ppi fields */
static UInteger16 sent_seq_id[16];
......
......@@ -15,7 +15,7 @@
#include <ppsi/diag.h>
#include "posix.h"
int pp_diag_verbosity = 0;
CONST_VERBOSITY int pp_diag_verbosity = 0;
int main(int argc, char **argv)
{
......
......@@ -23,6 +23,7 @@
#define PP_FATAL(ppi,s1,s2) if pp_diag_fatal(ppi,s1,s2)
#ifdef CONFIG_PPSI_RUNTIME_VERBOSITY
#define CONST_VERBOSITY /* nothing: use "int pp_diag_verbosity" */
extern int pp_diag_verbosity;
#define PP_VFSM(ppi,seq,len) if (pp_diag_verbosity) pp_diag_fsm(ppi,seq,len)
......@@ -33,7 +34,7 @@ extern int pp_diag_verbosity;
#else
extern const int pp_diag_verbosity;
#define CONST_VERBOSITY const /* use "const int pp_diag_verbosity */
#if CONFIG_PPSI_VERBOSITY > 0
#define PP_VFSM(ppi,seq,len) if (pp_diag_verbosity) pp_diag_fsm(ppi,seq,len)
......@@ -51,6 +52,8 @@ extern const int pp_diag_verbosity;
#endif /* CONFIG_PPSI_RUNTIME_VERBOSITY */
extern CONST_VERBOSITY int pp_diag_verbosity;
/*
* Runtime options. Default values can be overridden by command line.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment