Skip to content

Commit 656459c

Browse files
Guard macros weren't guarding anything.
1 parent 319383b commit 656459c

14 files changed

+30
-21
lines changed

classdesc.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ struct GuardMacro
10731073
printf("\n#ifndef %s\n",macro.c_str());
10741074
printf("#define %s\n",macro.c_str());
10751075
}
1076-
~GuardMacro() {printf("#endif\n");}
1076+
~GuardMacro() {printf("\n#endif\n");}
10771077
};
10781078

10791079
string type_qualifier(const string& type)
@@ -1484,10 +1484,10 @@ int main(int argc, char* argv[])
14841484
{
14851485
/* check if type has a #pragma associated */
14861486
bool is_treenode, is_graphnode;
1487-
{
1488-
string n=without_type_qualifier(actions[i].type);
1489-
GuardMacro guardMacro(string("CLASSDESC_")+action[k]+"_"+n);
1487+
string n=without_type_qualifier(actions[i].type);
1488+
GuardMacro guardMacro(string("CLASSDESC_")+action[k]+"_"+n);
14901489

1490+
{
14911491
/* strip out template arguments, collapse multiple spaces,
14921492
remove trailing space */
14931493
string n1;

pythonBuffer.h

+1
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ namespace classdesc
683683
attachRegistryObjects(result->list(),*r,".");
684684
return ref.release();
685685
}
686+
default: break;
686687
}
687688
if (PyErr_Occurred())
688689
PyErr_Print();

test/00/baseClassTypeName.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ namespace classdesc_access {
6767
6868
#ifndef CLASSDESC_p___foo_N_
6969
#define CLASSDESC_p___foo_N_
70-
#endif
7170
template < class N > struct access_p< struct ::foo<N> > {
7271
template <class _CD_ARG_TYPE>
7372
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -79,6 +78,8 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
7978
{
8079
}
8180
};
81+
82+
#endif
8283
}
8384
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
8485
#pragma GCC diagnostic pop

test/00/inheritedNested.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ namespace classdesc_access {
6767
6868
#ifndef CLASSDESC_p___FlowCounter
6969
#define CLASSDESC_p___FlowCounter
70-
#endif
7170
template <> struct access_p< struct ::FlowCounter > {
7271
template <class _CD_ARG_TYPE>
7372
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -79,6 +78,8 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
7978
{
8079
}
8180
};
81+
82+
#endif
8283
}
8384
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
8485
#pragma GCC diagnostic pop

test/00/qt.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ namespace classdesc_access {
7070
7171
#ifndef CLASSDESC_p___foo
7272
#define CLASSDESC_p___foo
73-
#endif
7473
template <> struct access_p< class ::foo > {
7574
template <class _CD_ARG_TYPE>
7675
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -85,6 +84,8 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
8584
::p_type<_CD_TYPE,class ::foo >(targ,desc+".mySlot2",&::foo::mySlot2);
8685
}
8786
};
87+
88+
#endif
8889
}
8990
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
9091
#pragma GCC diagnostic pop

test/00/t0015a.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ using classdesc::p_type;
7878
namespace classdesc_access {
7979
#ifndef CLASSDESC_p___foo
8080
#define CLASSDESC_p___foo
81-
#endif
8281
template <> struct access_p< class ::foo > {
8382
template <class _CD_ARG_TYPE>
8483
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -90,9 +89,9 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
9089
{
9190
}
9291
};
92+
#endif
9393
#ifndef CLASSDESC_p___bar__foo
9494
#define CLASSDESC_p___bar__foo
95-
#endif
9695
template <> struct access_p< class ::bar::foo > {
9796
template <class _CD_ARG_TYPE>
9897
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -106,6 +105,7 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
106105
using namespace ::bar;
107106
}
108107
};
108+
#endif
109109
}
110110
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
111111
#pragma GCC diagnostic pop

test/00/t0016a.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ using classdesc::p_type;
6565
namespace classdesc_access {
6666
#ifndef CLASSDESC_p___foo
6767
#define CLASSDESC_p___foo
68-
#endif
6968
template <> struct access_p< class ::foo > {
7069
template <class _CD_ARG_TYPE>
7170
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -77,6 +76,7 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
7776
{
7877
}
7978
};
79+
#endif
8080
}
8181
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
8282
#pragma GCC diagnostic pop

test/00/t0019a.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ namespace classdesc_access {
6666
6767
#ifndef CLASSDESC_p___foo
6868
#define CLASSDESC_p___foo
69-
#endif
7069
template <> struct access_p< class ::foo > {
7170
template <class _CD_ARG_TYPE>
7271
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -79,6 +78,8 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
7978
::p_type<_CD_TYPE,class ::foo >(targ,desc+".b",&::foo::b);
8079
}
8180
};
81+
82+
#endif
8283
}
8384
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
8485
#pragma GCC diagnostic pop

