diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-11-20 16:12:57 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-11-20 16:30:02 +0100 |
commit | 13cca3de54265b884fc80a10450096c7e1061b36 (patch) | |
tree | 5273d442d9522e08a681df524acde4c32cda38d3 /rsc/source | |
parent | unused variable (diff) | |
download | core-13cca3de54265b884fc80a10450096c7e1061b36.tar.gz core-13cca3de54265b884fc80a10450096c7e1061b36.zip |
incorrect body alignment
Change-Id: Ie62113f0018e71c984845f1684a4876809b901c4
Diffstat (limited to 'rsc/source')
-rw-r--r-- | rsc/source/parser/rscyacc.y | 26 | ||||
-rw-r--r-- | rsc/source/res/rsccont.cxx | 148 | ||||
-rw-r--r-- | rsc/source/rscpp/cpp5.c | 102 | ||||
-rw-r--r-- | rsc/source/rscpp/cpp6.c | 2 |
4 files changed, 139 insertions, 139 deletions
diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y index 2efc6ffcb802..4fbf0fd6f328 100644 --- a/rsc/source/parser/rscyacc.y +++ b/rsc/source/parser/rscyacc.y @@ -160,7 +160,7 @@ sal_Bool DoClassHeader( RSCHEADER * pHeader, sal_Bool bMember ) RSCINST aTmpI( S.Top() ); aTmpI.pClass->Destroy( aTmpI ); aTmpI.pClass->Create( &aTmpI, aCopyInst ); - }; + } } else pTC->pEH->Error( ERR_FALSETYPE, S.Top().pClass, aName1, @@ -213,8 +213,8 @@ sal_Bool DoClassHeader( RSCHEADER * pHeader, sal_Bool bMember ) return( sal_False ); } S.Push( aTmpI ); - }; - }; + } + } if( TYPE_REF == pHeader->nTyp ) { ERRTYPE aError; @@ -770,7 +770,7 @@ var_header_class pTC->pEH->Error( ERR_NOVARIABLENAME, S.Top().pClass, RscId(), pHS->getString( $1 ).getStr() ); return( ERR_ERROR ); - }; + } if( !DoClassHeader( &$3, sal_True ) ) return( ERR_ERROR ); @@ -799,7 +799,7 @@ var_header_class pTC->pEH->Error( ERR_NOVARIABLENAME, S.Top().pClass, RscId(), pHS->getString( $1 ).getStr() ); return( ERR_ERROR ); - }; + } if( !DoClassHeader( &$6, sal_True ) ) return( ERR_ERROR ); $$ = $6; @@ -828,7 +828,7 @@ var_header_class pTC->pEH->Error( ERR_NOVARIABLENAME, S.Top().pClass, RscId(), pHS->getString( $1 ).getStr() ); return( ERR_ERROR ); - }; + } if( !DoClassHeader( &$6, sal_True ) ) return( ERR_ERROR ); $$ = $6; @@ -848,7 +848,7 @@ var_header pTC->pEH->Error( ERR_NOVARIABLENAME, S.Top().pClass, RscId(), pHS->getString( $1 ).getStr() ); return( ERR_ERROR ); - }; + } } | VARNAME '[' CONSTNAME ']' '=' { @@ -872,7 +872,7 @@ var_header pTC->pEH->Error( ERR_NOVARIABLENAME, S.Top().pClass, RscId(), pHS->getString( $1 ).getStr() ); return( ERR_ERROR ); - }; + } } | VARNAME '[' SYMBOL ']' '=' { @@ -897,7 +897,7 @@ var_header pTC->pEH->Error( ERR_NOVARIABLENAME, S.Top().pClass, RscId(), pHS->getString( $1 ).getStr() ); return( ERR_ERROR ); - }; + } } ; tupel_header0 @@ -912,7 +912,7 @@ tupel_header0 { pTC->pEH->Error( ERR_NOTUPELNAME, S.Top().pClass, RscId() ); return( ERR_ERROR ); - }; + } } ; @@ -928,7 +928,7 @@ tupel_header1 { pTC->pEH->Error( ERR_NOTUPELNAME, S.Top().pClass, RscId() ); return( ERR_ERROR ); - }; + } } ; @@ -944,7 +944,7 @@ tupel_header2 { pTC->pEH->Error( ERR_NOTUPELNAME, S.Top().pClass, RscId() ); return( ERR_ERROR ); - }; + } } ; @@ -958,7 +958,7 @@ tupel_header3 { pTC->pEH->Error( ERR_NOTUPELNAME, S.Top().pClass, RscId() ); return( ERR_ERROR ); - }; + } S.Push( aInst ); } ; diff --git a/rsc/source/res/rsccont.cxx b/rsc/source/res/rsccont.cxx index 5411c34d73ee..9ead8773c10f 100644 --- a/rsc/source/res/rsccont.cxx +++ b/rsc/source/res/rsccont.cxx @@ -407,24 +407,24 @@ ERRTYPE RscBaseCont::SetString( const RSCINST & rInst, const char * pStr ) //?B 040991 //?W 040991 sonst Endlosrekursion moeglich -if( RSC_NOTYPE == pTypeClass->GetTypId() ){ - aError = GetElement( rInst, RscId(), pTypeClass, RSCINST(), &aTmpI ); - aError = aTmpI.pClass->GetString( aTmpI, &pTmpStr ); - if( aError.IsOk() ) - aError = aTmpI.pClass->SetString( aTmpI, pStr ); - else { - aError.Clear(); - DeletePos( rInst, pClassData->nEntries -1 ); - aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI ); + if( RSC_NOTYPE == pTypeClass->GetTypId() ){ + aError = GetElement( rInst, RscId(), pTypeClass, RSCINST(), &aTmpI ); aError = aTmpI.pClass->GetString( aTmpI, &pTmpStr ); if( aError.IsOk() ) aError = aTmpI.pClass->SetString( aTmpI, pStr ); + else { + aError.Clear(); + DeletePos( rInst, pClassData->nEntries -1 ); + aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI ); + aError = aTmpI.pClass->GetString( aTmpI, &pTmpStr ); + if( aError.IsOk() ) + aError = aTmpI.pClass->SetString( aTmpI, pStr ); + } + if( aError.IsError() ) + DeletePos( rInst, pClassData->nEntries -1 ); } - if( aError.IsError() ) - DeletePos( rInst, pClassData->nEntries -1 ); -} -else - aError = ERR_UNKNOWN_METHOD; + else + aError = ERR_UNKNOWN_METHOD; return( aError ); } @@ -444,24 +444,24 @@ ERRTYPE RscBaseCont::SetNumber( const RSCINST & rInst, sal_Int32 lValue ){ //?B 040991 //?W 040991 sonst Endlosrekursion moeglich -if( RSC_NOTYPE == pTypeClass->GetTypId() ){ - aError = GetElement( rInst, RscId(), pTypeClass, RSCINST(), &aTmpI ); - aError = aTmpI.pClass->GetNumber( aTmpI, &lNumber ); - if( aError.IsOk() ) - aError = aTmpI.pClass->SetNumber( aTmpI, lValue ); - else { - aError.Clear(); - DeletePos( rInst, pClassData->nEntries -1 ); - aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI ); + if( RSC_NOTYPE == pTypeClass->GetTypId() ){ + aError = GetElement( rInst, RscId(), pTypeClass, RSCINST(), &aTmpI ); aError = aTmpI.pClass->GetNumber( aTmpI, &lNumber ); if( aError.IsOk() ) aError = aTmpI.pClass->SetNumber( aTmpI, lValue ); + else { + aError.Clear(); + DeletePos( rInst, pClassData->nEntries -1 ); + aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI ); + aError = aTmpI.pClass->GetNumber( aTmpI, &lNumber ); + if( aError.IsOk() ) + aError = aTmpI.pClass->SetNumber( aTmpI, lValue ); + } + if( aError.IsError() ) + DeletePos( rInst, pClassData->nEntries -1 ); } - if( aError.IsError() ) - DeletePos( rInst, pClassData->nEntries -1 ); -} -else - aError = ERR_UNKNOWN_METHOD; + else + aError = ERR_UNKNOWN_METHOD; return( aError ); } @@ -480,27 +480,27 @@ ERRTYPE RscBaseCont::SetBool pClassData = (RscBaseContInst *)(rInst.pData + nOffInstData); -//?B 040991 -//?W 040991 sonst Endlosrekursion moeglich -if( RSC_NOTYPE == pTypeClass->GetTypId() ) -{ - aError = GetElement( rInst, RscId(), pTypeClass, RSCINST(), &aTmpI ); - aError = aTmpI.pClass->GetBool( aTmpI, &bBool ); - if( aError.IsOk() ) - aError = aTmpI.pClass->SetBool( aTmpI, bValue ); - else { - aError.Clear(); - DeletePos( rInst, pClassData->nEntries -1 ); - aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI ); + //?B 040991 + //?W 040991 sonst Endlosrekursion moeglich + if( RSC_NOTYPE == pTypeClass->GetTypId() ) + { + aError = GetElement( rInst, RscId(), pTypeClass, RSCINST(), &aTmpI ); aError = aTmpI.pClass->GetBool( aTmpI, &bBool ); if( aError.IsOk() ) aError = aTmpI.pClass->SetBool( aTmpI, bValue ); + else { + aError.Clear(); + DeletePos( rInst, pClassData->nEntries -1 ); + aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI ); + aError = aTmpI.pClass->GetBool( aTmpI, &bBool ); + if( aError.IsOk() ) + aError = aTmpI.pClass->SetBool( aTmpI, bValue ); + } + if( aError.IsError() ) + DeletePos( rInst, pClassData->nEntries -1 ); } - if( aError.IsError() ) - DeletePos( rInst, pClassData->nEntries -1 ); -} -else - aError = ERR_UNKNOWN_METHOD; + else + aError = ERR_UNKNOWN_METHOD; return( aError ); } @@ -522,24 +522,24 @@ ERRTYPE RscBaseCont::SetConst //?B 040991 //?W 040991 sonst Endlosrekursion moeglich -if( RSC_NOTYPE == pTypeClass->GetTypId() ){ - aError = GetElement( rInst, RscId(), pTypeClass, RSCINST(), &aTmpI ); - aError = aTmpI.pClass->GetConst( aTmpI, &nConst ); - if( aError.IsOk() ) - aError = aTmpI.pClass->SetConst( aTmpI, nValueId, lValue ); - else { - aError.Clear(); - DeletePos( rInst, pClassData->nEntries -1 ); - aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI ); + if( RSC_NOTYPE == pTypeClass->GetTypId() ){ + aError = GetElement( rInst, RscId(), pTypeClass, RSCINST(), &aTmpI ); aError = aTmpI.pClass->GetConst( aTmpI, &nConst ); if( aError.IsOk() ) aError = aTmpI.pClass->SetConst( aTmpI, nValueId, lValue ); + else { + aError.Clear(); + DeletePos( rInst, pClassData->nEntries -1 ); + aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI ); + aError = aTmpI.pClass->GetConst( aTmpI, &nConst ); + if( aError.IsOk() ) + aError = aTmpI.pClass->SetConst( aTmpI, nValueId, lValue ); + } + if( aError.IsError() ) + DeletePos( rInst, pClassData->nEntries -1 ); } - if( aError.IsError() ) - DeletePos( rInst, pClassData->nEntries -1 ); -} -else - aError = ERR_UNKNOWN_METHOD; + else + aError = ERR_UNKNOWN_METHOD; return( aError ); } @@ -559,24 +559,24 @@ ERRTYPE RscBaseCont::SetRef( const RSCINST & rInst, const RscId & rRefId ){ //?B 040991 //?W 040991 sonst Endlosrekursion moeglich -if( RSC_NOTYPE == pTypeClass->GetTypId() ){ - aError = GetElement( rInst, RscId(), pTypeClass, RSCINST(), &aTmpI ); - aError = aTmpI.pClass->GetRef( aTmpI, &aId ); - if( aError.IsOk() ) - aError = aTmpI.pClass->SetRef( aTmpI, rRefId ); - else { - aError.Clear(); - DeletePos( rInst, pClassData->nEntries -1 ); - aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI ); + if( RSC_NOTYPE == pTypeClass->GetTypId() ){ + aError = GetElement( rInst, RscId(), pTypeClass, RSCINST(), &aTmpI ); aError = aTmpI.pClass->GetRef( aTmpI, &aId ); if( aError.IsOk() ) - aError = aTmpI.pClass->SetNumber( aTmpI, rRefId ); + aError = aTmpI.pClass->SetRef( aTmpI, rRefId ); + else { + aError.Clear(); + DeletePos( rInst, pClassData->nEntries -1 ); + aError = GetElement( rInst, RscId(), pTypeClass1, RSCINST(), &aTmpI ); + aError = aTmpI.pClass->GetRef( aTmpI, &aId ); + if( aError.IsOk() ) + aError = aTmpI.pClass->SetNumber( aTmpI, rRefId ); + } + if( aError.IsError() ) + DeletePos( rInst, pClassData->nEntries -1 ); } - if( aError.IsError() ) - DeletePos( rInst, pClassData->nEntries -1 ); -} -else - aError = ERR_UNKNOWN_METHOD; + else + aError = ERR_UNKNOWN_METHOD; return( aError ); } diff --git a/rsc/source/rscpp/cpp5.c b/rsc/source/rscpp/cpp5.c index b0663fc0d107..42bf271878ff 100644 --- a/rsc/source/rscpp/cpp5.c +++ b/rsc/source/rscpp/cpp5.c @@ -511,37 +511,37 @@ dosizeof() typecode = 0; while (0 != (c = skipws())) { if ((c = macroid(c)) == EOF_CHAR || c == '\n') - goto nogood; /* End of line is a bug */ + goto nogood; /* End of line is a bug */ else if (c == '(') { /* thing (*)() func ptr */ - if (skipws() == '*' - && skipws() == ')') { /* We found (*) */ - if (skipws() != '(') /* Let () be optional */ - unget(); - else if (skipws() != ')') - goto nogood; - typecode |= T_FPTR; /* Function pointer */ - } - else { /* Junk is a bug */ - goto nogood; - } + if (skipws() == '*' + && skipws() == ')') { /* We found (*) */ + if (skipws() != '(') /* Let () be optional */ + unget(); + else if (skipws() != ')') + goto nogood; + typecode |= T_FPTR; /* Function pointer */ + } + else { /* Junk is a bug */ + goto nogood; + } } else if (type[c] != LET) /* Exit if not a type */ - break; - else if (!catenate()) { /* Maybe combine tokens */ - /* - * Look for this unexpandable token in basic_types. - * The code accepts "int long" as well as "long int" - * which is a minor bug as bugs go (and one shared with - * a lot of C compilers). - */ - for (tp = basic_types; tp->name != NULLST; tp++) { - if (streq(token, tp->name)) break; - } - if (tp->name == NULLST) { - cerror("#if sizeof, unknown type \"%s\"", token); - return (OP_FAIL); - } + else if (!catenate()) { /* Maybe combine tokens */ + /* + * Look for this unexpandable token in basic_types. + * The code accepts "int long" as well as "long int" + * which is a minor bug as bugs go (and one shared with + * a lot of C compilers). + */ + for (tp = basic_types; tp->name != NULLST; tp++) { + if (streq(token, tp->name)) + break; + } + if (tp->name == NULLST) { + cerror("#if sizeof, unknown type \"%s\"", token); + return (OP_FAIL); + } typecode |= tp->type; /* Or in the type bit */ } } @@ -554,10 +554,10 @@ dosizeof() } if (c == ')') { /* Last syntax check */ for (testp = test_table; *testp != 0; testp++) { - if (!bittest(typecode & *testp)) { - cerror("#if ... sizeof: illegal type combination", NULLST); - return (OP_FAIL); - } + if (!bittest(typecode & *testp)) { + cerror("#if ... sizeof: illegal type combination", NULLST); + return (OP_FAIL); + } } /* * We assume that all function pointers are the same size: @@ -566,25 +566,25 @@ dosizeof() * sizeof (signed int) == (sizeof unsigned int) */ if ((typecode & T_FPTR) != 0) /* Function pointer */ - typecode = T_FPTR | T_PTR; + typecode = T_FPTR | T_PTR; else { /* Var or var * datum */ - typecode &= ~(T_SIGNED | T_UNSIGNED); - if ((typecode & (T_SHORT | T_LONG)) != 0) - typecode &= ~T_INT; + typecode &= ~(T_SIGNED | T_UNSIGNED); + if ((typecode & (T_SHORT | T_LONG)) != 0) + typecode &= ~T_INT; } if ((typecode & ~T_PTR) == 0) { - cerror("#if sizeof() error, no type specified", NULLST); - return (OP_FAIL); + cerror("#if sizeof() error, no type specified", NULLST); + return (OP_FAIL); } /* * Exactly one bit (and possibly T_PTR) may be set. */ for (sizp = size_table; sizp->bits != 0; sizp++) { - if ((typecode & ~T_PTR) == sizp->bits) { - evalue = ((typecode & T_PTR) != 0) - ? sizp->psize : sizp->size; - return (DIG); - } + if ((typecode & ~T_PTR) == sizp->bits) { + evalue = ((typecode & T_PTR) != 0) + ? sizp->psize : sizp->size; + return (DIG); + } } /* We shouldn't fail */ cierror("#if ... sizeof: bug, unknown type code 0x%x", typecode); return (OP_FAIL); @@ -642,7 +642,7 @@ evalnum(int c) c1 -= ('a' - 10); else c1 -= '0'; if (c1 < 0 || c1 >= base) - break; + break; value *= base; value += c1; c = cget(); @@ -743,7 +743,7 @@ evalchar(int skip) */ while ((c = get()) != '\'' && c != EOF_CHAR && c != '\n') { if (!skip) - ciwarn("multi-byte constant '%c' isn't portable", c); + ciwarn("multi-byte constant '%c' isn't portable", c); value <<= BITS_CHAR; value += c; } @@ -794,16 +794,16 @@ evaleval(int* valp, int op, int skip) case OP_DIV: case OP_MOD: if (v2 == 0) { - if (!skip) { - cwarn("%s by zero in #if, zero result assumed", - (op == OP_DIV) ? "divide" : "mod"); - } - v1 = 0; + if (!skip) { + cwarn("%s by zero in #if, zero result assumed", + (op == OP_DIV) ? "divide" : "mod"); + } + v1 = 0; } else if (op == OP_DIV) - v1 /= v2; + v1 /= v2; else - v1 %= v2; + v1 %= v2; break; case OP_ASL: diff --git a/rsc/source/rscpp/cpp6.c b/rsc/source/rscpp/cpp6.c index 3e2d60919c66..438ea76590e2 100644 --- a/rsc/source/rscpp/cpp6.c +++ b/rsc/source/rscpp/cpp6.c @@ -349,7 +349,7 @@ void (*outfun)() /* BP */ && c != EOF_CHAR) { if (c != DEF_MAGIC) - (*outfun)(c); + (*outfun)(c); if (c == '\\') (*outfun)(get()); } |