Skip to content

Commit

Permalink
Maintenance: Remove unused macros (#644)
Browse files Browse the repository at this point in the history
Add -Wunused-macros and -Wunused-local-typedefs with ENABLE_ALL_WARNINGS

--------

Co-authored-by: David Gardner <gardner48@llnl.gov>
  • Loading branch information
Steven-Roberts and gardner48 authored Jan 18, 2025
1 parent f963373 commit 72b88cc
Show file tree
Hide file tree
Showing 193 changed files with 517 additions and 576 deletions.
9 changes: 4 additions & 5 deletions benchmarks/diffusion_2D/diffusion_2D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@
#endif

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
3 changes: 2 additions & 1 deletion cmake/SundialsSetupCompilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ if(ENABLE_ALL_WARNINGS)
set(WARNING_FLAGS
"-Wno-unknown-warning-option -Wall -Wpedantic -Wextra -Wshadow \
-Wwrite-strings -Wcast-align -Wdisabled-optimization -Wvla -Walloca \
-Wduplicated-cond -Wduplicated-branches")
-Wduplicated-cond -Wduplicated-branches -Wunused-macros \
-Wunused-local-typedefs")
# TODO(SBR): Try to add -Wredundant-decls once SuperLU version is updated in
# CI tests

Expand Down
9 changes: 4 additions & 5 deletions examples/arkode/CXX_parallel/ark_heat2D_lsrk_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@
#include "sunadaptcontroller/sunadaptcontroller_soderlind.h"

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
9 changes: 4 additions & 5 deletions examples/arkode/CXX_parallel/ark_heat2D_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@
#include "sunlinsol/sunlinsol_spgmr.h" // access to SPGMR SUNLinearSolver

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
9 changes: 4 additions & 5 deletions examples/arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@
#include "sundials/sundials_matrix.h" // definition SUNMatrix

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
9 changes: 4 additions & 5 deletions examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@
#include "sunlinsol/sunlinsol_spgmr.h" // access to SPGMR SUNLinearSolver

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
9 changes: 4 additions & 5 deletions examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@
#include "sunlinsol/sunlinsol_spgmr.h" // access to GMRES SUNLinearSolver

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
9 changes: 4 additions & 5 deletions examples/arkode/CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@
#include "sunlinsol/sunlinsol_spgmr.h" // access to GMRES SUNLinearSolver

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
2 changes: 0 additions & 2 deletions examples/arkode/CXX_serial/ark_analytic_sys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@
#include <sunmatrix/sunmatrix_dense.h> // access to dense SUNMatrix

#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif
Expand Down
9 changes: 4 additions & 5 deletions examples/arkode/CXX_serial/ark_heat2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,10 @@
#include "sunlinsol/sunlinsol_spgmr.h" // access to SPGMR SUNLinearSolver

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
9 changes: 4 additions & 5 deletions examples/arkode/CXX_serial/ark_heat2D_lsrk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@
#include "sunadaptcontroller/sunadaptcontroller_soderlind.h"

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
2 changes: 0 additions & 2 deletions examples/arkode/CXX_serial/ark_kpr_Mt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@
#include <vector>

#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif
Expand Down
9 changes: 4 additions & 5 deletions examples/arkode/CXX_xbraid/ark_heat2D_hypre_pfmg_xbraid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@
#include "sunlinsol/sunlinsol_spgmr.h" // access to SPGMR SUNLinearSolver

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
9 changes: 4 additions & 5 deletions examples/arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@
#include "sunlinsol/sunlinsol_spgmr.h" // access to SPGMR SUNLinearSolver

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
9 changes: 4 additions & 5 deletions examples/arkode/CXX_xbraid/ark_heat2D_xbraid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@
#include "sunlinsol/sunlinsol_spgmr.h" // access to SPGMR SUNLinearSolver

// Macros for problem constants
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)
#define EIGHT SUN_RCONST(8.0)
#define PI SUN_RCONST(3.141592653589793238462643383279502884197169)
#define ZERO SUN_RCONST(0.0)
#define ONE SUN_RCONST(1.0)
#define TWO SUN_RCONST(2.0)

// Macro to access (x,y) location in 1D NVector array
#define IDX(x, y, n) ((n) * (y) + (x))
Expand Down
2 changes: 0 additions & 2 deletions examples/arkode/C_openmpdev/ark_analytic_nonlin_ompdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@
#endif

#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif
Expand Down
2 changes: 0 additions & 2 deletions examples/arkode/C_openmpdev/ark_heat1D_adapt_ompdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@
#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif

/* constants */
Expand Down
2 changes: 0 additions & 2 deletions examples/arkode/C_serial/ark_analytic_nonlin.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@
#include <sundials/sundials_types.h> /* def. of type 'sunrealtype' */

#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif
Expand Down
4 changes: 0 additions & 4 deletions examples/arkode/C_serial/ark_analytic_partitioned.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,8 @@

#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif

typedef struct
Expand Down
4 changes: 0 additions & 4 deletions examples/arkode/C_serial/ark_conserved_exp_entropy_ark.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,9 @@

/* Convince macros for using precision-specific format specifiers */
#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif

/* ----------------------- *
Expand Down
4 changes: 0 additions & 4 deletions examples/arkode/C_serial/ark_conserved_exp_entropy_erk.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,9 @@

/* Convince macros for using precision-specific format specifiers */
#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif

/* ----------------------- *
Expand Down
19 changes: 6 additions & 13 deletions examples/arkode/C_serial/ark_dissipated_exp_entropy.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,21 @@

/* Convince macros for calling precision-specific math functions */
#if defined(SUNDIALS_DOUBLE_PRECISION)
#define EXP(x) (exp((x)))
#define SQRT(x) (sqrt((x)))
#define LOG(x) (log((x)))
#define EXP(x) (exp((x)))
#define LOG(x) (log((x)))
#elif defined(SUNDIALS_SINGLE_PRECISION)
#define EXP(x) (expf((x)))
#define SQRT(x) (sqrtf((x)))
#define LOG(x) (logf((x)))
#define EXP(x) (expf((x)))
#define LOG(x) (logf((x)))
#elif defined(SUNDIALS_EXTENDED_PRECISION)
#define EXP(x) (expl((x)))
#define SQRT(x) (sqrtl((x)))
#define LOG(x) (logl((x)))
#define EXP(x) (expl((x)))
#define LOG(x) (logl((x)))
#endif

/* Convince macros for using precision-specific format specifiers */
#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif

/* ----------------------- *
Expand Down
2 changes: 0 additions & 2 deletions examples/arkode/C_serial/ark_heat1D_adapt.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@
#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif

/* constants */
Expand Down
2 changes: 0 additions & 2 deletions examples/arkode/C_serial/ark_robertson.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@
#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif

/* User-supplied Functions Called by the Solver */
Expand Down
2 changes: 0 additions & 2 deletions examples/arkode/C_serial/ark_robertson_constraints.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@
#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif

/* User-supplied Functions Called by the Solver */
Expand Down
2 changes: 0 additions & 2 deletions examples/arkode/C_serial/ark_robertson_root.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@
#if defined(SUNDIALS_EXTENDED_PRECISION)
#define GSYM "Lg"
#define ESYM "Le"
#define FSYM "Lf"
#else
#define GSYM "g"
#define ESYM "e"
#define FSYM "f"
#endif

/* User-supplied Functions Called by the Solver */
Expand Down
Loading

0 comments on commit 72b88cc

Please sign in to comment.