Skip to content
Snippets Groups Projects
Commit 3c2e7df9 authored by Philippe Canal's avatar Philippe Canal
Browse files

From Federico:

Update the constructor to be conformant with the recommendations
given by gcc's -weffc++ option.


git-svn-id: http://root.cern.ch/svn/root/trunk@15555 27541ba8-7e3a-0410-8455-c3a389f83636
parent fac83258
Branches
Tags
No related merge requests found
...@@ -48,7 +48,11 @@ G__TokenInfo { ...@@ -48,7 +48,11 @@ G__TokenInfo {
enum G__TokenProperty {p_invalid , p_type , p_data, p_func}; enum G__TokenProperty {p_invalid , p_type , p_data, p_func};
~G__TokenInfo() {} ~G__TokenInfo() {}
G__TokenInfo() { Init(); } G__TokenInfo() :
tokentype(t_invalid), tokenproperty(p_invalid), methodscope(),
bytecode(NULL), localvar(NULL), glob(), nextscope(), tinfo() { Init(); }
G__TokenInfo(const G__TokenInfo& tki);
G__TokenInfo& operator=(const G__TokenInfo& tki);
void Init(); void Init();
// MakeLocalTable has to be used when entering to a new function // MakeLocalTable has to be used when entering to a new function
......
...@@ -39,8 +39,9 @@ G__TypeInfo : public G__ClassInfo { ...@@ -39,8 +39,9 @@ G__TypeInfo : public G__ClassInfo {
friend class G__MethodArgInfo; friend class G__MethodArgInfo;
public: public:
~G__TypeInfo() {} ~G__TypeInfo() {}
G__TypeInfo(const char *typenamein) : G__ClassInfo() { Init(typenamein); } G__TypeInfo(const char *typenamein) : G__ClassInfo(),
G__TypeInfo() : G__ClassInfo() { type=0; typenum= -1; reftype=0; isconst=0; } type(0), typenum(-1), reftype(0), isconst(0) { Init(typenamein); }
G__TypeInfo() : G__ClassInfo(), type(0), typenum(-1), reftype(0), isconst(0) {}
void Init(const char *typenamein); void Init(const char *typenamein);
#ifndef __MAKECINT__ #ifndef __MAKECINT__
G__TypeInfo(G__value buf) : G__ClassInfo() { Init(buf); } G__TypeInfo(G__value buf) : G__ClassInfo() { Init(buf); }
......
...@@ -44,6 +44,40 @@ void G__TokenInfo::Init() ...@@ -44,6 +44,40 @@ void G__TokenInfo::Init()
bytecode=(struct G__bytecodefunc*)NULL; bytecode=(struct G__bytecodefunc*)NULL;
localvar=(struct G__var_array*)NULL; localvar=(struct G__var_array*)NULL;
} }
///////////////////////////////////////////////////////////////////////////
G__TokenInfo::G__TokenInfo(const G__TokenInfo& tki) :
tokentype(tki.tokentype),
tokenproperty(tki.tokenproperty),
methodscope(tki.methodscope),
bytecode(tki.bytecode),
localvar(tki.localvar),
glob(tki.glob),
nextscope(tki.nextscope),
tinfo(tki.tinfo)
{
// Copy constructor
}
///////////////////////////////////////////////////////////////////////////
G__TokenInfo& G__TokenInfo::operator=(const G__TokenInfo& tki)
{
// Assignment operator
if(this!=&tki) {
tokentype=tki.tokentype;
tokenproperty=tki.tokenproperty;
methodscope=tki.methodscope;
bytecode=tki.bytecode;
localvar=tki.localvar;
glob=tki.glob;
nextscope=tki.nextscope;
tinfo=tki.tinfo;
}
return *this;
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// MakeLocalTable has to be used when entering to a new function // MakeLocalTable has to be used when entering to a new function
G__MethodInfo G__TokenInfo::MakeLocalTable(G__ClassInfo& tag_scope G__MethodInfo G__TokenInfo::MakeLocalTable(G__ClassInfo& tag_scope
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment