Skip to content

Commit

Permalink
fix: improve ifndef macro names
Browse files Browse the repository at this point in the history
  • Loading branch information
hozlucas28 committed Sep 24, 2024
1 parent c7d96ca commit f60fc2c
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 38 deletions.
6 changes: 3 additions & 3 deletions libs/game/macros.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef GAME_MACROS_H_INCLUDED
#define GAME_MACROS_H_INCLUDED
#ifndef LIBS_GAME_MACROS_H_INCLUDED
#define LIBS_GAME_MACROS_H_INCLUDED

/**
* @def DASHBOARD_ROWS
Expand Down Expand Up @@ -68,4 +68,4 @@
*/
#define NEIGHBORHOOD_RADIUS 1

#endif // GAME_MACROS_H_INCLUDED
#endif // LIBS_GAME_MACROS_H_INCLUDED
6 changes: 3 additions & 3 deletions libs/game/main.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

#ifndef GAME_MAIN_H_INCLUDED
#define GAME_MAIN_H_INCLUDED
#ifndef LIBS_GAME_MAIN_H_INCLUDED
#define LIBS_GAME_MAIN_H_INCLUDED

// Root
#include "./macros.h"
#include "./methods.h"
#include "./structs.h"

#endif // GAME_MAIN_H_INCLUDED
#endif // LIBS_GAME_MAIN_H_INCLUDED
7 changes: 6 additions & 1 deletion libs/game/methods.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

#ifndef LIBS_GAME_METHODS_H_INCLUDED
#define LIBS_GAME_METHODS_H_INCLUDED

#include "../patterns/main.h"
#include "./structs.h"

Expand Down Expand Up @@ -105,4 +108,6 @@ void setDashboardCenter(TGame* pGame);
*
* @warning This function assumes that `pGame` has been properly initialized.
*/
void startGameByConsole(TGame* pGame, int maxGeneration, int delayBetweenGenerations);
void startGameByConsole(TGame* pGame, int maxGeneration, int delayBetweenGenerations);

#endif // LIBS_GAME_MAIN_H_INCLUDED
8 changes: 4 additions & 4 deletions libs/game/structs.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

#include "../main.h"
#ifndef LIBS_GAME_STRUCTS_H_INCLUDED
#define LIBS_GAME_STRUCTS_H_INCLUDED

#ifndef GAME_STRUCTS_H_INCLUDED
#define GAME_STRUCTS_H_INCLUDED
#include "../main.h"

/**
* @struct TGame
Expand All @@ -25,4 +25,4 @@ typedef struct {
int delayBetweenGenerations; /** Delay time in milliseconds for processed the next generation.*/
} TGame;

#endif // GAME_STRUCTS_H_INCLUDED
#endif // LIBS_GAME_STRUCTS_H_INCLUDED
6 changes: 3 additions & 3 deletions libs/macros.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef MACROS_H_INCLUDED
#define MACROS_H_INCLUDED
#ifndef LIBS_MACROS_H_INCLUDED
#define LIBS_MACROS_H_INCLUDED

/**
* @def MAXIMUM_DELAY
Expand All @@ -24,4 +24,4 @@
*/
#define MINIMUM_DELAY 0

#endif // MACROS_H_INCLUDED
#endif // LIBS_MACROS_H_INCLUDED
6 changes: 3 additions & 3 deletions libs/main.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef MAIN_H_INCLUDED
#define MAIN_H_INCLUDED
#ifndef LIBS_MAIN_H_INCLUDED
#define LIBS_MAIN_H_INCLUDED

// Root
#include "./macros.h"
Expand All @@ -13,4 +13,4 @@
// Patterns
#include "./patterns/main.h"

#endif // MAIN_H_INCLUDED
#endif // LIBS_MAIN_H_INCLUDED
6 changes: 3 additions & 3 deletions libs/patterns/constructors.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef PATTERNS_CONSTRUCTORS_H_INCLUDED
#define PATTERNS_CONSTRUCTORS_H_INCLUDED
#ifndef LIBS_PATTERNS_CONSTRUCTORS_H_INCLUDED
#define LIBS_PATTERNS_CONSTRUCTORS_H_INCLUDED

