From 9e6a6b8c9305e4dd5cff5bd07632730e31bdd8a3 Mon Sep 17 00:00:00 2001 From: "J.A. de Jong - Redu-Sone B.V., ASCEE V.O.F" Date: Mon, 20 Dec 2021 14:21:03 +0100 Subject: [PATCH] Bugfixes for LASP_DEBUG definition to variable value. Not made correctly, resulting in release mode of code not working --- lasp/c/lasp_mat.c | 4 ++-- lasp/c/lasp_mat.h | 6 ++++-- lasp/c/lasp_tracer.h | 11 ++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lasp/c/lasp_mat.c b/lasp/c/lasp_mat.c index 6c39a15..bece9d3 100644 --- a/lasp/c/lasp_mat.c +++ b/lasp/c/lasp_mat.c @@ -12,7 +12,7 @@ #include -#ifdef LASP_DEBUG +#if LASP_DEBUG == 1 void print_dmat(const dmat* m) { fsTRACE(50); size_t row,col; @@ -49,6 +49,6 @@ void print_cmat(const cmat* m) { feTRACE(50); } -#endif +#endif // LASP_DEBUG == 1 ////////////////////////////////////////////////////////////////////// diff --git a/lasp/c/lasp_mat.h b/lasp/c/lasp_mat.h index a70c49d..3a349ae 100644 --- a/lasp/c/lasp_mat.h +++ b/lasp/c/lasp_mat.h @@ -578,7 +578,8 @@ static inline vd dmat_max(const dmat x) { } -#ifdef LASP_DEBUG +#if LASP_DEBUG == 1 + void print_cmat(const cmat* m); void print_dmat(const dmat* m); #define print_vc(x) assert_vx(x) print_cmat(x) @@ -589,7 +590,8 @@ void print_dmat(const dmat* m); #define print_dmat(m) #define print_vc(m) #define print_vd(m) -#endif + +#endif // LASP_DEBUG == 1 #endif // LASP_MAT_H ////////////////////////////////////////////////////////////////////// diff --git a/lasp/c/lasp_tracer.h b/lasp/c/lasp_tracer.h index f767168..5ebf689 100644 --- a/lasp/c/lasp_tracer.h +++ b/lasp/c/lasp_tracer.h @@ -18,11 +18,6 @@ static inline void clearScreen() { printf("\033c\n"); } -/** - * Indent the rule for tracing visibility. - */ -void indent_trace(); - // Some console colors #define RESET "\033[0m" #define BLACK "\033[30m" /* Black */ @@ -91,6 +86,7 @@ void indent_trace(); #define TRACER 1 #endif + #if TRACER == 1 #ifndef TRACERNAME @@ -103,6 +99,11 @@ void indent_trace(); #define TRACERNAME defaulttracer #endif // ifndef TRACERNAME +/** + * Indent the rule for tracing visibility. + */ +void indent_trace(); + // Define this preprocessor definition to overwrite // Use -O flag for compiler to remove the dead functions! // In that case all cout's for TRACE() are removed from code