Skip to content

Commit 3b97b80

Browse files
committed
Remove C-style typedefs for structs and enums
1 parent 602fc4e commit 3b97b80

File tree

8 files changed

+32
-33
lines changed

8 files changed

+32
-33
lines changed

src/core/io/src/legacy/4C_io_legacy_table.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ MAP* symbol_map(const SYMBOL* symbol)
904904
905905
*/
906906
/*----------------------------------------------------------------------*/
907-
typedef enum TokenType
907+
enum TokenType
908908
{
909909
tok_none,
910910
tok_done,
@@ -916,7 +916,7 @@ typedef enum TokenType
916916
tok_equal,
917917
tok_indent,
918918
tok_dedent
919-
} TOKEN_TYPE;
919+
};
920920

921921

922922
/*----------------------------------------------------------------------*/
@@ -933,14 +933,13 @@ typedef enum TokenType
933933
/*----------------------------------------------------------------------*/
934934
struct ParserData
935935
{
936-
TOKEN_TYPE tok;
936+
TokenType tok;
937937
char* token_string;
938938
int token_int;
939939
double token_real;
940940

941941
char* file_buffer;
942942
int file_size;
943-
/*char* filename;*/
944943

945944
int pos;
946945
int lineno;

src/core/io/src/legacy/4C_io_legacy_table_iter.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ FOUR_C_NAMESPACE_OPEN
1717
1818
*/
1919
/*----------------------------------------------------------------------*/
20-
void init_map_iterator(MAP_ITERATOR* iterator, MAP* map)
20+
void init_map_iterator(MapIterator* iterator, MAP* map)
2121
{
2222
iterator->stack.count = 0;
2323
iterator->map = map;
@@ -31,11 +31,11 @@ void init_map_iterator(MAP_ITERATOR* iterator, MAP* map)
3131
3232
*/
3333
/*----------------------------------------------------------------------*/
34-
static void push_map_node(MAP_ITERATOR* iterator, MapNode* map_node)
34+
static void push_map_node(MapIterator* iterator, MapNode* map_node)
3535
{
36-
STACK_ELEMENT* new_element;
36+
StackElement* new_element;
3737

38-
new_element = new STACK_ELEMENT;
38+
new_element = new StackElement;
3939
new_element->map_node = map_node;
4040
new_element->snext = iterator->stack.head.snext;
4141
iterator->stack.head.snext = new_element;
@@ -48,9 +48,9 @@ static void push_map_node(MAP_ITERATOR* iterator, MapNode* map_node)
4848
4949
*/
5050
/*----------------------------------------------------------------------*/
51-
static void pop_map_node(MAP_ITERATOR* iterator)
51+
static void pop_map_node(MapIterator* iterator)
5252
{
53-
STACK_ELEMENT* tmp_free;
53+
StackElement* tmp_free;
5454

5555
if (iterator->stack.count == 0)
5656
{
@@ -74,7 +74,7 @@ static void pop_map_node(MAP_ITERATOR* iterator)
7474
7575
*/
7676
/*----------------------------------------------------------------------*/
77-
int next_map_node(MAP_ITERATOR* iterator)
77+
int next_map_node(MapIterator* iterator)
7878
{
7979
int result = 0;
8080

@@ -129,6 +129,6 @@ int next_map_node(MAP_ITERATOR* iterator)
129129
130130
*/
131131
/*----------------------------------------------------------------------*/
132-
MapNode* iterator_get_node(MAP_ITERATOR* iterator) { return iterator->stack.head.snext->map_node; }
132+
MapNode* iterator_get_node(MapIterator* iterator) { return iterator->stack.head.snext->map_node; }
133133

134134
FOUR_C_NAMESPACE_CLOSE

src/core/io/src/legacy/4C_io_legacy_table_iter.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ FOUR_C_NAMESPACE_OPEN
2020
2121
*/
2222
/*----------------------------------------------------------------------*/
23-
typedef struct StackElement
23+
struct StackElement
2424
{
2525
struct StackElement* snext;
2626
MapNode* map_node;
27-
} STACK_ELEMENT;
27+
};
2828

2929

3030
/*----------------------------------------------------------------------*/
@@ -33,11 +33,11 @@ typedef struct StackElement
3333
3434
*/
3535
/*----------------------------------------------------------------------*/
36-
typedef struct Stack
36+
struct Stack
3737
{
3838
int count;
39-
STACK_ELEMENT head;
40-
} STACK;
39+
StackElement head;
40+
};
4141

4242

4343
/*----------------------------------------------------------------------*/
@@ -49,18 +49,18 @@ typedef struct Stack
4949
5050
*/
5151
/*----------------------------------------------------------------------*/
52-
typedef struct MapIterator
52+
struct MapIterator
5353
{
5454
MAP* map;
55-
STACK stack;
56-
} MAP_ITERATOR;
55+
Stack stack;
56+
};
5757

5858

59-
void init_map_iterator(MAP_ITERATOR* iterator, MAP* map);
59+
void init_map_iterator(MapIterator* iterator, MAP* map);
6060

61-
int next_map_node(MAP_ITERATOR* iterator);
61+
int next_map_node(MapIterator* iterator);
6262

63-
MapNode* iterator_get_node(MAP_ITERATOR* iterator);
63+
MapNode* iterator_get_node(MapIterator* iterator);
6464

6565
FOUR_C_NAMESPACE_CLOSE
6666

src/fsi/src/4C_fsi_dyn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ void fsi_ale_drt()
480480

481481
const Teuchos::ParameterList& fsidyn = problem->fsi_dynamic_params();
482482

483-
auto coupling = Teuchos::getIntegralValue<FSI_COUPLING>(fsidyn, "COUPALGO");
483+
auto coupling = Teuchos::getIntegralValue<FsiCoupling>(fsidyn, "COUPALGO");
484484
switch (coupling)
485485
{
486486
case fsi_iter_monolithicfluidsplit:

src/inpar/4C_inpar_bio.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ namespace Core::Conditions
2929
This is the enumeration of all types of different integration schemes
3030
3131
*-----------------------------------------------------------------------*/
32-
typedef enum RedAirwaysDyntype
32+
enum RedAirwaysDyntype
3333
{
3434
one_step_theta,
3535
linear,
3636
nonlinear
37-
} _RED_AIRWAYS_DYNTYPE;
37+
};
3838

3939

4040
namespace Inpar

src/inpar/4C_inpar_fsi.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace Core::Conditions
2626
/*----------------------------------------------------------------------*/
2727
/* The coupling methods for FSI. */
2828
/*----------------------------------------------------------------------*/
29-
typedef enum FsiCoupling
29+
enum FsiCoupling
3030
{
3131
fsi_coupling_freesurface = -1,
3232
fsi_coupling_undefined = 0,
@@ -57,7 +57,7 @@ typedef enum FsiCoupling
5757
fsi_iter_sliding_monolithicfluidsplit,
5858
fsi_iter_sliding_monolithicstructuresplit,
5959
fsi_iter_mortar_monolithicfluidsplit_saddlepoint
60-
} FSI_COUPLING;
60+
};
6161

6262
namespace Inpar
6363
{

src/mat/elast/4C_mat_elast_aniso_structuraltensor_strategy.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ namespace Mat
2424
{
2525
namespace PAR
2626
{
27-
typedef enum DistrType
27+
enum DistrType
2828
{
2929
distr_type_undefined = 0,
3030
distr_type_vonmisesfisher = 1,
3131
distr_type_bingham = 2
32-
} DISTR_TYPE_;
32+
};
3333

34-
typedef enum StrategyType
34+
enum StrategyType
3535
{
3636
strategy_type_undefined = 0,
3737
strategy_type_standard = 1,
3838
strategy_type_bydistributionfunction = 2,
3939
strategy_type_dispersedtransverselyisotropic = 3
40-
} STRATEGY_TYPE_;
40+
};
4141

4242
/*!
4343
* @brief material parameters for generalized structural tensor with distribution

src/post/4C_post_filter_base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void PostFilterBase::write_any_results(PostField* field, const char* type, const
4747
PostResult result = PostResult(field);
4848
result.next_result();
4949

50-
MAP_ITERATOR iter;
50+
MapIterator iter;
5151
init_map_iterator(&iter, result.group());
5252

5353
while (next_map_node(&iter))

0 commit comments

Comments
 (0)