Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use guards instead of pragma once #443

Merged
merged 2 commits into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions covid-sim.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
<ClInclude Include="src\Country.h" />
<ClInclude Include="src\Dist.h" />
<ClInclude Include="src\Error.h" />
<ClInclude Include="src\IndexList.h" />
<ClInclude Include="src\InfStat.h" />
<ClInclude Include="src\Kernels.h" />
<ClInclude Include="src\Memory.h" />
Expand Down
5 changes: 4 additions & 1 deletion include/geometry/BoundingBox.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef COVIDSIM_GEOMETRY_BOUNDING_BOX_H_INCLUDED_
#define COVIDSIM_GEOMETRY_BOUNDING_BOX_H_INCLUDED_

// Local headers
#include "Vector2.h"
Expand Down Expand Up @@ -191,3 +192,5 @@ namespace CovidSim { namespace Geometry {
}
};
}}

#endif
5 changes: 4 additions & 1 deletion include/geometry/Size.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef COVIDSIM_GEOMETRY_SIZE_H_INCLUDED_
#define COVIDSIM_GEOMETRY_SIZE_H_INCLUDED_

#include <cmath>
#include "Vector2.h"
Expand Down Expand Up @@ -110,3 +111,5 @@ namespace CovidSim { namespace Geometry {
return Vector2<U>((U)this->width, (U)this->height);
}
}}

#endif
6 changes: 5 additions & 1 deletion include/geometry/Vector2.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once
#ifndef COVIDSIM_GEOMETRY_VECTOR2_H_INCLUDED_
#define COVIDSIM_GEOMETRY_VECTOR2_H_INCLUDED_


#include <cmath>

Expand Down Expand Up @@ -150,3 +152,5 @@ namespace CovidSim { namespace Geometry {
Vector2d operator-(const Vector2d &left, const Vector2i &right);
Vector2d operator-(const Vector2i &left, const Vector2d &right);
}}

#endif
7 changes: 5 additions & 2 deletions src/Direction.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef COVIDSIM_DIRECTION_HPP_INCLUDED_
#define COVIDSIM_DIRECTION_HPP_INCLUDED_

enum Direction {
Right = 0,
Expand All @@ -7,4 +8,6 @@ enum Direction {
Down = 3
};

Direction rotate_left(Direction direction);
Direction rotate_left(Direction direction);

#endif
6 changes: 4 additions & 2 deletions src/IndexList.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef COVIDSIM_INDEXLIST_H_INCLUDED_
#define COVIDSIM_INDEXLIST_H_INCLUDED_

/**
* @brief Used for computing spatial interactions more efficiently.
Expand All @@ -7,4 +8,5 @@ struct IndexList
{
int id;
float prob;
};
};
#endif
7 changes: 3 additions & 4 deletions src/InverseCdf.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef COVIDSIM_INVERSE_CDF_H_INCLUDED_
#define COVIDSIM_INVERSE_CDF_H_INCLUDED_

#include "Constants.h"

Expand Down Expand Up @@ -29,6 +30,4 @@ class InverseCdf
}
};




#endif
5 changes: 4 additions & 1 deletion src/MicroCellPosition.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef COVIDSIM_MICRO_CELL_POSITION_HPP_INCLUDED_
#define COVIDSIM_MICRO_CELL_POSITION_HPP_INCLUDED_

#include "Direction.hpp"
#include "Error.h"
Expand All @@ -20,3 +21,5 @@ struct MicroCellPosition
return *this;
}
};

#endif
5 changes: 4 additions & 1 deletion src/Models/Cell.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef COVIDSIM_MODELS_CELL_H_INCLUDED_
#define COVIDSIM_MODELS_CELL_H_INCLUDED_

/**
* @brief Holds microcells.
Expand All @@ -15,3 +16,5 @@ struct Cell
float tot_prob, *cum_trans, *max_trans;
short int CurInterv[MAX_INTERVENTION_TYPES];
};

#endif
5 changes: 4 additions & 1 deletion src/Models/Household.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef COVIDSIM_MODELS_HOUSEHOLD_H_INCLUDED_
#define COVIDSIM_MODELS_HOUSEHOLD_H_INCLUDED_

#include "geometry/Vector2.h"

Expand All @@ -9,3 +10,5 @@ struct Household
unsigned short int nhr;
CovidSim::Geometry::Vector2f loc;
};

#endif
5 changes: 4 additions & 1 deletion src/Models/Microcell.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef COVIDSIM_MODELS_MICRO_CELL_H_INCLUDED_
#define COVIDSIM_MODELS_MICRO_CELL_H_INCLUDED_

#include "../IndexList.h"

Expand Down Expand Up @@ -27,3 +28,5 @@ struct Microcell
unsigned short int vacc_start_time;
IndexList* AirportList;
};

#endif
5 changes: 4 additions & 1 deletion src/Models/Person.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#ifndef COVIDSIM_MODELS_PERSON_H_INCLUDED_
#define COVIDSIM_MODELS_PERSON_H_INCLUDED_

#include <cstdint>
#include <limits>
Expand Down Expand Up @@ -57,3 +58,5 @@ struct PersonQuarantine
// because it conflicts with the max() preprocessor macro in MSVC builds
PersonQuarantine() : comply(2), start_time((std::numeric_limits<uint16_t>::max)()-1) {}
};

#endif