From 7edb1e4b410b9d33a2d9394f170de2b44db75b9e Mon Sep 17 00:00:00 2001 From: Mark Jones <jones@jlab.org> Date: Tue, 6 Jan 2015 15:45:01 -0500 Subject: [PATCH] Modify THcFormula to properly handle kCutScaler and kCutNCalled. This is a temporary fix for problem that arise when compiling on the ifarm machines. In the DefinedValue method when using kCutScaler and kCutNCalled the switch statement goes to the default case. On ifarm gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) There are compiler warnings src/THcFormula.cxx: In member function 'virtual Double_t THcFormula::DefinedValue(Int_t)': src/THcFormula.cxx:131: warning: case label value exceeds maximum value for type src/THcFormula.cxx:134: warning: case label value exceeds maximum value for type One permenant fix would be to add kCutScaler and kCutNCalled to the enum EVariableType in THaFormula.h. --- src/THcFormula.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/THcFormula.cxx b/src/THcFormula.cxx index a46b028..0b12372 100644 --- a/src/THcFormula.cxx +++ b/src/THcFormula.cxx @@ -121,7 +121,7 @@ Double_t THcFormula::DefinedValue( Int_t i ) FVarDef_t* def = fVarDef+i; const void* ptr = def->code; if( !ptr ) return kBig; - switch( def->type ) { + switch( (Int_t) def->type ) { case kVariable: case kString: return reinterpret_cast<const THaVar*>(ptr)->GetValue( def->index ); -- GitLab