diff --git a/mg/mglib01.cpp b/mg/mglib01.cpp index 6aed13609..228044458 100755 --- a/mg/mglib01.cpp +++ b/mg/mglib01.cpp @@ -50,18 +50,18 @@ const bool TMag_livelli::enabled(int levnum) const int TMag_livelli::code_lenght(int levnum) { - if (levnum<=MANY_MAG_LEV && levnum>0) - return(_code_lenght[levnum-1]); - else - return(0) ; + if (levnum<=MANY_MAG_LEV && levnum>0) + return(_code_lenght[levnum-1]); + else + return(0) ; } const int TMag_livelli::packed_lenght(int levnum) { int start=0; - for (int i=1; i<=levnum && levnum<=MANY_MAG_LEV; i++) - start+= _code_lenght[i-1]; - return start; + for (int i=1; i<=levnum && levnum<=MANY_MAG_LEV; i++) + start+= _code_lenght[i-1]; + return start; } @@ -83,32 +83,32 @@ const TString & TMag_livelli::picture(int levnum) void TMag_livelli::pack_grpcode(TString & pc, const TString &codlev, const int levnum) { - pc.overwrite(codlev.left(_code_lenght[levnum-1]),packed_lenght(levnum-1)); + pc.overwrite(codlev.left(_code_lenght[levnum-1]),packed_lenght(levnum-1)); } TString TMag_livelli::unpack_grpcode(const TString & pc, const int levnum) { - int start=0; - for (int i=1; i=pc.len()) - return(""); - else { - if (levnum != _last_level && !_enabled[levnum-1]) - return(""); - return(pc.mid(start,levnum == _last_level ? -1 : _code_lenght[levnum-1])); - } + int start=0; + for (int i=1; i=pc.len()) + return(""); + else { + if (levnum != _last_level && !_enabled[levnum-1]) + return(""); + return(pc.mid(start,levnum == _last_level ? -1 : _code_lenght[levnum-1])); + } } TString TMag_livelli::build_tabcode(const TString & pc, const int levnum) { - TString valore; - valore << levnum; - valore << unpack_grpcode(pc,levnum); - if (valore.len()>1) - return valore; - else - return ""; + TString valore; + valore << levnum; + valore << unpack_grpcode(pc,levnum); + if (valore.len()>1) + return valore; + else + return ""; } // *******************************