test/00/t0020a.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ namespace classdesc_access {
7070
7171
#ifndef CLASSDESC_p___x_T_
7272
#define CLASSDESC_p___x_T_
73-
#endif
7473
template < class T > struct access_p< struct ::x<T> > {
7574
template <class _CD_ARG_TYPE>
7675
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -83,6 +82,8 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
8382
typedef typename ::x<T>::y y;
8483
}
8584
};
85+
86+
#endif
8687
}
8788
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
8889
#pragma GCC diagnostic pop

test/00/t0023a.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ namespace classdesc_access {
6565
6666
#ifndef CLASSDESC_p___foo
6767
#define CLASSDESC_p___foo
68-
#endif
6968
template <>
7069
struct access_p< class ::foo* >
7170
{
@@ -84,6 +83,8 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
8483
{
8584
}
8685
};
86+
87+
#endif
8788
}
8889
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
8990
#pragma GCC diagnostic pop

test/00/t0061a.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ namespace classdesc_access {
7070
7171
#ifndef CLASSDESC_p___foo_T_
7272
#define CLASSDESC_p___foo_T_
73-
#endif
7473
template < class T > struct access_p< struct ::foo<T> > {
7574
template <class _CD_ARG_TYPE>
7675
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -83,6 +82,8 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
8382
typedef typename ::foo<T>::bar bar;
8483
}
8584
};
85+
86+
#endif
8687
}
8788
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
8889
#pragma GCC diagnostic pop

test/00/t0065a.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ namespace classdesc_access {
6666
6767
#ifndef CLASSDESC_p___foo
6868
#define CLASSDESC_p___foo
69-
#endif
7069
template <> struct access_p< struct ::foo > {
7170
template <class _CD_ARG_TYPE>
7271
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -80,6 +79,8 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
8079
::p<_CD_TYPE,bar >(targ,desc+"");
8180
}
8281
};
82+
83+
#endif
8384
}
8485
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
8586
#pragma GCC diagnostic pop

test/test_private.out

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ using classdesc::p_type;
1313
namespace classdesc_access {
1414
#ifndef CLASSDESC_p___foo
1515
#define CLASSDESC_p___foo
16-
#endif
1716
template <> struct access_p< class ::foo > {
1817
template <class _CD_ARG_TYPE>
1918
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -27,9 +26,9 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
2726
{
2827
}
2928
};
29+
#endif
3030
#ifndef CLASSDESC_p___bar
3131
#define CLASSDESC_p___bar
32-
#endif
3332
template <> struct access_p< struct ::bar > {
3433
template <class _CD_ARG_TYPE>
3534
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -41,9 +40,9 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
4140
{
4241
}
4342
};
43+
#endif
4444
#ifndef CLASSDESC_p_bamboo
4545
#define CLASSDESC_p_bamboo
46-
#endif
4746
template <> struct access_p< bamboo > {
4847
template <class _CD_ARG_TYPE>
4948
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -56,6 +55,7 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
5655
{
5756
}
5857
};
58+
#endif
5959
}
6060
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
6161
#pragma GCC diagnostic pop

test/test_private.private.out

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ using classdesc::p_type;
1313
namespace classdesc_access {
1414
#ifndef CLASSDESC_p___foo
1515
#define CLASSDESC_p___foo
16-
#endif
1716
template <> struct access_p< class ::foo > {
1817
template <class _CD_ARG_TYPE>
1918
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -25,9 +24,9 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
2524
{
2625
}
2726
};
27+
#endif
2828
#ifndef CLASSDESC_p___bar
2929
#define CLASSDESC_p___bar
30-
#endif
3130
template <> struct access_p< struct ::bar > {
3231
template <class _CD_ARG_TYPE>
3332
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -39,9 +38,9 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
3938
{
4039
}
4140
};
41+
#endif
4242
#ifndef CLASSDESC_p_bamboo
4343
#define CLASSDESC_p_bamboo
44-
#endif
4544
template <> struct access_p< bamboo > {
4645
template <class _CD_ARG_TYPE>
4746
void operator()(classdesc::p_t& targ, const classdesc::string& desc,_CD_ARG_TYPE& arg)
@@ -53,6 +52,7 @@ void type(classdesc::p_t& targ, const classdesc::string& desc)
5352
{
5453
}
5554
};
55+
#endif
5656
}
5757
#if defined(__GNUC__) && !defined(__ICC) && !defined(__clang__)
5858
#pragma GCC diagnostic pop

0 commit comments

Comments
 (0)