Skip to content

Commit ccb9c7c

Browse files
committed
Ran pre-commit
1 parent 36ea7e4 commit ccb9c7c

File tree

9 files changed

+91
-124
lines changed

9 files changed

+91
-124
lines changed

Common/include/geometry/meshreader/CSU2ASCIIMeshReaderBase.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CSU2ASCIIMeshReaderBase : public CSU2MeshReaderBase {
4242
enum class FileSection { POINTS, ELEMENTS, MARKERS }; /*!< \brief Different sections of the file. */
4343
std::array<FileSection, 3> SectionOrder{}; /*!< \brief Order of the sections in the file. */
4444

45-
ifstream mesh_file; /*!< \brief File object for the SU2 ASCII mesh file. */
45+
ifstream mesh_file; /*!< \brief File object for the SU2 ASCII mesh file. */
4646

4747
/*!
4848
* \brief Reads all SU2 ASCII mesh metadata and checks for errors.

Common/include/geometry/meshreader/CSU2BinaryMeshReaderBase.hpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@
3838
*/
3939
class CSU2BinaryMeshReaderBase : public CSU2MeshReaderBase {
4040
protected:
41-
4241
constexpr static int SU2_STRING_SIZE = 33; /*!< \brief Size of the strings in the SU2 binary mesh file. */
4342

44-
FILE *mesh_file; /*!< \brief File object for the SU2 binary mesh file. */
45-
bool swap_bytes; /*!< \brief Whether or not byte swapping must be used. */
46-
int size_conn_type; /*!< \brief Size, in bytes of the connectivity type. */
43+
FILE* mesh_file; /*!< \brief File object for the SU2 binary mesh file. */
44+
bool swap_bytes; /*!< \brief Whether or not byte swapping must be used. */
45+
int size_conn_type; /*!< \brief Size, in bytes of the connectivity type. */
4746

4847
/*!
4948
* \brief Reads the connectivity type used in the binary file and check if
@@ -87,20 +86,16 @@ class CSU2BinaryMeshReaderBase : public CSU2MeshReaderBase {
8786
* \brief Template function to read data from the binary file.
8887
*/
8988
template <typename T>
90-
void ReadBinaryData(T *data, const size_t nItems) {
91-
89+
void ReadBinaryData(T* data, const size_t nItems) {
9290
/*--- Read the actual data. ---*/
9391
auto ret = fread(data, sizeof(T), nItems, mesh_file);
94-
if (ret != nItems)
95-
SU2_MPI::Error(string("Error while reading the file ") + meshFilename,
96-
CURRENT_FUNCTION);
92+
if (ret != nItems) SU2_MPI::Error(string("Error while reading the file ") + meshFilename, CURRENT_FUNCTION);
9793

9894
/*--- Apply byte swapping, if needed. ---*/
99-
if ( swap_bytes )
100-
SwapBytes((char *) data, sizeof(T), nItems);
95+
if (swap_bytes) SwapBytes((char*)data, sizeof(T), nItems);
10196
}
10297

103-
private:
98+
private:
10499
/*!
105100
* \brief Read the meta data for a zone.
106101
*/

Common/include/toolboxes/SwapBytes.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636
* \param nBytes - The size in bytes of an data entry
3737
* \param nVar - The number of entries
3838
*/
39-
void SwapBytes(char *buffer, size_t nBytes, unsigned long nVar);
39+
void SwapBytes(char* buffer, size_t nBytes, unsigned long nVar);

Common/src/CConfig.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short
631631
}
632632

633633
case SU2_BIN: {
634-
634+
635635
/*--- Check if the mesh file can be opened for binary reading. ---*/
636636
FILE *mesh_file = fopen(val_mesh_filename.c_str(), "rb");
637637
if ( !mesh_file )
@@ -662,7 +662,7 @@ unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short
662662
if (ret != 1)
663663
SU2_MPI::Error(string("Error while reading the file ") + val_mesh_filename,
664664
CURRENT_FUNCTION);
665-
if ( swap_bytes)
665+
if ( swap_bytes)
666666
SwapBytes((char *) &nZone, sizeof(int), 1);
667667

668668
fclose(mesh_file);
@@ -834,7 +834,7 @@ unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short
834834
if (ret != 1)
835835
SU2_MPI::Error(string("Error while reading the file ") + val_mesh_filename,
836836
CURRENT_FUNCTION);
837-
if ( swap_bytes)
837+
if ( swap_bytes)
838838
SwapBytes((char *) &nDim, sizeof(int), 1);
839839

840840
fclose(mesh_file);

0 commit comments

Comments
 (0)