#include "./structs.h"

Expand Down Expand Up @@ -48,4 +48,4 @@ void newPressPattern(TPattern* pattern);
*/
void newToadPattern(TPattern* pattern);

#endif // PATTERNS_CONSTRUCTORS_H_INCLUDED
#endif // LIBS_PATTERNS_CONSTRUCTORS_H_INCLUDED
6 changes: 3 additions & 3 deletions libs/patterns/macros.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef PATTERNS_MACROS_H_INCLUDED
#define PATTERNS_MACROS_H_INCLUDED
#ifndef LIBS_PATTERNS_MACROS_H_INCLUDED
#define LIBS_PATTERNS_MACROS_H_INCLUDED

/**
* @def PATTERN_ROWS
Expand All @@ -26,4 +26,4 @@
*/
#define PATTERN_COLS 36

#endif // PATTERNS_MACROS_H_INCLUDED
#endif // LIBS_PATTERNS_MACROS_H_INCLUDED
6 changes: 3 additions & 3 deletions libs/patterns/main.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

#ifndef PATTERNS_MAIN_H_INCLUDED
#define PATTERNS_MAIN_H_INCLUDED
#ifndef LIBS_PATTERNS_MAIN_H_INCLUDED
#define LIBS_PATTERNS_MAIN_H_INCLUDED

// Root
#include "./constructors.h"
#include "./macros.h"
#include "./methods.h"
#include "./structs.h"

#endif // PATTERNS_MAIN_H_INCLUDED
#endif // LIBS_PATTERNS_MAIN_H_INCLUDED
6 changes: 3 additions & 3 deletions libs/patterns/methods.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef PATTERNS_METHODS_H_INCLUDED
#define PATTERNS_METHODS_H_INCLUDED
#ifndef LIBS_PATTERNS_METHODS_H_INCLUDED
#define LIBS_PATTERNS_METHODS_H_INCLUDED

#include "./structs.h"

Expand Down Expand Up @@ -33,4 +33,4 @@ void printPatternByConsole(TPattern* pPattern);
*/
void setPatternCenter(TPattern* pPattern);

#endif // PATTERNS_METHODS_H_INCLUDED
#endif // LIBS_PATTERNS_METHODS_H_INCLUDED
6 changes: 3 additions & 3 deletions libs/patterns/structs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef PATTERNS_STRUCTS_H_INCLUDED
#define PATTERNS_STRUCTS_H_INCLUDED
#ifndef LIBS_PATTERNS_STRUCTS_H_INCLUDED
#define LIBS_PATTERNS_STRUCTS_H_INCLUDED

#include "./macros.h"

Expand All @@ -18,4 +18,4 @@ typedef struct {
int center[2]; /** Array (row, and column) representing the center of the pattern. */
} TPattern;

#endif // PATTERNS_STRUCTS_H_INCLUDED
#endif // LIBS_PATTERNS_STRUCTS_H_INCLUDED
6 changes: 3 additions & 3 deletions libs/utilities.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef UTILITIES_H_INCLUDED
#define UTILITIES_H_INCLUDED
#ifndef LIBS_UTILITIES_H_INCLUDED
#define LIBS_UTILITIES_H_INCLUDED

#include <stdlib.h>

Expand Down Expand Up @@ -134,4 +134,4 @@ void trimLeftStr(char* str);
*/
void trimRightStr(char* str);

#endif // UTILITIES_H_INCLUDED
#endif // LIBS_UTILITIES_H_INCLUDED
6 changes: 3 additions & 3 deletions libs/validators.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#ifndef VALIDATORS_H_INCLUDED
#define VALIDATORS_H_INCLUDED
#ifndef LIBS_VALIDATORS_H_INCLUDED
#define LIBS_VALIDATORS_H_INCLUDED

/**
* @brief Validates a delay.
Expand Down Expand Up @@ -50,4 +50,4 @@ int validatePattern(char* pattern);
*/
int validatePlatform(char* platform);

#endif // VALIDATORS_H_INCLUDED
#endif // LIBS_VALIDATORS_H_INCLUDED

0 comments on commit f60fc2c

Please sign in to comment.