Kaydet (Commit) 7079e88d authored tarafından Stephan Bergmann's avatar Stephan Bergmann

idlc: fix warnings

Change-Id: I2ef51fae0bc4425c5d2b6707d1df381888b427e7
üst 79533f3f
...@@ -30,7 +30,7 @@ class AstOperation : public AstDeclaration ...@@ -30,7 +30,7 @@ class AstOperation : public AstDeclaration
, public AstScope , public AstScope
{ {
public: public:
AstOperation(AstType* pReturnType, const OString& name, AstScope* pScope) AstOperation(AstType const * pReturnType, const OString& name, AstScope* pScope)
: AstDeclaration(NT_operation, name, pScope) : AstDeclaration(NT_operation, name, pScope)
, AstScope(NT_operation) , AstScope(NT_operation)
, m_pReturnType(pReturnType) , m_pReturnType(pReturnType)
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
// scope management // scope management
virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl) SAL_OVERRIDE; virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl) SAL_OVERRIDE;
private: private:
AstType* m_pReturnType; AstType const * m_pReturnType;
DeclList m_exceptions; DeclList m_exceptions;
}; };
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
class AstSequence : public AstType class AstSequence : public AstType
{ {
public: public:
AstSequence(AstType* pMemberType, AstScope* pScope) AstSequence(AstType const * pMemberType, AstScope* pScope)
: AstType(NT_sequence, OString("[]")+pMemberType->getScopedName(), pScope) : AstType(NT_sequence, OString("[]")+pMemberType->getScopedName(), pScope)
, m_pMemberType(pMemberType) , m_pMemberType(pMemberType)
, m_pRelativName(NULL) , m_pRelativName(NULL)
...@@ -35,7 +35,7 @@ public: ...@@ -35,7 +35,7 @@ public:
delete m_pRelativName; delete m_pRelativName;
} }
AstType* getMemberType() const AstType const * getMemberType() const
{ return m_pMemberType; } { return m_pMemberType; }
virtual bool isUnsigned() const SAL_OVERRIDE virtual bool isUnsigned() const SAL_OVERRIDE
...@@ -43,7 +43,7 @@ public: ...@@ -43,7 +43,7 @@ public:
virtual const sal_Char* getRelativName() const SAL_OVERRIDE; virtual const sal_Char* getRelativName() const SAL_OVERRIDE;
private: private:
AstType* m_pMemberType; AstType const * m_pMemberType;
mutable OString* m_pRelativName; mutable OString* m_pRelativName;
}; };
......
...@@ -332,7 +332,7 @@ bool includes(AstDeclaration const * type1, AstDeclaration const * type2) { ...@@ -332,7 +332,7 @@ bool includes(AstDeclaration const * type1, AstDeclaration const * type2) {
%type <exval> expression const_expr or_expr xor_expr and_expr %type <exval> expression const_expr or_expr xor_expr and_expr
%type <exval> add_expr mult_expr unary_expr primary_expr shift_expr %type <exval> add_expr mult_expr unary_expr primary_expr shift_expr
%type <exval> literal positive_int_expr %type <exval> literal
%type <fdval> declarator %type <fdval> declarator
%type <dlval> declarators at_least_one_declarator %type <dlval> declarators at_least_one_declarator
...@@ -464,7 +464,7 @@ module_dcl : ...@@ -464,7 +464,7 @@ module_dcl :
} }
} }
delete(pModule); delete(pModule);
pModule = (AstModule*)pExists; pModule = static_cast<AstModule*>(pExists);
} else } else
{ {
pScope->addDeclaration(pModule); pScope->addDeclaration(pModule);
...@@ -573,7 +573,7 @@ interface_dcl : ...@@ -573,7 +573,7 @@ interface_dcl :
*/ */
if (pDecl->getNodeType() == NT_interface) if (pDecl->getNodeType() == NT_interface)
{ {
pForward = (AstInterface*)pDecl; pForward = static_cast<AstInterface*>(pDecl);
if ( !pForward->isDefined() ) if ( !pForward->isDefined() )
{ {
/* /*
...@@ -946,7 +946,7 @@ operation : ...@@ -946,7 +946,7 @@ operation :
*/ */
if ( pScope && $1 ) if ( pScope && $1 )
{ {
AstType *pType = (AstType*)$1; AstType const *pType = static_cast<AstType const *>($1);
if ( !pType || (pType->getNodeType() == NT_exception) ) if ( !pType || (pType->getNodeType() == NT_exception) )
{ {
// type ERROR // type ERROR
...@@ -990,7 +990,7 @@ operation : ...@@ -990,7 +990,7 @@ operation :
*/ */
if ( pScope && pScope->getScopeNodeType() == NT_operation) if ( pScope && pScope->getScopeNodeType() == NT_operation)
{ {
pOp = (AstOperation*)pScope; pOp = static_cast<AstOperation*>(pScope);
if ( pOp ) if ( pOp )
pOp->setExceptions($11); pOp->setExceptions($11);
...@@ -1288,7 +1288,7 @@ constants_dcl : ...@@ -1288,7 +1288,7 @@ constants_dcl :
{ {
pExists->setInMainfile(idlc()->isInMainFile()); pExists->setInMainfile(idlc()->isInMainFile());
delete(pConstants); delete(pConstants);
pConstants = (AstConstants*)pExists; pConstants = static_cast<AstConstants*>(pExists);
} else } else
{ {
pScope->addDeclaration(pConstants); pScope->addDeclaration(pConstants);
...@@ -1434,19 +1434,6 @@ literal : ...@@ -1434,19 +1434,6 @@ literal :
} }
; ;
positive_int_expr :
const_expr
{
$1->evaluate(EK_const);
if ( !$1->coerce(ET_ulong) )
{
ErrorHandler::coercionError($1, ET_ulong);
delete $1;
$$ = NULL;
}
}
;
const_type : const_type :
integer_type integer_type
| byte_type | byte_type
...@@ -1652,7 +1639,7 @@ service_export : ...@@ -1652,7 +1639,7 @@ service_export :
if ( ErrorHandler::checkPublished(pDecl, bOptional) ) if ( ErrorHandler::checkPublished(pDecl, bOptional) )
{ {
pIMember = new AstInterfaceMember( pIMember = new AstInterfaceMember(
$1, (AstInterface*)pDecl, *iter, pScope); $1, static_cast<AstInterface*>(pDecl), *iter, pScope);
pScope->addDeclaration(pIMember); pScope->addDeclaration(pIMember);
} }
} else } else
...@@ -1694,7 +1681,7 @@ service_export : ...@@ -1694,7 +1681,7 @@ service_export :
else if ( ErrorHandler::checkPublished(pDecl) ) else if ( ErrorHandler::checkPublished(pDecl) )
{ {
pSMember = new AstServiceMember( pSMember = new AstServiceMember(
$1, (AstService*)pDecl, *iter, pScope); $1, static_cast<AstService*>(pDecl), *iter, pScope);
pScope->addDeclaration(pSMember); pScope->addDeclaration(pSMember);
} }
} else } else
...@@ -1735,7 +1722,7 @@ service_export : ...@@ -1735,7 +1722,7 @@ service_export :
pDecl = pScope->lookupByName(*iter); pDecl = pScope->lookupByName(*iter);
if ( pDecl && (pDecl->getNodeType() == NT_interface) ) if ( pDecl && (pDecl->getNodeType() == NT_interface) )
{ {
pObserves = new AstObserves((AstInterface*)pDecl, *iter, pScope); pObserves = new AstObserves(static_cast<AstInterface*>(pDecl), *iter, pScope);
pScope->addDeclaration(pObserves); pScope->addDeclaration(pObserves);
} else } else
{ {
...@@ -1776,7 +1763,7 @@ service_export : ...@@ -1776,7 +1763,7 @@ service_export :
pDecl = pScope->lookupByName(*iter); pDecl = pScope->lookupByName(*iter);
if ( pDecl && (pDecl->getNodeType() == NT_service) ) if ( pDecl && (pDecl->getNodeType() == NT_service) )
{ {
pNeeds = new AstNeeds((AstService*)pDecl, *iter, pScope); pNeeds = new AstNeeds(static_cast<AstService*>(pDecl), *iter, pScope);
pScope->addDeclaration(pNeeds); pScope->addDeclaration(pNeeds);
} else } else
{ {
...@@ -2405,7 +2392,7 @@ sequence_type_spec : ...@@ -2405,7 +2392,7 @@ sequence_type_spec :
if ( $5 ) if ( $5 )
{ {
AstType *pType = (AstType*)$5; AstType const *pType = static_cast<AstType const *>($5);
if ( pType ) if ( pType )
{ {
pSeq = new AstSequence(pType, pScope); pSeq = new AstSequence(pType, pScope);
...@@ -2672,7 +2659,7 @@ enum_type : ...@@ -2672,7 +2659,7 @@ enum_type :
$$ = NULL; $$ = NULL;
else else
{ {
$$ = (AstEnum*)idlc()->scopes()->topNonNull(); $$ = static_cast<AstEnum*>(idlc()->scopes()->topNonNull());
idlc()->scopes()->pop(); idlc()->scopes()->pop();
} }
} }
...@@ -2706,7 +2693,7 @@ enumerator : ...@@ -2706,7 +2693,7 @@ enumerator :
if ( pScope && pScope->getScopeNodeType() == NT_enum) if ( pScope && pScope->getScopeNodeType() == NT_enum)
{ {
pEnum = (AstEnum*)pScope; pEnum = static_cast<AstEnum*>(pScope);
if (pEnum && $1) if (pEnum && $1)
{ {
AstExpression* pExpr = new AstExpression(pEnum->getEnumValueCount()); AstExpression* pExpr = new AstExpression(pEnum->getEnumValueCount());
...@@ -2735,7 +2722,7 @@ enumerator : ...@@ -2735,7 +2722,7 @@ enumerator :
$3->evaluate(EK_const); $3->evaluate(EK_const);
if ( $3->coerce(ET_long) ) if ( $3->coerce(ET_long) )
{ {
pEnum = (AstEnum*)pScope; pEnum = static_cast<AstEnum*>(pScope);
if (pEnum) if (pEnum)
{ {
pEnumVal = new AstConstant(ET_long , NT_enum_val, pEnumVal = new AstConstant(ET_long , NT_enum_val,
......
...@@ -105,7 +105,7 @@ static int asciiToInteger(char const * s, sal_Int64 * sval, sal_uInt64 * uval) ...@@ -105,7 +105,7 @@ static int asciiToInteger(char const * s, sal_Int64 * sval, sal_uInt64 * uval)
// std::numeric_limits<sal_uInt64>::max() == SAL_MAX_UINT64: // std::numeric_limits<sal_uInt64>::max() == SAL_MAX_UINT64:
sal_uInt64 nval = val * base + n; sal_uInt64 nval = val * base + n;
if (nval < val) { if (nval < val) {
idlc()->error()->syntaxError( ErrorHandler::syntaxError(
PS_NoState, idlc()->getLineNumber(), PS_NoState, idlc()->getLineNumber(),
"integral constant too large"); "integral constant too large");
val = 0; val = 0;
...@@ -120,7 +120,7 @@ static int asciiToInteger(char const * s, sal_Int64 * sval, sal_uInt64 * uval) ...@@ -120,7 +120,7 @@ static int asciiToInteger(char const * s, sal_Int64 * sval, sal_uInt64 * uval)
} else if (val == SAL_CONST_UINT64(0x8000000000000000)) { } else if (val == SAL_CONST_UINT64(0x8000000000000000)) {
*sval = SAL_MIN_INT64; *sval = SAL_MIN_INT64;
} else { } else {
idlc()->error()->syntaxError( ErrorHandler::syntaxError(
PS_NoState, idlc()->getLineNumber(), PS_NoState, idlc()->getLineNumber(),
"negative integral constant too large"); "negative integral constant too large");
*sval = 0; *sval = 0;
...@@ -233,7 +233,7 @@ static void parseLineAndFile(sal_Char* pBuf) ...@@ -233,7 +233,7 @@ static void parseLineAndFile(sal_Char* pBuf)
else else
idlc()->setFileName(::rtl::OString(h)); idlc()->setFileName(::rtl::OString(h));
bIsInMain = (idlc()->getFileName() == idlc()->getRealFileName()) ? sal_True : sal_False; bIsInMain = idlc()->getFileName() == idlc()->getRealFileName();
idlc()->setInMainfile(bIsInMain); idlc()->setInMainfile(bIsInMain);
} }
...@@ -439,7 +439,7 @@ published return IDL_PUBLISHED; ...@@ -439,7 +439,7 @@ published return IDL_PUBLISHED;
{ {
if ( 0 != nIndex && if ( 0 != nIndex &&
(docu.getStr()[nIndex - 1] != '"' && docu.getStr()[nIndex - 1] != ':') ) (docu.getStr()[nIndex - 1] != '"' && docu.getStr()[nIndex - 1] != ':') )
idlc()->error()->syntaxError(PS_NoState, idlc()->getLineNumber(), ErrorHandler::syntaxError(PS_NoState, idlc()->getLineNumber(),
"nested documentation strings are not allowed!"); "nested documentation strings are not allowed!");
} }
idlc()->setDocumentation(docu); idlc()->setDocumentation(docu);
...@@ -456,7 +456,7 @@ published return IDL_PUBLISHED; ...@@ -456,7 +456,7 @@ published return IDL_PUBLISHED;
{ {
if ( 0 != nIndex && if ( 0 != nIndex &&
(docu.getStr()[nIndex - 1] != '"' && docu.getStr()[nIndex - 1] != ':') ) (docu.getStr()[nIndex - 1] != '"' && docu.getStr()[nIndex - 1] != ':') )
idlc()->error()->syntaxError(PS_NoState, idlc()->getLineNumber(), ErrorHandler::syntaxError(PS_NoState, idlc()->getLineNumber(),
"nested documentation strings are not allowed!"); "nested documentation strings are not allowed!");
} }
idlc()->setDocumentation(docu); idlc()->setDocumentation(docu);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment