Skip to content

Commit

Permalink
Fix modernize-macro-to-enum (#46)
Browse files Browse the repository at this point in the history
* Fix modernize-macro-to-enum.

* Avoid misc-non-private-member-variables-in-classes for now.
  • Loading branch information
jrood-nrel authored Jul 25, 2024
1 parent e33e91d commit 7ee3fad
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 40 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Checks: 'bugprone-*,
clang-analyzer-*,
corecppguidelines-*,
misc-*,
-misc-non-private-member-variables-in-classes,
mpi-*,
modernize-*,
-modernize-use-nodiscard,
Expand Down
4 changes: 1 addition & 3 deletions src/MeshBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ class CartGrid;
* 02/20/2014
*/

#define FRINGE -1
#define HOLE 0
#define FIELD 1
enum { FRINGE = -1, HOLE = 0, FIELD = 1 };

class MeshBlock
{
Expand Down
3 changes: 1 addition & 2 deletions src/cartOps.C
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
#include "codetypes.h"
#include "MeshBlock.h"
#include "tioga_math.h"
#define ROW 0
#define COLUMN 1
enum { ROW = 0, COLUMN = 1 };

void MeshBlock::setCartIblanks()
{
Expand Down
45 changes: 20 additions & 25 deletions src/codetypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ typedef int32_t qcoord_t;
/*====================================================================*/
/* Base for indexing (0 or 1) */
/*====================================================================*/
#define BASE 1
enum { BASE = 1 };

/*====================================================================*/
/* Define arithmetic constants */
Expand All @@ -54,23 +54,25 @@ typedef int32_t qcoord_t;
// #define RAD2DEG (180.0/PI)
// #define DEG2RAD (PI/180.0)
#define BIGVALUE 1.0e+15
#define BIGINT 2147483647
enum { BIGINT = 2147483647 };
#define TOL 1.0e-10
#define HOLEMAPSIZE 192
// #define NFRINGE 3
// #define NVAR 6
#define WALLNODETYPE 0
#define OUTERNODETYPE 1
/*==================================================================*/
/* ADAPTIVE HOLE MAP OCTANT INFO */
/*==================================================================*/
#define INTERSECT_ALG \
1 // [0] point-box inclusion only
// [1] face-box intersection (water-tight)
enum {
HOLEMAPSIZE = 192,
// #define NFRINGE 3
// #define NVAR 6
WALLNODETYPE = 0,
OUTERNODETYPE = 1,
/*==================================================================*/
/* ADAPTIVE HOLE MAP OCTANT INFO */
/*==================================================================*/
INTERSECT_ALG = 1 // [0] point-box inclusion only
};
// [1] face-box intersection (water-tight)

#define NON_UNIQUE_NODES \
1 // [0] wbc nodes are NOT listed as obc nodes
// [1] wbc nodes may also be listed as obc nodes
enum {
NON_UNIQUE_NODES = 1 // [0] wbc nodes are NOT listed as obc nodes
};
// [1] wbc nodes may also be listed as obc nodes

/* Fixed Octree Constraints: Do Not Change */
#define OCTANT_MAXLEVEL 30 // 32-bit integer
Expand All @@ -83,9 +85,7 @@ typedef int32_t qcoord_t;
/** Conversion from integer coordinates to double coordinates */
#define INT2DBL ((double)1.0 / (double)OCTANT_ROOT_LEN)

#define OUTSIDE_SB 0
#define INSIDE_SB 1
#define WALL_SB 2
enum { OUTSIDE_SB = 0, INSIDE_SB = 1, WALL_SB = 2 };
/*==================================================================*/
/* inline debugging tools */
/*==================================================================*/
Expand All @@ -110,12 +110,7 @@ typedef int32_t qcoord_t;
/*===================================================================*/
/* Code specific types */
/*===================================================================*/
#define XLO 0
#define XHI 1
#define YLO 2
#define YHI 3
#define ZLO 4
#define ZHI 5
enum { XLO = 0, XHI = 1, YLO = 2, YHI = 3, ZLO = 4, ZHI = 5 };

/* Mesh Block Complement/Composite Rank Data */
class meshblockCompInfo
Expand Down
3 changes: 1 addition & 2 deletions src/dataUpdate.C
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#include "codetypes.h"
#include "MeshBlock.h"

#define ROW 0
#define COLUMN 1
enum { ROW = 0, COLUMN = 1 };

void MeshBlock::getInterpolatedSolution(
int* nints,
Expand Down
2 changes: 1 addition & 1 deletion src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "tioga.h"
using namespace TIOGA;
#define MAXBLOCKS 100
enum { MAXBLOCKS = 100 };
tioga* tg;
/*
** pointer storage for connectivity arrays that
Expand Down
4 changes: 1 addition & 3 deletions src/highOrder.C
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
#include "tioga_utils.h"
#include "tioga_math.h"

#define ROW 0
#define COLUMN 1
#define NFRAC 1331
enum { ROW = 0, COLUMN = 1, NFRAC = 1331 };

void MeshBlock::getCellIblanks2()
{
Expand Down
3 changes: 1 addition & 2 deletions src/kaiser.C
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include "kaiser.h"
#include <cmath>

#define NROWS 3
#define NCOLS 3
enum { NROWS = 3, NCOLS = 3 };

// This functions expects a 3x3 matrix
void kaiser(
Expand Down
4 changes: 2 additions & 2 deletions src/tioga.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
* meshes containing element and node IDs greater than what a 4-byte signed int
* can support
*/
#define TIOGA_HAS_UINT64T 1
enum { TIOGA_HAS_UINT64T = 1 };

/** Define a macro entry flagging whether TIOGA has hetereogenous execution
* space support, and uses the new API for registering mesh/solution data
*/
#define TIOGA_HAS_NGP_IFACE 1
enum { TIOGA_HAS_NGP_IFACE = 1 };

/**
* Topology Independent Overset Grid Assembler (TIOGA)
Expand Down

0 comments on commit 7ee3fad

Please sign in to comment.