Skip to content

Commit

Permalink
Fixed many -Wreserved-id-macro warnings by fixing header guard spelli…
Browse files Browse the repository at this point in the history
…ng (#361)

* Fixed many -Wreserved-id-macro warnings by fixing header guard spelling

Removed leading underscore(s) from header guard spelling.  Used 2 regexes:

` _H5(.*)_H`
` __H5(.*)_H`

Applied case-insensitively to only .h files.

* Modified scripts that generate header files to not use underscore prefix

Interestingly, there was already no leading underscore in the trailing comment at the end of the file

* Fixed remaining -Wreserved-id-macro warning not caught by regex
  • Loading branch information
seanm authored Feb 23, 2021
1 parent 5ed255a commit c17b4b9
Show file tree
Hide file tree
Showing 201 changed files with 587 additions and 587 deletions.
4 changes: 2 additions & 2 deletions bin/make_err
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ sub print_startprotect ($$) {
$file =~ s/(\w*)\.h/$1/;

# Print the ifdef info
print $fh "\n#ifndef _${file}_H\n";
print $fh "#define _${file}_H\n";
print $fh "\n#ifndef ${file}_H\n";
print $fh "#define ${file}_H\n";
}

##############################################################################
Expand Down
4 changes: 2 additions & 2 deletions bin/make_overflow
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ sub print_startprotect ($$) {
$file =~ s/(\w*)\.h/$1/;

# Print the ifdef info
print $fh "\n#ifndef _${file}_H\n";
print $fh "#define _${file}_H\n";
print $fh "\n#ifndef ${file}_H\n";
print $fh "#define ${file}_H\n";
}

##############################################################################
Expand Down
4 changes: 2 additions & 2 deletions bin/make_vers
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ sub print_startprotect ($$) {
$file =~ s/(\w*)\.h/$1/;

# Print the ifdef info
print $fh "\n#ifndef _${file}_H\n";
print $fh "#define _${file}_H\n";
print $fh "\n#ifndef ${file}_H\n";
print $fh "#define ${file}_H\n";
}

##############################################################################
Expand Down
6 changes: 3 additions & 3 deletions c++/src/H5ArrayType.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5ArrayType_H
#define __H5ArrayType_H
#ifndef H5ArrayType_H
#define H5ArrayType_H

namespace H5 {

Expand Down Expand Up @@ -69,4 +69,4 @@ class H5_DLLCPP ArrayType : public DataType {
}; // end of ArrayType
} // namespace H5

#endif // __H5ArrayType_H
#endif // H5ArrayType_H
6 changes: 3 additions & 3 deletions c++/src/H5AtomType.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5AtomType_H
#define __H5AtomType_H
#ifndef H5AtomType_H
#define H5AtomType_H

namespace H5 {

Expand Down Expand Up @@ -83,4 +83,4 @@ class H5_DLLCPP AtomType : public DataType {
}; // end of AtomType
} // namespace H5

#endif // __H5AtomType_H
#endif // H5AtomType_H
6 changes: 3 additions & 3 deletions c++/src/H5Attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5Attribute_H
#define __H5Attribute_H
#ifndef H5Attribute_H
#define H5Attribute_H

namespace H5 {

Expand Down Expand Up @@ -104,4 +104,4 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location {
}; // end of Attribute
} // namespace H5

#endif // __H5Attribute_H
#endif // H5Attribute_H
6 changes: 3 additions & 3 deletions c++/src/H5Classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5Classes_H
#define __H5Classes_H
#ifndef H5Classes_H
#define H5Classes_H

namespace H5 {
class Exception;
Expand Down Expand Up @@ -43,4 +43,4 @@ class H5File;
class Attribute;
class H5Library;
} // namespace H5
#endif // __H5Classes_H
#endif // H5Classes_H
6 changes: 3 additions & 3 deletions c++/src/H5CompType.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5CompType_H
#define __H5CompType_H
#ifndef H5CompType_H
#define H5CompType_H

namespace H5 {

Expand Down Expand Up @@ -124,4 +124,4 @@ class H5_DLLCPP CompType : public DataType {
}; // end of CompType
} // namespace H5

#endif // __H5CompType_H
#endif // H5CompType_H
6 changes: 3 additions & 3 deletions c++/src/H5Cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5Cpp_H
#define __H5Cpp_H
#ifndef H5Cpp_H
#define H5Cpp_H

#include "H5Include.h"
#include "H5Exception.h"
Expand Down Expand Up @@ -58,4 +58,4 @@
#define HOFFSET(TYPE, MEMBER) ((size_t) & ((TYPE *)0)->MEMBER)
#endif

#endif // __H5Cpp_H
#endif // H5Cpp_H
6 changes: 3 additions & 3 deletions c++/src/H5CppDoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5CppDoc_H
#define __H5CppDoc_H
#ifndef H5CppDoc_H
#define H5CppDoc_H

//-------------------------------------------------------------------------
// The following section will be used to generate the 'Mainpage'
Expand Down Expand Up @@ -92,4 +92,4 @@
/// This example shows how to work with groups.
///\example h5group.cpp

#endif // __H5CppDoc_H
#endif // H5CppDoc_H
6 changes: 3 additions & 3 deletions c++/src/H5DaccProp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5DSetAccPropList_H
#define __H5DSetAccPropList_H
#ifndef H5DSetAccPropList_H
#define H5DSetAccPropList_H

namespace H5 {

Expand Down Expand Up @@ -69,4 +69,4 @@ class H5_DLLCPP DSetAccPropList : public LinkAccPropList {
}; // end of DSetAccPropList
} // namespace H5

#endif // __H5DSetAccPropList_H
#endif // H5DSetAccPropList_H
6 changes: 3 additions & 3 deletions c++/src/H5DataSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5DataSet_H
#define __H5DataSet_H
#ifndef H5DataSet_H
#define H5DataSet_H

namespace H5 {

Expand Down Expand Up @@ -153,4 +153,4 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
}; // end of DataSet
} // namespace H5

#endif // __H5DataSet_H
#endif // H5DataSet_H
6 changes: 3 additions & 3 deletions c++/src/H5DataSpace.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5DataSpace_H
#define __H5DataSpace_H
#ifndef H5DataSpace_H
#define H5DataSpace_H

namespace H5 {

Expand Down Expand Up @@ -155,4 +155,4 @@ class H5_DLLCPP DataSpace : public IdComponent {
}; // end of DataSpace
} // namespace H5

#endif // __H5DataSpace_H
#endif // H5DataSpace_H
6 changes: 3 additions & 3 deletions c++/src/H5DataType.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5DataType_H
#define __H5DataType_H
#ifndef H5DataType_H
#define H5DataType_H

namespace H5 {

Expand Down Expand Up @@ -183,4 +183,4 @@ class H5_DLLCPP DataType : public H5Object {
}; // end of DataType
} // namespace H5

#endif // __H5DataType_H
#endif // H5DataType_H
6 changes: 3 additions & 3 deletions c++/src/H5DcreatProp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5DSCreatPropList_H
#define __H5DSCreatPropList_H
#ifndef H5DSCreatPropList_H
#define H5DSCreatPropList_H

namespace H5 {

Expand Down Expand Up @@ -159,4 +159,4 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList {
}; // end of DSetCreatPropList
} // namespace H5

#endif // __H5DSCreatPropList_H
#endif // H5DSCreatPropList_H
6 changes: 3 additions & 3 deletions c++/src/H5DxferProp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5DSetMemXferPropList_H
#define __H5DSetMemXferPropList_H
#ifndef H5DSetMemXferPropList_H
#define H5DSetMemXferPropList_H

namespace H5 {

Expand Down Expand Up @@ -131,4 +131,4 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
}; // end of DSetMemXferPropList
} // namespace H5

#endif // __H5DSetMemXferPropList_H
#endif // H5DSetMemXferPropList_H
6 changes: 3 additions & 3 deletions c++/src/H5EnumType.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5EnumType_H
#define __H5EnumType_H
#ifndef H5EnumType_H
#define H5EnumType_H

namespace H5 {

Expand Down Expand Up @@ -87,4 +87,4 @@ class H5_DLLCPP EnumType : public DataType {
}; // end of EnumType
} // namespace H5

#endif // __H5EnumType_H
#endif // H5EnumType_H
6 changes: 3 additions & 3 deletions c++/src/H5Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5Exception_H
#define __H5Exception_H
#ifndef H5Exception_H
#define H5Exception_H

#include <string>

Expand Down Expand Up @@ -176,4 +176,4 @@ class H5_DLLCPP IdComponentException : public Exception {
}; // end of IdComponentException
} // namespace H5

#endif // __H5Exception_H
#endif // H5Exception_H
6 changes: 3 additions & 3 deletions c++/src/H5FaccProp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5FileAccPropList_H
#define __H5FileAccPropList_H
#ifndef H5FileAccPropList_H
#define H5FileAccPropList_H

namespace H5 {

Expand Down Expand Up @@ -168,4 +168,4 @@ class H5_DLLCPP FileAccPropList : public PropList {
}; // end of FileAccPropList
} // namespace H5

#endif // __H5FileAccPropList_H
#endif // H5FileAccPropList_H
6 changes: 3 additions & 3 deletions c++/src/H5FcreatProp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5FileCreatPropList_H
#define __H5FileCreatPropList_H
#ifndef H5FileCreatPropList_H
#define H5FileCreatPropList_H

namespace H5 {

Expand Down Expand Up @@ -109,4 +109,4 @@ class H5_DLLCPP FileCreatPropList : public PropList {
}; // end of FileCreatPropList
} // namespace H5

#endif // __H5FileCreatPropList_H
#endif // H5FileCreatPropList_H
6 changes: 3 additions & 3 deletions c++/src/H5File.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5File_H
#define __H5File_H
#ifndef H5File_H
#define H5File_H

namespace H5 {

Expand Down Expand Up @@ -136,4 +136,4 @@ class H5_DLLCPP H5File : public Group {
}; // end of H5File
} // namespace H5

#endif // __H5File_H
#endif // H5File_H
6 changes: 3 additions & 3 deletions c++/src/H5FloatType.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5FloatType_H
#define __H5FloatType_H
#ifndef H5FloatType_H
#define H5FloatType_H

namespace H5 {

Expand Down Expand Up @@ -84,4 +84,4 @@ class H5_DLLCPP FloatType : public AtomType {
}; // end of FloatType
} // namespace H5

#endif // __H5FloatType_H
#endif // H5FloatType_H
6 changes: 3 additions & 3 deletions c++/src/H5IntType.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5IntType_H
#define __H5IntType_H
#ifndef H5IntType_H
#define H5IntType_H

namespace H5 {

Expand Down Expand Up @@ -66,4 +66,4 @@ class H5_DLLCPP IntType : public AtomType {
}; // end of IntType
} // namespace H5

#endif // __H5IntType_H
#endif // H5IntType_H
6 changes: 3 additions & 3 deletions c++/src/H5LaccProp.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* [email protected]. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef __H5LinkAccPropList_H
#define __H5LinkAccPropList_H
#ifndef H5LinkAccPropList_H
#define H5LinkAccPropList_H

namespace H5 {

Expand Down Expand Up @@ -70,4 +70,4 @@ class H5_DLLCPP LinkAccPropList : public PropList {
}; // end of LinkAccPropList
} // namespace H5

#endif // __H5LinkAccPropList_H
#endif // H5LinkAccPropList_H
Loading

0 comments on commit c17b4b9

Please sign in to comment.