diff options
Diffstat (limited to 'idlc')
78 files changed, 1107 insertions, 1107 deletions
diff --git a/idlc/inc/idlc/astarray.hxx b/idlc/inc/idlc/astarray.hxx index bb711823e869..4ee463ef9b66 100644 --- a/idlc/inc/idlc/astarray.hxx +++ b/idlc/inc/idlc/astarray.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,21 +42,21 @@ public: AstType* getType() { return m_pType; } void setType(AstType* pType) - { + { m_pType = pType; setName(makeName()); } ExprList* getDimExpressions() - { return &m_dimExpressions; } + { return &m_dimExpressions; } sal_uInt32 getDimension() - { return m_dimension; } - + { return m_dimension; } + private: ::rtl::OString makeName(); - AstType* m_pType; - sal_uInt32 m_dimension; - ExprList m_dimExpressions; + AstType* m_pType; + sal_uInt32 m_dimension; + ExprList m_dimExpressions; }; #endif // _IDLC_ASTARRAY_HXX_ diff --git a/idlc/inc/idlc/astattribute.hxx b/idlc/inc/idlc/astattribute.hxx index 9b55069b6609..1be771652764 100644 --- a/idlc/inc/idlc/astattribute.hxx +++ b/idlc/inc/idlc/astattribute.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -110,7 +110,7 @@ private: DeclList const & exceptions, RTMethodMode flags, sal_uInt16 * methodIndex); - const sal_uInt32 m_flags; + const sal_uInt32 m_flags; AstType const * m_pType; rtl::OUString m_getDocumentation; DeclList m_getExceptions; diff --git a/idlc/inc/idlc/astbasetype.hxx b/idlc/inc/idlc/astbasetype.hxx index 4d0793ef66fb..493e557f9936 100644 --- a/idlc/inc/idlc/astbasetype.hxx +++ b/idlc/inc/idlc/astbasetype.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/inc/idlc/astconstant.hxx b/idlc/inc/idlc/astconstant.hxx index b9c87ad42f03..8bd2952123f8 100644 --- a/idlc/inc/idlc/astconstant.hxx +++ b/idlc/inc/idlc/astconstant.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ public: AstConstant(const ExprType type, AstExpression* pExpr, const ::rtl::OString& name, AstScope* pScope); virtual ~AstConstant(); - + AstExpression* getConstValue() { return m_pConstValue; } ExprType getConstValueType() const @@ -50,8 +50,8 @@ public: sal_Bool dumpBlob( typereg::Writer & rBlob, sal_uInt16 index, bool published); private: - AstExpression* m_pConstValue; - const ExprType m_constValueType; + AstExpression* m_pConstValue; + const ExprType m_constValueType; }; #endif // _IDLC_ASTCONSTANT_HXX_ diff --git a/idlc/inc/idlc/astconstants.hxx b/idlc/inc/idlc/astconstants.hxx index f132a978b31d..1417db98358e 100644 --- a/idlc/inc/idlc/astconstants.hxx +++ b/idlc/inc/idlc/astconstants.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/inc/idlc/astdeclaration.hxx b/idlc/inc/idlc/astdeclaration.hxx index f0f6d29b0953..1daf4f2f8aff 100644 --- a/idlc/inc/idlc/astdeclaration.hxx +++ b/idlc/inc/idlc/astdeclaration.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,39 +34,39 @@ class AstScope; // Enum defining the different kinds of Ast nodes -enum NodeType +enum NodeType { - NT_object, // Denotes an object - NT_service, // Denotes an servcie - NT_interface_member, // Denotes an interface which is exported from object - NT_service_member, // Denotes an service which is exported from object - NT_observes, // Denotes an observed interface - NT_needs, // Denotes an needed service - NT_module, // Denotes a module - NT_root, // Denotes the root of AST - NT_interface, // Denotes an interface - NT_constants, // Denotes a constant group - NT_const, // Denotes a constant - NT_exception, // Denotes an exception - NT_attribute, // Denotes an attribute - NT_property, // Denotes an property - NT_operation, // Denotes an operation - NT_parameter, // Denotes an op. parameter - NT_union, // Denotes a union - NT_union_branch, // Denotes a union branch + NT_object, // Denotes an object + NT_service, // Denotes an servcie + NT_interface_member, // Denotes an interface which is exported from object + NT_service_member, // Denotes an service which is exported from object + NT_observes, // Denotes an observed interface + NT_needs, // Denotes an needed service + NT_module, // Denotes a module + NT_root, // Denotes the root of AST + NT_interface, // Denotes an interface + NT_constants, // Denotes a constant group + NT_const, // Denotes a constant + NT_exception, // Denotes an exception + NT_attribute, // Denotes an attribute + NT_property, // Denotes an property + NT_operation, // Denotes an operation + NT_parameter, // Denotes an op. parameter + NT_union, // Denotes a union + NT_union_branch, // Denotes a union branch NT_struct, // Denotes either a plain struct type, or a // polymorphic struct type template NT_type_parameter, // Denotes a type parameter of a polymorphic struct // type template NT_instantiated_struct, // Denotes an instantiated polymorphic struct type - NT_member, // Denotes a member in structure, exception - NT_enum, // Denotes an enumeration - NT_enum_val, // Denotes an enum. value - NT_array, // Denotes an IDL array - NT_sequence, // Denotes an IDL sequence - NT_typedef, // Denotes a typedef - NT_predefined, // Denotes a predefined type - NT_singleton // Denotes a singleton + NT_member, // Denotes a member in structure, exception + NT_enum, // Denotes an enumeration + NT_enum_val, // Denotes an enum. value + NT_array, // Denotes an IDL array + NT_sequence, // Denotes an IDL sequence + NT_typedef, // Denotes a typedef + NT_predefined, // Denotes a predefined type + NT_singleton // Denotes a singleton }; class AstDeclaration @@ -80,11 +80,11 @@ public: void setName(const ::rtl::OString& name); const ::rtl::OString& getLocalName() const { return m_localName; } - const ::rtl::OString& getScopedName() const + const ::rtl::OString& getScopedName() const { return m_scopedName; } - const ::rtl::OString& getFullName() + const ::rtl::OString& getFullName() { return m_fullName; } - virtual const sal_Char* getRelativName() const + virtual const sal_Char* getRelativName() const { return m_fullName.getStr()+1; } AstScope* getScope() { return m_pScope; } @@ -128,21 +128,21 @@ public: bool isPredefined() { return m_bPredefined; } void setPredefined(bool bPredefined); - + protected: - ::rtl::OString m_localName; - ::rtl::OString m_scopedName; // full qualified name - ::rtl::OString m_fullName; // full qualified name with '/' as seperator - AstScope* m_pScope; + ::rtl::OString m_localName; + ::rtl::OString m_scopedName; // full qualified name + ::rtl::OString m_fullName; // full qualified name with '/' as seperator + AstScope* m_pScope; NodeType m_nodeType; - sal_Bool m_bImported; // imported ? - sal_Bool m_bIsAdded; // mark declaration as added in scope - sal_Bool m_bInMainFile; // defined in main file + sal_Bool m_bImported; // imported ? + sal_Bool m_bIsAdded; // mark declaration as added in scope + sal_Bool m_bInMainFile; // defined in main file bool m_bPublished; bool m_bPredefined; - sal_Int32 m_lineNumber; // line number defined in - ::rtl::OString m_fileName; // fileName defined in - ::rtl::OUString m_documentation; // fileName defined in + sal_Int32 m_lineNumber; // line number defined in + ::rtl::OString m_fileName; // fileName defined in + ::rtl::OUString m_documentation; // fileName defined in }; #endif // _IDLC_ASTDECLARATION_HXX_ diff --git a/idlc/inc/idlc/astenum.hxx b/idlc/inc/idlc/astenum.hxx index 6a3380a22250..ae4665631d72 100644 --- a/idlc/inc/idlc/astenum.hxx +++ b/idlc/inc/idlc/astenum.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,7 +51,7 @@ public: virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl); private: - sal_Int32 m_enumValueCount; + sal_Int32 m_enumValueCount; }; #endif // _IDLC_ASTENUM_HXX_ diff --git a/idlc/inc/idlc/astexception.hxx b/idlc/inc/idlc/astexception.hxx index 2f4c73ac7d07..c6627889508d 100644 --- a/idlc/inc/idlc/astexception.hxx +++ b/idlc/inc/idlc/astexception.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/inc/idlc/astexpression.hxx b/idlc/inc/idlc/astexpression.hxx index 74dfb91b7c8c..b09472576367 100644 --- a/idlc/inc/idlc/astexpression.hxx +++ b/idlc/inc/idlc/astexpression.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,67 +33,67 @@ // Enum to define all the different operators to combine expressions enum ExprComb { - EC_add, // '+' - EC_minus, // '-' - EC_mul, // '*' - EC_div, // '/' - EC_mod, // '%' - EC_or, // '|' - EC_xor, // '^' - EC_and, // '&' - EC_left, // '<<' - EC_right, // '>>' - EC_u_plus, // unary '+' - EC_u_minus, // unary '-' - EC_bit_neg, // '~' - EC_none, // No operator (missing) - EC_symbol // a symbol (function or constant name) + EC_add, // '+' + EC_minus, // '-' + EC_mul, // '*' + EC_div, // '/' + EC_mod, // '%' + EC_or, // '|' + EC_xor, // '^' + EC_and, // '&' + EC_left, // '<<' + EC_right, // '>>' + EC_u_plus, // unary '+' + EC_u_minus, // unary '-' + EC_bit_neg, // '~' + EC_none, // No operator (missing) + EC_symbol // a symbol (function or constant name) }; // Enum to define the different kinds of evaluation possible -enum EvalKind +enum EvalKind { - EK_const, // Must evaluate to constant - EK_positive_int // Must evaluate to positive integer + EK_const, // Must evaluate to constant + EK_positive_int // Must evaluate to positive integer }; // Enum to define expression type enum ExprType { - ET_short, // Expression value is short - ET_ushort, // Expression value is unsigned short - ET_long, // Expression value is long - ET_ulong, // Expression value is unsigned long - ET_hyper, // Expression value is hyper (64 bit) - ET_uhyper, // Expression value is unsigned hyper - ET_float, // Expression value is 32-bit float - ET_double, // Expression value is 64-bit float - ET_char, // Expression value is char - ET_byte, // Expression value is byte - ET_boolean, // Expression value is boolean - ET_string, // Expression value is char * - ET_any, // Expression value is any of above - ET_void, // Expression value is void (absent) - ET_type, // Expression value is type - ET_none // Expression value is missing + ET_short, // Expression value is short + ET_ushort, // Expression value is unsigned short + ET_long, // Expression value is long + ET_ulong, // Expression value is unsigned long + ET_hyper, // Expression value is hyper (64 bit) + ET_uhyper, // Expression value is unsigned hyper + ET_float, // Expression value is 32-bit float + ET_double, // Expression value is 64-bit float + ET_char, // Expression value is char + ET_byte, // Expression value is byte + ET_boolean, // Expression value is boolean + ET_string, // Expression value is char * + ET_any, // Expression value is any of above + ET_void, // Expression value is void (absent) + ET_type, // Expression value is type + ET_none // Expression value is missing }; // Structure to describe value of constant expression and its type -struct AstExprValue +struct AstExprValue { - union + union { - sal_uInt8 byval; // Contains byte expression value - sal_Int16 sval; // Contains short expression value - sal_uInt16 usval; // Contains unsigned short expr value - sal_Int32 lval; // Contains long expression value - sal_uInt32 ulval; // Contains unsigned long expr value - sal_Int64 hval; // Contains hyper expression value - sal_uInt64 uhval; // Contains unsigned hyper expr value - sal_Bool bval; // Contains boolean expression value - float fval; // Contains 32-bit float expr value - double dval; // Contains 64-bit float expr value - sal_uInt32 eval; // Contains enumeration value + sal_uInt8 byval; // Contains byte expression value + sal_Int16 sval; // Contains short expression value + sal_uInt16 usval; // Contains unsigned short expr value + sal_Int32 lval; // Contains long expression value + sal_uInt32 ulval; // Contains unsigned long expr value + sal_Int64 hval; // Contains hyper expression value + sal_uInt64 uhval; // Contains unsigned hyper expr value + sal_Bool bval; // Contains boolean expression value + float fval; // Contains 32-bit float expr value + double dval; // Contains 64-bit float expr value + sal_uInt32 eval; // Contains enumeration value } u; ExprType et; }; @@ -106,18 +106,18 @@ public: // Constructor(s) AstExpression(ExprComb c, AstExpression *pExpr1, AstExpression *pExpr2); - AstExpression(sal_Int32 l); - AstExpression(sal_Int32 l, ExprType et); - AstExpression(sal_Int64 h); - AstExpression(sal_uInt64 uh); - AstExpression(double d); + AstExpression(sal_Int32 l); + AstExpression(sal_Int32 l, ExprType et); + AstExpression(sal_Int64 h); + AstExpression(sal_uInt64 uh); + AstExpression(double d); AstExpression(::rtl::OString* scopedName); virtual ~AstExpression(); // Data Accessors AstScope* getScope() - { return m_pScope; } + { return m_pScope; } void setScope(AstScope* pScope) { m_pScope = pScope; } sal_Int32 getLine() @@ -163,7 +163,7 @@ public: void dump() {} private: // Fill out the lineno, filename and definition scope details - void fillDefinitionDetails(); + void fillDefinitionDetails(); // Internal evaluation AstExprValue* eval_internal(EvalKind ek); // Evaluate different sets of operators @@ -172,15 +172,15 @@ private: AstExprValue* eval_un_op(EvalKind ek); AstExprValue* eval_symbol(EvalKind ek); - AstScope* m_pScope; // scope defined in - sal_Int32 m_lineNo; // line number defined in - ::rtl::OString m_fileName; // fileName defined in + AstScope* m_pScope; // scope defined in + sal_Int32 m_lineNo; // line number defined in + ::rtl::OString m_fileName; // fileName defined in - ExprComb m_combOperator; - AstExpression* m_subExpr1; - AstExpression* m_subExpr2; - AstExprValue* m_exprValue; - ::rtl::OString* m_pSymbolicName; + ExprComb m_combOperator; + AstExpression* m_subExpr1; + AstExpression* m_subExpr2; + AstExprValue* m_exprValue; + ::rtl::OString* m_pSymbolicName; }; #endif // _IDLC_ASTEXPRESSION_HXX_ diff --git a/idlc/inc/idlc/astinterface.hxx b/idlc/inc/idlc/astinterface.hxx index 5b4f3ae6fee7..038a810a5bbf 100644 --- a/idlc/inc/idlc/astinterface.hxx +++ b/idlc/inc/idlc/astinterface.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ public: AstInterface( const ::rtl::OString& name, AstInterface const * pInherits, - AstScope* pScope); + AstScope* pScope); virtual ~AstInterface(); InheritedInterfaces const & getAllInheritedInterfaces() const @@ -133,9 +133,9 @@ private: InheritedInterfaces m_inheritedInterfaces; InheritedInterfaces::size_type m_mandatoryInterfaces; - sal_Bool m_bIsDefined; - sal_Bool m_bForwarded; - sal_Bool m_bForwardedInSameFile; + sal_Bool m_bIsDefined; + sal_Bool m_bForwarded; + sal_Bool m_bForwardedInSameFile; bool m_bSingleInheritance; VisibleInterfaces m_visibleInterfaces; VisibleMembers m_visibleMembers; diff --git a/idlc/inc/idlc/astinterfacemember.hxx b/idlc/inc/idlc/astinterfacemember.hxx index 12eb19cf678e..8ea498bd0268 100644 --- a/idlc/inc/idlc/astinterfacemember.hxx +++ b/idlc/inc/idlc/astinterfacemember.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,7 +33,7 @@ class AstInterfaceMember : public AstDeclaration { public: - AstInterfaceMember(const sal_uInt32 flags, AstInterface* pRealInterface, + AstInterfaceMember(const sal_uInt32 flags, AstInterface* pRealInterface, const ::rtl::OString& name, AstScope* pScope) : AstDeclaration(NT_interface_member, name, pScope) , m_flags(flags) @@ -43,11 +43,11 @@ public: AstInterface* getRealInterface() { return m_pRealInterface; } - sal_Bool isOptional() + sal_Bool isOptional() { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); } private: - const sal_uInt32 m_flags; - AstInterface* m_pRealInterface; + const sal_uInt32 m_flags; + AstInterface* m_pRealInterface; }; #endif // _IDLC_ASTINTERFACEMEMBER_HXX_ diff --git a/idlc/inc/idlc/astmember.hxx b/idlc/inc/idlc/astmember.hxx index 4100bffd3826..0f21f6e37f81 100644 --- a/idlc/inc/idlc/astmember.hxx +++ b/idlc/inc/idlc/astmember.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/inc/idlc/astmodule.hxx b/idlc/inc/idlc/astmodule.hxx index 54c95c2d1305..8e5b12d21099 100644 --- a/idlc/inc/idlc/astmodule.hxx +++ b/idlc/inc/idlc/astmodule.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/inc/idlc/astneeds.hxx b/idlc/inc/idlc/astneeds.hxx index c4084dfef5a5..767223e0a1b7 100644 --- a/idlc/inc/idlc/astneeds.hxx +++ b/idlc/inc/idlc/astneeds.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,7 +42,7 @@ public: AstService* getRealService() { return m_pRealService; } private: - AstService* m_pRealService; + AstService* m_pRealService; }; #endif // _IDLC_ASTNEEDS_HXX_ diff --git a/idlc/inc/idlc/astobserves.hxx b/idlc/inc/idlc/astobserves.hxx index 0faec0b8a949..085e28a96791 100644 --- a/idlc/inc/idlc/astobserves.hxx +++ b/idlc/inc/idlc/astobserves.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,7 +42,7 @@ public: AstInterface* getRealInterface() { return m_pRealInterface; } private: - AstInterface* m_pRealInterface; + AstInterface* m_pRealInterface; }; #endif // _IDLC_ASTOBSERVES_HXX_ diff --git a/idlc/inc/idlc/astoperation.hxx b/idlc/inc/idlc/astoperation.hxx index 397e1c3396c0..a49d0e8e385d 100644 --- a/idlc/inc/idlc/astoperation.hxx +++ b/idlc/inc/idlc/astoperation.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,8 +33,8 @@ namespace typereg { class Writer; } -#define OP_NONE 0x0000 -#define OP_ONEWAY 0x0001 +#define OP_NONE 0x0000 +#define OP_ONEWAY 0x0001 class AstType; @@ -68,9 +68,9 @@ public: // scope management virtual AstDeclaration* addDeclaration(AstDeclaration* pDecl); private: - sal_uInt32 m_flags; - AstType* m_pReturnType; - DeclList m_exceptions; + sal_uInt32 m_flags; + AstType* m_pReturnType; + DeclList m_exceptions; }; #endif // _IDLC_ASTOPERATION_HXX_ diff --git a/idlc/inc/idlc/astparameter.hxx b/idlc/inc/idlc/astparameter.hxx index 3d97e72d14b8..fc8fa330b469 100644 --- a/idlc/inc/idlc/astparameter.hxx +++ b/idlc/inc/idlc/astparameter.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ #include <idlc/astmember.hxx> -enum Direction { DIR_IN, DIR_OUT, DIR_INOUT }; +enum Direction { DIR_IN, DIR_OUT, DIR_INOUT }; class AstParameter: public AstMember { public: diff --git a/idlc/inc/idlc/astscope.hxx b/idlc/inc/idlc/astscope.hxx index e7f6a3962928..fb5d037a9c55 100644 --- a/idlc/inc/idlc/astscope.hxx +++ b/idlc/inc/idlc/astscope.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -71,8 +71,8 @@ protected: { return m_declarations.back(); } private: - DeclList m_declarations; - NodeType m_nodeType; + DeclList m_declarations; + NodeType m_nodeType; }; #endif // _IDLC_ASTSCOPE_HXX_ diff --git a/idlc/inc/idlc/astsequence.hxx b/idlc/inc/idlc/astsequence.hxx index d7e3cec03b9d..0b4e6e45f625 100644 --- a/idlc/inc/idlc/astsequence.hxx +++ b/idlc/inc/idlc/astsequence.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,7 +38,7 @@ public: , m_pMemberType(pMemberType) , m_pRelativName(NULL) {} - virtual ~AstSequence() + virtual ~AstSequence() { if ( m_pRelativName ) delete m_pRelativName; @@ -50,9 +50,9 @@ public: virtual bool isUnsigned() const { return m_pMemberType != 0 && m_pMemberType->isUnsigned(); } - virtual const sal_Char* getRelativName() const; + virtual const sal_Char* getRelativName() const; private: - AstType* m_pMemberType; + AstType* m_pMemberType; mutable ::rtl::OString* m_pRelativName; }; diff --git a/idlc/inc/idlc/astservice.hxx b/idlc/inc/idlc/astservice.hxx index 862c33ce17c4..cd6d2162fb10 100644 --- a/idlc/inc/idlc/astservice.hxx +++ b/idlc/inc/idlc/astservice.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/inc/idlc/astservicemember.hxx b/idlc/inc/idlc/astservicemember.hxx index f8b7932a647f..835387e55732 100644 --- a/idlc/inc/idlc/astservicemember.hxx +++ b/idlc/inc/idlc/astservicemember.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,11 +43,11 @@ public: AstService* getRealService() { return m_pRealService; } - sal_Bool isOptional() + sal_Bool isOptional() { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); } private: - const sal_uInt32 m_flags; - AstService* m_pRealService; + const sal_uInt32 m_flags; + AstService* m_pRealService; }; #endif // _IDLC_ASTSERVICEMEMBER_HXX_ diff --git a/idlc/inc/idlc/aststack.hxx b/idlc/inc/idlc/aststack.hxx index 6604996c9bb2..6d34f83af4cb 100644 --- a/idlc/inc/idlc/aststack.hxx +++ b/idlc/inc/idlc/aststack.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,9 +48,9 @@ public: void clear(); private: - AstScope** m_stack; - sal_uInt32 m_size; - sal_uInt32 m_top; + AstScope** m_stack; + sal_uInt32 m_size; + sal_uInt32 m_top; }; #endif // _IDLC_ASTSTACK_HXX_ diff --git a/idlc/inc/idlc/aststruct.hxx b/idlc/inc/idlc/aststruct.hxx index 98cadcc4899c..92c09294a49b 100644 --- a/idlc/inc/idlc/aststruct.hxx +++ b/idlc/inc/idlc/aststruct.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,8 +44,8 @@ public: std::vector< rtl::OString > const & typeParameters, AstStruct* pBaseType, AstScope* pScope); - AstStruct(const NodeType type, - const ::rtl::OString& name, + AstStruct(const NodeType type, + const ::rtl::OString& name, AstStruct* pBaseType, AstScope* pScope); virtual ~AstStruct(); diff --git a/idlc/inc/idlc/aststructinstance.hxx b/idlc/inc/idlc/aststructinstance.hxx index 3428bc2be0b2..4b8539311b78 100644 --- a/idlc/inc/idlc/aststructinstance.hxx +++ b/idlc/inc/idlc/aststructinstance.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/inc/idlc/asttype.hxx b/idlc/inc/idlc/asttype.hxx index 32a18ab671f5..a3c2abba5b3e 100644 --- a/idlc/inc/idlc/asttype.hxx +++ b/idlc/inc/idlc/asttype.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/inc/idlc/asttypedef.hxx b/idlc/inc/idlc/asttypedef.hxx index 2b1839dcadd9..6f467e2a4a48 100644 --- a/idlc/inc/idlc/asttypedef.hxx +++ b/idlc/inc/idlc/asttypedef.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/inc/idlc/astunion.hxx b/idlc/inc/idlc/astunion.hxx index 4435317bee37..132bdd7064ac 100644 --- a/idlc/inc/idlc/astunion.hxx +++ b/idlc/inc/idlc/astunion.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,8 +61,8 @@ protected: AstUnionBranch* lookupEnum(AstUnionBranch* pBranch); private: - AstType* m_pDiscriminantType; - ExprType m_discExprType; + AstType* m_pDiscriminantType; + ExprType m_discExprType; }; #endif // _IDLC_ASTUNION_HXX_ diff --git a/idlc/inc/idlc/astunionbranch.hxx b/idlc/inc/idlc/astunionbranch.hxx index 20df92b90552..35a9d4b835ef 100644 --- a/idlc/inc/idlc/astunionbranch.hxx +++ b/idlc/inc/idlc/astunionbranch.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,7 +40,7 @@ public: AstUnionLabel* getLabel() { return m_pLabel; } private: - AstUnionLabel* m_pLabel; + AstUnionLabel* m_pLabel; }; #endif // _IDLC_ASTUNIONBRANCH_HXX_ diff --git a/idlc/inc/idlc/astunionlabel.hxx b/idlc/inc/idlc/astunionlabel.hxx index d468884d5a01..61f0fe3414eb 100644 --- a/idlc/inc/idlc/astunionlabel.hxx +++ b/idlc/inc/idlc/astunionlabel.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -28,10 +28,10 @@ #ifndef _IDLC_ASTUNIONLABEL_HXX_ #define _IDLC_ASTUNIONLABEL_HXX_ -enum UnionLabel +enum UnionLabel { - UL_default, // Label is "default" - UL_label // Regular label + UL_default, // Label is "default" + UL_label // Regular label }; class AstUnionLabel @@ -45,8 +45,8 @@ public: AstExpression* getLabelValue() { return m_pLabelValue; } private: - UnionLabel m_label; - AstExpression* m_pLabelValue; + UnionLabel m_label; + AstExpression* m_pLabelValue; }; #endif // _IDLC_ASTUNIONLABEL_HXX_ diff --git a/idlc/inc/idlc/errorhandler.hxx b/idlc/inc/idlc/errorhandler.hxx index 44d2a8a5a704..c60bc3441514 100644 --- a/idlc/inc/idlc/errorhandler.hxx +++ b/idlc/inc/idlc/errorhandler.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,41 +35,41 @@ enum ErrorCode { - EIDL_NONE, // No error - EIDL_SYNTAX_ERROR, // Syntax error in IDL input + EIDL_NONE, // No error + EIDL_SYNTAX_ERROR, // Syntax error in IDL input // More details will be gleaned from examining // the parse state - EIDL_REDEF, // Redefinition - EIDL_REDEF_SCOPE, // Redefinition inside defining scope - EIDL_DEF_USE, // Definition after use - EIDL_MULTIPLE_BRANCH, // More than one union branch with this label - EIDL_COERCION_FAILURE, // Coercion failure - EIDL_SCOPE_CONFLICT, // Between fwd declare and full declare - EIDL_ONEWAY_CONFLICT, // Between op decl and argument direction - EIDL_DISC_TYPE, // Illegal discriminator type in union - EIDL_LABEL_TYPE, // Mismatch with discriminator type in union - EIDL_ILLEGAL_ADD, // Illegal add action - EIDL_ILLEGAL_USE, // Illegal type used in expression - EIDL_ILLEGAL_RAISES, // Error in "raises" clause - EIDL_CANT_INHERIT, // Cannot inherit from non-interface - EIDL_LOOKUP_ERROR, // Identifier not found - EIDL_INHERIT_FWD_ERROR, // Cannot inherit from fwd decl interface - EIDL_CONSTANT_EXPECTED, // We got something else.. - EIDL_NAME_CASE_ERROR, // Spelling differences found - EIDL_ENUM_VAL_EXPECTED, // Expected an enumerator - EIDL_ENUM_VAL_NOT_FOUND, // Didnt find an enumerator with that name - EIDL_EVAL_ERROR, // Error in evaluating expression - EIDL_AMBIGUOUS, // Ambiguous name definition - EIDL_DECL_NOT_DEFINED, // Forward declared but never defined - EIDL_FWD_DECL_LOOKUP, // Tried to lookup in fwd declared intf - EIDL_RECURSIVE_TYPE, // Illegal recursive use of type - EIDL_NONVOID_ONEWAY, // Non-void return type in oneway operation - EIDL_NOT_A_TYPE, // Not a type - EIDL_TYPE_NOT_VALID, // Type is not valid in this context - EIDL_INTERFACEMEMBER_LOOKUP, // interface is not defined or a fwd declaration not exists + EIDL_REDEF, // Redefinition + EIDL_REDEF_SCOPE, // Redefinition inside defining scope + EIDL_DEF_USE, // Definition after use + EIDL_MULTIPLE_BRANCH, // More than one union branch with this label + EIDL_COERCION_FAILURE, // Coercion failure + EIDL_SCOPE_CONFLICT, // Between fwd declare and full declare + EIDL_ONEWAY_CONFLICT, // Between op decl and argument direction + EIDL_DISC_TYPE, // Illegal discriminator type in union + EIDL_LABEL_TYPE, // Mismatch with discriminator type in union + EIDL_ILLEGAL_ADD, // Illegal add action + EIDL_ILLEGAL_USE, // Illegal type used in expression + EIDL_ILLEGAL_RAISES, // Error in "raises" clause + EIDL_CANT_INHERIT, // Cannot inherit from non-interface + EIDL_LOOKUP_ERROR, // Identifier not found + EIDL_INHERIT_FWD_ERROR, // Cannot inherit from fwd decl interface + EIDL_CONSTANT_EXPECTED, // We got something else.. + EIDL_NAME_CASE_ERROR, // Spelling differences found + EIDL_ENUM_VAL_EXPECTED, // Expected an enumerator + EIDL_ENUM_VAL_NOT_FOUND, // Didnt find an enumerator with that name + EIDL_EVAL_ERROR, // Error in evaluating expression + EIDL_AMBIGUOUS, // Ambiguous name definition + EIDL_DECL_NOT_DEFINED, // Forward declared but never defined + EIDL_FWD_DECL_LOOKUP, // Tried to lookup in fwd declared intf + EIDL_RECURSIVE_TYPE, // Illegal recursive use of type + EIDL_NONVOID_ONEWAY, // Non-void return type in oneway operation + EIDL_NOT_A_TYPE, // Not a type + EIDL_TYPE_NOT_VALID, // Type is not valid in this context + EIDL_INTERFACEMEMBER_LOOKUP, // interface is not defined or a fwd declaration not exists EIDL_SERVICEMEMBER_LOOKUP, - EIDL_TYPE_IDENT_CONFLICT, // type and identifier has equal names - EIDL_ONEWAY_RAISE_CONFLICT, // oneway function raised excpetion conflict + EIDL_TYPE_IDENT_CONFLICT, // type and identifier has equal names + EIDL_ONEWAY_RAISE_CONFLICT, // oneway function raised excpetion conflict EIDL_WRONGATTRIBUTEFLAG, EIDL_DEFINED_ATTRIBUTEFLAG, EIDL_WRONGATTRIBUTEKEYWORD, @@ -108,48 +108,48 @@ class ErrorHandler { public: // Report errors with varying numbers of arguments - void error0(ErrorCode e); - void error1(ErrorCode e, AstDeclaration const * d); - void error2( + void error0(ErrorCode e); + void error1(ErrorCode e, AstDeclaration const * d); + void error2( ErrorCode e, AstDeclaration const * d1, AstDeclaration const * d2); - void error3(ErrorCode e, AstDeclaration* d1, AstDeclaration* d2, AstDeclaration* d3); + void error3(ErrorCode e, AstDeclaration* d1, AstDeclaration* d2, AstDeclaration* d3); // Warning - void warning0(WarningCode e, const sal_Char* warningmsg); + void warning0(WarningCode e, const sal_Char* warningmsg); // Report a syntax error in IDL input - void syntaxError(ParseState state, sal_Int32 lineNumber, const sal_Char* errmsg); + void syntaxError(ParseState state, sal_Int32 lineNumber, const sal_Char* errmsg); // Report an unsuccesful coercion attempt - void coercionError(AstExpression *pExpr, ExprType et); + void coercionError(AstExpression *pExpr, ExprType et); // Report a failed name lookup attempt - void lookupError(const ::rtl::OString& n); + void lookupError(const ::rtl::OString& n); // Report a failed name lookup attempt - void lookupError(ErrorCode e, const ::rtl::OString& n, AstDeclaration* pScope); + void lookupError(ErrorCode e, const ::rtl::OString& n, AstDeclaration* pScope); // Report a type error - void noTypeError(AstDeclaration const * pDecl); + void noTypeError(AstDeclaration const * pDecl); - void inheritanceError(NodeType nodeType, const ::rtl::OString* name, AstDeclaration* pDecl); + void inheritanceError(NodeType nodeType, const ::rtl::OString* name, AstDeclaration* pDecl); - void flagError(ErrorCode e, sal_uInt32 flag); + void flagError(ErrorCode e, sal_uInt32 flag); - void forwardLookupError(AstDeclaration* pForward, const ::rtl::OString& name); + void forwardLookupError(AstDeclaration* pForward, const ::rtl::OString& name); - void constantExpected(AstDeclaration* pDecl, const ::rtl::OString& name); + void constantExpected(AstDeclaration* pDecl, const ::rtl::OString& name); - void evalError(AstExpression* pExpr); + void evalError(AstExpression* pExpr); // Report a situation where an enumerator was expected but we got // something else instead. This occurs when a union with an enum // discriminator is being parsed and one of the branch labels is // not an enumerator in that enum - void enumValExpected(AstUnion* pUnion); + void enumValExpected(AstUnion* pUnion); // Report a failed enumerator lookup in an enum - void enumValLookupFailure(AstUnion* pUnion, AstEnum* pEnum, const ::rtl::OString& name); + void enumValLookupFailure(AstUnion* pUnion, AstEnum* pEnum, const ::rtl::OString& name); bool checkPublished(AstDeclaration const * decl, bool bOptiional=false); }; diff --git a/idlc/inc/idlc/fehelper.hxx b/idlc/inc/idlc/fehelper.hxx index 9c716da3edfd..35e38e7e2d29 100644 --- a/idlc/inc/idlc/fehelper.hxx +++ b/idlc/inc/idlc/fehelper.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,10 +37,10 @@ class FeDeclarator { public: // Enum to denote types of declarators - enum DeclaratorType + enum DeclaratorType { - FD_simple, // Simple declarator - FD_complex // Complex declarator (complex_part field used) + FD_simple, // Simple declarator + FD_complex // Complex declarator (complex_part field used) }; FeDeclarator(const ::rtl::OString& name, DeclaratorType declType, AstDeclaration* pComplPart); @@ -50,7 +50,7 @@ public: { return m_pComplexPart; } const ::rtl::OString& getName() { return m_name; } - DeclaratorType getDeclType() + DeclaratorType getDeclType() { return m_declType; } sal_Bool checkType(AstDeclaration const * pType); @@ -58,7 +58,7 @@ public: private: AstDeclaration* m_pComplexPart; ::rtl::OString m_name; - DeclaratorType m_declType; + DeclaratorType m_declType; }; typedef ::std::list< FeDeclarator* > FeDeclList; @@ -69,7 +69,7 @@ public: FeInheritanceHeader( NodeType nodeType, ::rtl::OString* pName, ::rtl::OString* pInherits, std::vector< rtl::OString > * typeParameters); - + virtual ~FeInheritanceHeader() { if ( m_pName ) @@ -89,8 +89,8 @@ public: private: void initializeInherits(::rtl::OString* pinherits); - NodeType m_nodeType; - ::rtl::OString* m_pName; + NodeType m_nodeType; + ::rtl::OString* m_pName; AstDeclaration* m_pInherits; std::vector< rtl::OString > m_typeParameters; }; diff --git a/idlc/inc/idlc/idlc.hxx b/idlc/inc/idlc/idlc.hxx index 8262b26fc095..a423624579f9 100644 --- a/idlc/inc/idlc/idlc.hxx +++ b/idlc/inc/idlc/idlc.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -75,12 +75,12 @@ public: void setRealFileName(const ::rtl::OString& realFileName) { m_realFileName = realFileName; } const ::rtl::OString& getDocumentation() - { + { m_bIsDocValid = sal_False; - return m_documentation; + return m_documentation; } void setDocumentation(const ::rtl::OString& documentation) - { + { m_documentation = documentation; m_bIsDocValid = sal_True; } @@ -128,25 +128,25 @@ public: void reset(); private: - Options* m_pOptions; - AstStack* m_pScopes; - AstModule* m_pRoot; - ErrorHandler* m_pErrorHandler; - ::rtl::OString m_fileName; - ::rtl::OString m_mainFileName; - ::rtl::OString m_realFileName; - ::rtl::OString m_documentation; - sal_Bool m_bIsDocValid; - sal_Bool m_bGenerateDoc; - sal_Bool m_bIsInMainfile; + Options* m_pOptions; + AstStack* m_pScopes; + AstModule* m_pRoot; + ErrorHandler* m_pErrorHandler; + ::rtl::OString m_fileName; + ::rtl::OString m_mainFileName; + ::rtl::OString m_realFileName; + ::rtl::OString m_documentation; + sal_Bool m_bIsDocValid; + sal_Bool m_bGenerateDoc; + sal_Bool m_bIsInMainfile; bool m_published; - sal_uInt32 m_errorCount; - sal_uInt32 m_warningCount; - sal_uInt32 m_lineNumber; - sal_uInt32 m_offsetStart; - sal_uInt32 m_offsetEnd; - ParseState m_parseState; - StringSet m_includes; + sal_uInt32 m_errorCount; + sal_uInt32 m_warningCount; + sal_uInt32 m_lineNumber; + sal_uInt32 m_offsetStart; + sal_uInt32 m_offsetEnd; + ParseState m_parseState; + StringSet m_includes; }; sal_Int32 compileFile(const ::rtl::OString * pathname); diff --git a/idlc/inc/idlc/idlctypes.hxx b/idlc/inc/idlc/idlctypes.hxx index 0849dd85fb28..a23e760d00cd 100644 --- a/idlc/inc/idlc/idlctypes.hxx +++ b/idlc/inc/idlc/idlctypes.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,15 +61,15 @@ struct LessString } }; -typedef ::std::list< ::rtl::OString > StringList; -typedef ::std::vector< ::rtl::OString > StringVector; -typedef ::std::set< ::rtl::OString, LessString > StringSet; +typedef ::std::list< ::rtl::OString > StringList; +typedef ::std::vector< ::rtl::OString > StringVector; +typedef ::std::set< ::rtl::OString, LessString > StringSet; class AstExpression; -typedef ::std::list< AstExpression* > ExprList; +typedef ::std::list< AstExpression* > ExprList; class AstUnionLabel; -typedef ::std::list< AstUnionLabel* > LabelList; +typedef ::std::list< AstUnionLabel* > LabelList; class AstDeclaration; @@ -85,183 +85,183 @@ AstScope* SAL_CALL declAsScope(AstDeclaration* pDecl); #endif // flags used for attributes, properties and services -#define AF_INVALID 0x0000 -#define AF_READONLY 0x0001 -#define AF_OPTIONAL 0x0002 -#define AF_MAYBEVOID 0x0004 -#define AF_BOUND 0x0008 -#define AF_CONSTRAINED 0x0010 -#define AF_TRANSIENT 0x0020 -#define AF_MAYBEAMBIGUOUS 0x0040 -#define AF_MAYBEDEFAULT 0x0080 -#define AF_REMOVEABLE 0x0100 -#define AF_ATTRIBUTE 0x0200 -#define AF_PROPERTY 0x0400 +#define AF_INVALID 0x0000 +#define AF_READONLY 0x0001 +#define AF_OPTIONAL 0x0002 +#define AF_MAYBEVOID 0x0004 +#define AF_BOUND 0x0008 +#define AF_CONSTRAINED 0x0010 +#define AF_TRANSIENT 0x0020 +#define AF_MAYBEAMBIGUOUS 0x0040 +#define AF_MAYBEDEFAULT 0x0080 +#define AF_REMOVEABLE 0x0100 +#define AF_ATTRIBUTE 0x0200 +#define AF_PROPERTY 0x0400 enum ParseState { PS_NoState, - PS_TypeDeclSeen, // Seen complete typedef declaration - PS_ConstantDeclSeen, // Seen complete const declaration - PS_ExceptionDeclSeen, // Seen complete exception declaration - PS_InterfaceDeclSeen, // Seen complete interface declaration - PS_ServiceDeclSeen, // Seen complete service declaration - PS_SingletonDeclSeen, // Seen complete singleton declaration - PS_ModuleDeclSeen, // Seen complete module declaration - PS_AttributeDeclSeen, // Seen complete attribute declaration - PS_PropertyDeclSeen, // Seen complete property declaration - PS_OperationDeclSeen, // Seen complete operation declaration + PS_TypeDeclSeen, // Seen complete typedef declaration + PS_ConstantDeclSeen, // Seen complete const declaration + PS_ExceptionDeclSeen, // Seen complete exception declaration + PS_InterfaceDeclSeen, // Seen complete interface declaration + PS_ServiceDeclSeen, // Seen complete service declaration + PS_SingletonDeclSeen, // Seen complete singleton declaration + PS_ModuleDeclSeen, // Seen complete module declaration + PS_AttributeDeclSeen, // Seen complete attribute declaration + PS_PropertyDeclSeen, // Seen complete property declaration + PS_OperationDeclSeen, // Seen complete operation declaration PS_InterfaceInheritanceDeclSeen, // Seen complete interface inheritance decl - PS_ConstantsDeclSeen, // Seen complete constants declaration - - PS_ServiceSeen, // Seen a SERVICE keyword - PS_ServiceIDSeen, // Seen the service ID - PS_ServiceSqSeen, // '{' seen for service - PS_ServiceQsSeen, // '}' seen for service - PS_ServiceBodySeen, // Seen complete service body - PS_ServiceMemberSeen, // Seen a service member + PS_ConstantsDeclSeen, // Seen complete constants declaration + + PS_ServiceSeen, // Seen a SERVICE keyword + PS_ServiceIDSeen, // Seen the service ID + PS_ServiceSqSeen, // '{' seen for service + PS_ServiceQsSeen, // '}' seen for service + PS_ServiceBodySeen, // Seen complete service body + PS_ServiceMemberSeen, // Seen a service member PS_ServiceIFHeadSeen, // Seen an interface member header - PS_ServiceSHeadSeen, // Seen an service member header - - PS_SingletonSeen, // Seen a SINGLETON keyword - PS_SingletonIDSeen, // Seen the singleton ID - PS_SingletonSqSeen, // '{' seen for singleton - PS_SingletonQsSeen, // '}' seen for singleton - PS_SingletonBodySeen, // Seen complete singleton body - PS_SingletonMemberSeen, // Seen a singleton member - - PS_ModuleSeen, // Seen a MODULE keyword - PS_ModuleIDSeen, // Seen the module ID - PS_ModuleSqSeen, // '{' seen for module - PS_ModuleQsSeen, // '}' seen for module - PS_ModuleBodySeen, // Seen complete module body - - PS_ConstantsSeen, // Seen a CONSTANTS keyword - PS_ConstantsIDSeen, // Seen the constants ID - PS_ConstantsSqSeen, // '{' seen for constants - PS_ConstantsQsSeen, // '}' seen for constants - PS_ConstantsBodySeen, // Seen complete constants body - - PS_InterfaceSeen, // Seen an INTERFACE keyword - PS_InterfaceIDSeen, // Seen the interface ID - PS_InterfaceHeadSeen, // Seen the interface head - PS_InheritSpecSeen, // Seen a complete inheritance spec - PS_ForwardDeclSeen, // Forward interface decl seen - PS_InterfaceSqSeen, // '{' seen for interface - PS_InterfaceQsSeen, // '}' seen for interface - PS_InterfaceBodySeen, // Seen an interface body - PS_InheritColonSeen, // Seen ':' in inheritance list - - PS_SNListCommaSeen, // Seen ',' in list of scoped names - PS_ScopedNameSeen, // Seen a complete scoped name - PS_SN_IDSeen, // Seen an identifier as part of a scoped name - PS_ScopeDelimSeen, // Seen a scope delim as party of a scoped name - - PS_ConstSeen, // Seen a CONST keyword - PS_ConstTypeSeen, // Parsed the type of a constant - PS_ConstIDSeen, // Seen the constant ID - PS_ConstAssignSeen, // Seen the '=' - PS_ConstExprSeen, // Seen the constant value expression - - PS_TypedefSeen, // Seen a TYPEDEF keyword - PS_TypeSpecSeen, // Seen a complete type specification - PS_DeclaratorsSeen, // Seen a complete list of declarators - - PS_StructSeen, // Seen a STRUCT keyword - PS_StructHeaderSeen, // Seen struct header - PS_StructIDSeen, // Seen the struct ID - PS_StructSqSeen, // '{' seen for struct - PS_StructQsSeen, // '}' seen for struct - PS_StructBodySeen, // Seen complete body of struct decl - - PS_MemberTypeSeen, // Seen type of struct or except member - PS_MemberDeclsSeen, // Seen decls of struct or except members + PS_ServiceSHeadSeen, // Seen an service member header + + PS_SingletonSeen, // Seen a SINGLETON keyword + PS_SingletonIDSeen, // Seen the singleton ID + PS_SingletonSqSeen, // '{' seen for singleton + PS_SingletonQsSeen, // '}' seen for singleton + PS_SingletonBodySeen, // Seen complete singleton body + PS_SingletonMemberSeen, // Seen a singleton member + + PS_ModuleSeen, // Seen a MODULE keyword + PS_ModuleIDSeen, // Seen the module ID + PS_ModuleSqSeen, // '{' seen for module + PS_ModuleQsSeen, // '}' seen for module + PS_ModuleBodySeen, // Seen complete module body + + PS_ConstantsSeen, // Seen a CONSTANTS keyword + PS_ConstantsIDSeen, // Seen the constants ID + PS_ConstantsSqSeen, // '{' seen for constants + PS_ConstantsQsSeen, // '}' seen for constants + PS_ConstantsBodySeen, // Seen complete constants body + + PS_InterfaceSeen, // Seen an INTERFACE keyword + PS_InterfaceIDSeen, // Seen the interface ID + PS_InterfaceHeadSeen, // Seen the interface head + PS_InheritSpecSeen, // Seen a complete inheritance spec + PS_ForwardDeclSeen, // Forward interface decl seen + PS_InterfaceSqSeen, // '{' seen for interface + PS_InterfaceQsSeen, // '}' seen for interface + PS_InterfaceBodySeen, // Seen an interface body + PS_InheritColonSeen, // Seen ':' in inheritance list + + PS_SNListCommaSeen, // Seen ',' in list of scoped names + PS_ScopedNameSeen, // Seen a complete scoped name + PS_SN_IDSeen, // Seen an identifier as part of a scoped name + PS_ScopeDelimSeen, // Seen a scope delim as party of a scoped name + + PS_ConstSeen, // Seen a CONST keyword + PS_ConstTypeSeen, // Parsed the type of a constant + PS_ConstIDSeen, // Seen the constant ID + PS_ConstAssignSeen, // Seen the '=' + PS_ConstExprSeen, // Seen the constant value expression + + PS_TypedefSeen, // Seen a TYPEDEF keyword + PS_TypeSpecSeen, // Seen a complete type specification + PS_DeclaratorsSeen, // Seen a complete list of declarators + + PS_StructSeen, // Seen a STRUCT keyword + PS_StructHeaderSeen, // Seen struct header + PS_StructIDSeen, // Seen the struct ID + PS_StructSqSeen, // '{' seen for struct + PS_StructQsSeen, // '}' seen for struct + PS_StructBodySeen, // Seen complete body of struct decl + + PS_MemberTypeSeen, // Seen type of struct or except member + PS_MemberDeclsSeen, // Seen decls of struct or except members PS_MemberDeclsCompleted,// Completed one struct or except member to ';' - PS_UnionSeen, // Seen a UNION keyword - PS_UnionIDSeen, // Seen the union ID - PS_SwitchSeen, // Seen the SWITCH keyword - PS_SwitchOpenParSeen, // Seen the switch open par. - PS_SwitchTypeSeen, // Seen the switch type spec - PS_SwitchCloseParSeen, // Seen the switch close par. - PS_UnionSqSeen, // '{' seen for union - PS_UnionQsSeen, // '}' seen for union - PS_DefaultSeen, // Seen DEFAULT keyword - PS_UnionLabelSeen, // Seen label of union element - PS_LabelColonSeen, // Seen ':' of union branch label - PS_LabelExprSeen, // Seen expression of union branch label - PS_UnionElemSeen, // Seen a union element - PS_UnionElemCompleted, // Completed one union member up to ';' - PS_CaseSeen, // Seen a CASE keyword - PS_UnionElemTypeSeen, // Seen type spec for union element - PS_UnionElemDeclSeen, // Seen declarator for union element - PS_UnionBodySeen, // Seen completed union body - - PS_EnumSeen, // Seen an ENUM keyword - PS_EnumIDSeen, // Seen the enum ID - PS_EnumSqSeen, // Seen '{' for enum - PS_EnumQsSeen, // Seen '}' for enum - PS_EnumBodySeen, // Seen complete enum body - PS_EnumCommaSeen, // Seen ',' in list of enumerators - - PS_SequenceSeen, // Seen a SEQUENCE keyword - PS_SequenceSqSeen, // Seen '<' for sequence - PS_SequenceQsSeen, // Seen '>' for sequence - PS_SequenceTypeSeen, // Seen type decl for sequence - - PS_ArrayIDSeen, // Seen array ID - PS_ArrayTypeSeen, // Seen array type - PS_ArrayCompleted, // Seen completed array declaration - PS_DimSqSeen, // Seen '[' for array dimension - PS_DimQsSeen, // Seen ']' for array dimension - PS_DimExprSeen, // Seen size expression for array dimension - - - PS_FlagHeaderSeen, // Seen the attribute|property|interface member head - PS_AttrSeen, // Seen ATTRIBUTE keyword - PS_AttrTypeSeen, // Seen type decl for attribute - PS_AttrCompleted, // Seen complete attribute declaration - PS_ReadOnlySeen, // Seen READONLY keyword - PS_OptionalSeen, // Seen OPTIONAL keyword - PS_MayBeVoidSeen, // Seen MAYBEVOID yword - PS_BoundSeen, // Seen BOUND keyword - PS_ConstrainedSeen, // Seen CONSTRAINED keyword - PS_TransientSeen, // Seen TRANSIENT keyword - PS_MayBeAmbigiousSeen, // Seen MAYBEAMBIGIOUS keyword - PS_MayBeDefaultSeen, // Seen MAYBEDEFAULT keyword - PS_RemoveableSeen, // Seen REMOVEABLE keyword - - PS_PropertySeen, // Seen PROPERTY keyword - PS_PropertyTypeSeen, // Seen type decl for property - PS_PropertyCompleted, // Seen complete property declaration - - PS_ExceptSeen, // Seen EXCEPTION keyword - PS_ExceptHeaderSeen, // Seen exception header keyword - PS_ExceptIDSeen, // Seen exception identifier - PS_ExceptSqSeen, // Seen '{' for exception - PS_ExceptQsSeen, // Seen '}' for exception - PS_ExceptBodySeen, // Seen complete exception body - - PS_OpHeadSeen, // Seen the operation head - PS_OpTypeSeen, // Seen operation return type - PS_OpIDSeen, // Seen operation ID - PS_OpParsCompleted, // Completed operation param list - PS_OpCompleted, // Completed operation statement - PS_OpSqSeen, // Seen '(' for operation - PS_OpQsSeen, // Seen ')' for operation - PS_OpParCommaSeen, // Seen ',' in list of op params - PS_OpParDirSeen, // Seen parameter direction - PS_OpParTypeSeen, // Seen parameter type - PS_OpParDeclSeen, // Seen parameter declaration - PS_OpOnewaySeen, // Seen ONEWAY keyword + PS_UnionSeen, // Seen a UNION keyword + PS_UnionIDSeen, // Seen the union ID + PS_SwitchSeen, // Seen the SWITCH keyword + PS_SwitchOpenParSeen, // Seen the switch open par. + PS_SwitchTypeSeen, // Seen the switch type spec + PS_SwitchCloseParSeen, // Seen the switch close par. + PS_UnionSqSeen, // '{' seen for union + PS_UnionQsSeen, // '}' seen for union + PS_DefaultSeen, // Seen DEFAULT keyword + PS_UnionLabelSeen, // Seen label of union element + PS_LabelColonSeen, // Seen ':' of union branch label + PS_LabelExprSeen, // Seen expression of union branch label + PS_UnionElemSeen, // Seen a union element + PS_UnionElemCompleted, // Completed one union member up to ';' + PS_CaseSeen, // Seen a CASE keyword + PS_UnionElemTypeSeen, // Seen type spec for union element + PS_UnionElemDeclSeen, // Seen declarator for union element + PS_UnionBodySeen, // Seen completed union body + + PS_EnumSeen, // Seen an ENUM keyword + PS_EnumIDSeen, // Seen the enum ID + PS_EnumSqSeen, // Seen '{' for enum + PS_EnumQsSeen, // Seen '}' for enum + PS_EnumBodySeen, // Seen complete enum body + PS_EnumCommaSeen, // Seen ',' in list of enumerators + + PS_SequenceSeen, // Seen a SEQUENCE keyword + PS_SequenceSqSeen, // Seen '<' for sequence + PS_SequenceQsSeen, // Seen '>' for sequence + PS_SequenceTypeSeen, // Seen type decl for sequence + + PS_ArrayIDSeen, // Seen array ID + PS_ArrayTypeSeen, // Seen array type + PS_ArrayCompleted, // Seen completed array declaration + PS_DimSqSeen, // Seen '[' for array dimension + PS_DimQsSeen, // Seen ']' for array dimension + PS_DimExprSeen, // Seen size expression for array dimension + + + PS_FlagHeaderSeen, // Seen the attribute|property|interface member head + PS_AttrSeen, // Seen ATTRIBUTE keyword + PS_AttrTypeSeen, // Seen type decl for attribute + PS_AttrCompleted, // Seen complete attribute declaration + PS_ReadOnlySeen, // Seen READONLY keyword + PS_OptionalSeen, // Seen OPTIONAL keyword + PS_MayBeVoidSeen, // Seen MAYBEVOID yword + PS_BoundSeen, // Seen BOUND keyword + PS_ConstrainedSeen, // Seen CONSTRAINED keyword + PS_TransientSeen, // Seen TRANSIENT keyword + PS_MayBeAmbigiousSeen, // Seen MAYBEAMBIGIOUS keyword + PS_MayBeDefaultSeen, // Seen MAYBEDEFAULT keyword + PS_RemoveableSeen, // Seen REMOVEABLE keyword + + PS_PropertySeen, // Seen PROPERTY keyword + PS_PropertyTypeSeen, // Seen type decl for property + PS_PropertyCompleted, // Seen complete property declaration + + PS_ExceptSeen, // Seen EXCEPTION keyword + PS_ExceptHeaderSeen, // Seen exception header keyword + PS_ExceptIDSeen, // Seen exception identifier + PS_ExceptSqSeen, // Seen '{' for exception + PS_ExceptQsSeen, // Seen '}' for exception + PS_ExceptBodySeen, // Seen complete exception body + + PS_OpHeadSeen, // Seen the operation head + PS_OpTypeSeen, // Seen operation return type + PS_OpIDSeen, // Seen operation ID + PS_OpParsCompleted, // Completed operation param list + PS_OpCompleted, // Completed operation statement + PS_OpSqSeen, // Seen '(' for operation + PS_OpQsSeen, // Seen ')' for operation + PS_OpParCommaSeen, // Seen ',' in list of op params + PS_OpParDirSeen, // Seen parameter direction + PS_OpParTypeSeen, // Seen parameter type + PS_OpParDeclSeen, // Seen parameter declaration + PS_OpOnewaySeen, // Seen ONEWAY keyword PS_RaiseSeen, // Seen RAISES keyword PS_RaiseSqSeen, // Seen '(' for RAISES PS_RaiseQsSeen, // Seen ')' for RAISES - PS_DeclsCommaSeen, // Seen ',' in declarators list - PS_DeclsDeclSeen // Seen complete decl in decls list -}; + PS_DeclsCommaSeen, // Seen ',' in declarators list + PS_DeclsDeclSeen // Seen complete decl in decls list +}; #endif // _IDLC_IDLCTYPES_HXX_ diff --git a/idlc/inc/idlc/inheritedinterface.hxx b/idlc/inc/idlc/inheritedinterface.hxx index e983c751acd2..94545d98eb6b 100644 --- a/idlc/inc/idlc/inheritedinterface.hxx +++ b/idlc/inc/idlc/inheritedinterface.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/inc/idlc/options.hxx b/idlc/inc/idlc/options.hxx index 796552aec671..1b725c0414fd 100644 --- a/idlc/inc/idlc/options.hxx +++ b/idlc/inc/idlc/options.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ #include <idlc/idlctypes.hxx> -typedef ::std::hash_map< ::rtl::OString, +typedef ::std::hash_map< ::rtl::OString, ::rtl::OString, HashString, EqualString > OptionMap; @@ -42,7 +42,7 @@ public: IllegalArgument(const ::rtl::OString& msg) : m_message(msg) {} - ::rtl::OString m_message; + ::rtl::OString m_message; }; @@ -52,15 +52,15 @@ public: Options(); ~Options(); - sal_Bool initOptions(int ac, char* av[], sal_Bool bCmdFile=sal_False) + sal_Bool initOptions(int ac, char* av[], sal_Bool bCmdFile=sal_False) throw( IllegalArgument ); ::rtl::OString prepareHelp(); ::rtl::OString prepareVersion(); - const ::rtl::OString& getProgramName() const; - sal_Bool isValid(const ::rtl::OString& option); - const ::rtl::OString getOption(const ::rtl::OString& option) + const ::rtl::OString& getProgramName() const; + sal_Bool isValid(const ::rtl::OString& option); + const ::rtl::OString getOption(const ::rtl::OString& option) throw( IllegalArgument ); const StringVector& getInputFiles() const { return m_inputFiles; } @@ -69,14 +69,14 @@ public: bool quiet() const { return m_quiet; } protected: - ::rtl::OString m_program; - StringVector m_inputFiles; + ::rtl::OString m_program; + StringVector m_inputFiles; bool m_stdin; bool m_verbose; bool m_quiet; - OptionMap m_options; + OptionMap m_options; }; - + #endif // _IDLC_OPTIONS_HXX_ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/inc/pch/precompiled_idlc.cxx b/idlc/inc/pch/precompiled_idlc.cxx index 50db39b8b090..7517fd4bac17 100644 --- a/idlc/inc/pch/precompiled_idlc.cxx +++ b/idlc/inc/pch/precompiled_idlc.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/inc/pch/precompiled_idlc.hxx b/idlc/inc/pch/precompiled_idlc.hxx index 1702e1a05c0b..b077ecce9120 100644 --- a/idlc/inc/pch/precompiled_idlc.hxx +++ b/idlc/inc/pch/precompiled_idlc.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/source/astarray.cxx b/idlc/source/astarray.cxx index 1d3052b577e5..3dfc16c470fa 100644 --- a/idlc/source/astarray.cxx +++ b/idlc/source/astarray.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -72,6 +72,6 @@ OString AstArray::makeName() return name; } return OString(); -} +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/source/astconstant.cxx b/idlc/source/astconstant.cxx index 7f9a1de0425d..8cbc6b449e20 100644 --- a/idlc/source/astconstant.cxx +++ b/idlc/source/astconstant.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,18 +35,18 @@ using namespace ::rtl; -AstConstant::AstConstant(const ExprType type, +AstConstant::AstConstant(const ExprType type, const NodeType nodeType, - AstExpression* pExpr, + AstExpression* pExpr, const ::rtl::OString& name, AstScope* pScope) : AstDeclaration(nodeType, name, pScope) , m_pConstValue(pExpr) , m_constValueType(type) { -} +} -AstConstant::AstConstant(const ExprType type, +AstConstant::AstConstant(const ExprType type, AstExpression* pExpr, const ::rtl::OString& name, AstScope* pScope) @@ -54,60 +54,60 @@ AstConstant::AstConstant(const ExprType type, , m_pConstValue(pExpr) , m_constValueType(type) { -} +} AstConstant::~AstConstant() { - -} + +} sal_Bool AstConstant::dumpBlob( typereg::Writer & rBlob, sal_uInt16 index, bool published) { - RTConstValue aConst; - sal_Unicode* str = NULL; + RTConstValue aConst; + sal_Unicode* str = NULL; AstExprValue *exprVal = getConstValue()->getExprValue(); switch (getConstValueType()) { case ET_short: - aConst.m_type = RT_TYPE_INT16; - aConst.m_value.aShort = exprVal->u.sval; + aConst.m_type = RT_TYPE_INT16; + aConst.m_value.aShort = exprVal->u.sval; break; case ET_ushort: - aConst.m_type = RT_TYPE_UINT16; + aConst.m_type = RT_TYPE_UINT16; aConst.m_value.aUShort = exprVal->u.usval; break; case ET_long: - aConst.m_type = RT_TYPE_INT32; + aConst.m_type = RT_TYPE_INT32; aConst.m_value.aLong = exprVal->u.lval; break; case ET_ulong: - aConst.m_type = RT_TYPE_UINT32; + aConst.m_type = RT_TYPE_UINT32; aConst.m_value.aULong = exprVal->u.ulval; break; case ET_hyper: - aConst.m_type = RT_TYPE_INT64; + aConst.m_type = RT_TYPE_INT64; aConst.m_value.aHyper = exprVal->u.hval; break; case ET_uhyper: - aConst.m_type = RT_TYPE_UINT64; + aConst.m_type = RT_TYPE_UINT64; aConst.m_value.aUHyper = exprVal->u.uhval; break; case ET_float: - aConst.m_type = RT_TYPE_FLOAT; - aConst.m_value.aFloat = exprVal->u.fval; - break; + aConst.m_type = RT_TYPE_FLOAT; + aConst.m_value.aFloat = exprVal->u.fval; + break; case ET_double: - aConst.m_type = RT_TYPE_DOUBLE; + aConst.m_type = RT_TYPE_DOUBLE; aConst.m_value.aDouble = exprVal->u.dval; break; case ET_byte: - aConst.m_type = RT_TYPE_BYTE; + aConst.m_type = RT_TYPE_BYTE; aConst.m_value.aByte = exprVal->u.byval; break; case ET_boolean: - aConst.m_type = RT_TYPE_BOOL; + aConst.m_type = RT_TYPE_BOOL; aConst.m_value.aBool = exprVal->u.bval; break; default: @@ -117,7 +117,7 @@ sal_Bool AstConstant::dumpBlob( return sal_False; } } - + OString name = getLocalName(); OUString type; @@ -125,7 +125,7 @@ sal_Bool AstConstant::dumpBlob( { type = OStringToOUString(exprTypeToString(getConstValueType()), RTL_TEXTENCODING_UTF8); } - + rBlob.setFieldData( index, getDocumentation(), OUString(), RT_ACCESS_CONST | (published ? RT_ACCESS_PUBLISHED : 0), @@ -134,6 +134,6 @@ sal_Bool AstConstant::dumpBlob( delete[] str; return sal_True; -} +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/source/astdeclaration.cxx b/idlc/source/astdeclaration.cxx index f767bb7991bb..1b154a4c3e58 100644 --- a/idlc/source/astdeclaration.cxx +++ b/idlc/source/astdeclaration.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,7 +50,7 @@ static OString convertName(const OString& name) } } while( nIndex != -1 ); return nameBuffer.makeStringAndClear(); -} +} AstDeclaration::AstDeclaration(NodeType type, const OString& name, AstScope* pScope) : m_localName(name) @@ -69,7 +69,7 @@ AstDeclaration::AstDeclaration(NodeType type, const OString& name, AstScope* pSc m_scopedName = pDecl->getScopedName(); if (m_scopedName.getLength() > 0) m_scopedName += sGlobal; - m_scopedName += m_localName; + m_scopedName += m_localName; } } else { @@ -92,11 +92,11 @@ AstDeclaration::AstDeclaration(NodeType type, const OString& name, AstScope* pSc m_bPublished = idlc()->isPublished(); } - + AstDeclaration::~AstDeclaration() { - + } void AstDeclaration::setPredefined(bool bPredefined) @@ -105,7 +105,7 @@ void AstDeclaration::setPredefined(bool bPredefined) if ( m_bPredefined ) { m_fileName = OString(); - m_bInMainFile = sal_False; + m_bInMainFile = sal_False; } } @@ -117,30 +117,30 @@ void AstDeclaration::setName(const ::rtl::OString& name) // Huh ? There is always at least one token -// sal_Int32 count = name.getTokenCount(':'); - -// if ( count > 0 ) -// { -// m_localName = name.getToken(count-1, ':'); -// m_scopedName = name; -// } else if ( m_pScope ) -// { -// m_localName = name; -// AstDeclaration* pDecl = scopeAsDecl(m_pScope); -// if (pDecl) -// { -// m_scopedName = pDecl->getScopedName(); -// if (m_scopedName.getLength() > 0) -// m_scopedName += sGlobal; -// m_scopedName += m_localName; -// } -// } else -// { -// m_localName = name; -// m_scopedName = name; -// } +// sal_Int32 count = name.getTokenCount(':'); + +// if ( count > 0 ) +// { +// m_localName = name.getToken(count-1, ':'); +// m_scopedName = name; +// } else if ( m_pScope ) +// { +// m_localName = name; +// AstDeclaration* pDecl = scopeAsDecl(m_pScope); +// if (pDecl) +// { +// m_scopedName = pDecl->getScopedName(); +// if (m_scopedName.getLength() > 0) +// m_scopedName += sGlobal; +// m_scopedName += m_localName; +// } +// } else +// { +// m_localName = name; +// m_scopedName = name; +// } m_fullName = convertName(m_scopedName); -} +} bool AstDeclaration::isType() const { switch (m_nodeType) { @@ -168,12 +168,12 @@ sal_Bool AstDeclaration::hasAncestor(AstDeclaration* pDecl) if ( !m_pScope ) return sal_False; return scopeAsDecl(m_pScope)->hasAncestor(pDecl); -} +} sal_Bool AstDeclaration::dump(RegistryKey& rKey) { AstScope* pScope = declAsScope(this); - sal_Bool bRet = sal_True; + sal_Bool bRet = sal_True; if ( pScope ) { @@ -201,13 +201,13 @@ sal_Bool AstDeclaration::dump(RegistryKey& rKey) break; default: break; - } + } } - + ++iter; - } + } } return bRet; -} +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/source/astdump.cxx b/idlc/source/astdump.cxx index cf8f33edbc9a..314122c462d0 100644 --- a/idlc/source/astdump.cxx +++ b/idlc/source/astdump.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -56,21 +56,21 @@ sal_Bool AstModule::dump(RegistryKey& rKey) { if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) { - fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", + fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(rKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; } } - sal_uInt16 nConst = getNodeCount(NT_const); + sal_uInt16 nConst = getNodeCount(NT_const); if ( nConst > 0 ) { RTTypeClass typeClass = RT_TYPE_MODULE; if ( getNodeType() == NT_constants ) typeClass = RT_TYPE_CONSTANTS; - + typereg::Writer aBlob( m_bPublished ? TYPEREG_VERSION_1 : TYPEREG_VERSION_0, getDocumentation(), emptyStr, typeClass, @@ -98,14 +98,14 @@ sal_Bool AstModule::dump(RegistryKey& rKey) sal_uInt32 aBlobSize; void const * pBlob = aBlob.getBlob(&aBlobSize); - if (localKey.setValue(emptyStr, RG_VALUETYPE_BINARY, + if (localKey.setValue(emptyStr, RG_VALUETYPE_BINARY, (RegValue)pBlob, aBlobSize)) { - fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", + fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(localKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; - } + } } else { RTTypeClass typeClass = RT_TYPE_MODULE; @@ -123,14 +123,14 @@ sal_Bool AstModule::dump(RegistryKey& rKey) if ( getNodeType() != NT_root ) { - if (localKey.setValue(emptyStr, RG_VALUETYPE_BINARY, + if (localKey.setValue(emptyStr, RG_VALUETYPE_BINARY, (RegValue)pBlob, aBlobSize)) { - fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", + fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(localKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; - } + } } } if ( getNodeType() == NT_root ) @@ -138,7 +138,7 @@ sal_Bool AstModule::dump(RegistryKey& rKey) localKey.releaseKey(); } return AstDeclaration::dump(rKey); -} +} sal_Bool AstTypeDef::dump(RegistryKey& rKey) { @@ -146,7 +146,7 @@ sal_Bool AstTypeDef::dump(RegistryKey& rKey) RegistryKey localKey; if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) { - fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", + fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(rKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; @@ -166,14 +166,14 @@ sal_Bool AstTypeDef::dump(RegistryKey& rKey) if (localKey.setValue(emptyStr, RG_VALUETYPE_BINARY, (RegValue)pBlob, aBlobSize)) { - fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", + fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(localKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; } return sal_True; -} +} sal_Bool AstService::dump(RegistryKey& rKey) { @@ -361,7 +361,7 @@ sal_Bool AstAttribute::dumpBlob( if (isReadonly()) { - accessMode |= RT_ACCESS_READONLY; + accessMode |= RT_ACCESS_READONLY; } else { accessMode |= RT_ACCESS_READWRITE; @@ -412,7 +412,7 @@ sal_Bool AstAttribute::dumpBlob( methodIndex); return sal_True; -} +} void AstAttribute::dumpExceptions( typereg::Writer & writer, rtl::OUString const & documentation, @@ -440,7 +440,7 @@ void AstAttribute::dumpExceptions( } } -const sal_Char* AstSequence::getRelativName() const +const sal_Char* AstSequence::getRelativName() const { if ( !m_pRelativName ) { @@ -448,8 +448,8 @@ const sal_Char* AstSequence::getRelativName() const AstDeclaration const * pType = resolveTypedefs( m_pMemberType ); *m_pRelativName += pType->getRelativName(); } - + return m_pRelativName->getStr(); -} +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/source/astenum.cxx b/idlc/source/astenum.cxx index 5d5a8597b850..9c07915a497d 100644 --- a/idlc/source/astenum.cxx +++ b/idlc/source/astenum.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,10 +39,10 @@ AstEnum::AstEnum(const ::rtl::OString& name, AstScope* pScope) : AstType(NT_enum, name, pScope) , AstScope(NT_enum) , m_enumValueCount(0) -{ -} +{ +} -AstEnum::~AstEnum() +AstEnum::~AstEnum() { } @@ -50,15 +50,15 @@ AstConstant* AstEnum::checkValue(AstExpression* pExpr) { DeclList::const_iterator iter = getIteratorBegin(); DeclList::const_iterator end = getIteratorEnd(); - AstConstant* pConst = NULL; - AstDeclaration* pDecl = NULL; + AstConstant* pConst = NULL; + AstDeclaration* pDecl = NULL; - while ( iter != end) + while ( iter != end) { pDecl = *iter; pConst = (AstConstant*)pDecl; - if (pConst->getConstValue()->compare(pExpr)) + if (pConst->getConstValue()->compare(pExpr)) return pConst; ++iter; @@ -68,14 +68,14 @@ AstConstant* AstEnum::checkValue(AstExpression* pExpr) m_enumValueCount = pExpr->getExprValue()->u.lval + 1; return NULL; -} +} sal_Bool AstEnum::dump(RegistryKey& rKey) { RegistryKey localKey; if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) { - fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", + fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(rKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; @@ -106,23 +106,23 @@ sal_Bool AstEnum::dump(RegistryKey& rKey) sal_uInt32 aBlobSize; void const * pBlob = aBlob.getBlob(&aBlobSize); - - if (localKey.setValue(emptyStr, RG_VALUETYPE_BINARY, + + if (localKey.setValue(emptyStr, RG_VALUETYPE_BINARY, (RegValue)pBlob, aBlobSize)) { - fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", + fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(localKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; - } + } } return sal_True; -} +} AstDeclaration* AstEnum::addDeclaration(AstDeclaration* pDecl) { return AstScope::addDeclaration(pDecl); -} +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/source/astexpression.cxx b/idlc/source/astexpression.cxx index 394bb848bdd1..fd9628663e2d 100644 --- a/idlc/source/astexpression.cxx +++ b/idlc/source/astexpression.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,9 +36,9 @@ #include <limits.h> #include <float.h> -#undef MAXCHAR +#undef MAXCHAR #define MAXCHAR 127 -#undef MINCHAR +#undef MINCHAR #define MINCHAR -128 using namespace ::rtl; @@ -51,8 +51,8 @@ AstExpression::AstExpression(ExprComb c, AstExpression *pExpr1, AstExpression *p , m_pSymbolicName(NULL) { fillDefinitionDetails(); - -} + +} AstExpression::AstExpression(sal_Int32 l) : m_combOperator(EC_none) @@ -66,9 +66,9 @@ AstExpression::AstExpression(sal_Int32 l) m_exprValue = new AstExprValue(); m_exprValue->et = ET_long; m_exprValue->u.lval = l; -} +} -AstExpression::AstExpression(sal_Int32 l, ExprType et) +AstExpression::AstExpression(sal_Int32 l, ExprType et) : m_combOperator(EC_none) , m_subExpr1(NULL) , m_subExpr2(NULL) @@ -80,9 +80,9 @@ AstExpression::AstExpression(sal_Int32 l, ExprType et) m_exprValue = new AstExprValue(); m_exprValue->et = et; m_exprValue->u.lval = l; -} +} -AstExpression::AstExpression(sal_Int64 h) +AstExpression::AstExpression(sal_Int64 h) : m_combOperator(EC_none) , m_subExpr1(NULL) , m_subExpr2(NULL) @@ -94,9 +94,9 @@ AstExpression::AstExpression(sal_Int64 h) m_exprValue = new AstExprValue(); m_exprValue->et = ET_hyper; m_exprValue->u.hval = h; -} +} -AstExpression::AstExpression(sal_uInt64 uh) +AstExpression::AstExpression(sal_uInt64 uh) : m_combOperator(EC_none) , m_subExpr1(NULL) , m_subExpr2(NULL) @@ -108,9 +108,9 @@ AstExpression::AstExpression(sal_uInt64 uh) m_exprValue = new AstExprValue(); m_exprValue->et = ET_uhyper; m_exprValue->u.uhval = uh; -} +} -AstExpression::AstExpression(double d) +AstExpression::AstExpression(double d) : m_combOperator(EC_none) , m_subExpr1(NULL) , m_subExpr2(NULL) @@ -122,7 +122,7 @@ AstExpression::AstExpression(double d) m_exprValue = new AstExprValue(); m_exprValue->et = ET_double; m_exprValue->u.dval = d; -} +} AstExpression::AstExpression(::rtl::OString* scopedName) : m_combOperator(EC_symbol) @@ -132,8 +132,8 @@ AstExpression::AstExpression(::rtl::OString* scopedName) , m_pSymbolicName(scopedName) { fillDefinitionDetails(); -} - +} + AstExpression::~AstExpression() { if ( m_exprValue ) @@ -144,7 +144,7 @@ AstExpression::~AstExpression() delete m_subExpr2; if ( m_pSymbolicName ) delete m_pSymbolicName; -} +} /* * Perform the coercion from the given AstExprValue to the requested @@ -157,10 +157,10 @@ coerce_value(AstExprValue *ev, ExprType t) if (ev == NULL) return NULL; - switch (t) + switch (t) { case ET_short: - switch (ev->et) + switch (ev->et) { case ET_short: return ev; @@ -219,7 +219,7 @@ coerce_value(AstExprValue *ev, ExprType t) return NULL; } case ET_ushort: - switch (ev->et) + switch (ev->et) { case ET_short: if (ev->u.sval < 0) @@ -278,7 +278,7 @@ coerce_value(AstExprValue *ev, ExprType t) return NULL; } case ET_long: - switch (ev->et) + switch (ev->et) { case ET_short: ev->u.lval = (sal_Int32)ev->u.sval; @@ -333,7 +333,7 @@ coerce_value(AstExprValue *ev, ExprType t) return NULL; } case ET_ulong: - switch (ev->et) + switch (ev->et) { case ET_short: if (ev->u.sval < 0) @@ -390,7 +390,7 @@ coerce_value(AstExprValue *ev, ExprType t) return NULL; } case ET_hyper: - switch (ev->et) + switch (ev->et) { case ET_short: ev->u.hval = (sal_Int64)ev->u.sval; @@ -441,7 +441,7 @@ coerce_value(AstExprValue *ev, ExprType t) return NULL; } case ET_uhyper: - switch (ev->et) + switch (ev->et) { case ET_short: if (ev->u.sval < 0) @@ -496,7 +496,7 @@ coerce_value(AstExprValue *ev, ExprType t) return NULL; } case ET_boolean: - switch (ev->et) + switch (ev->et) { case ET_short: ev->u.bval = (ev->u.sval == 0) ? sal_False : sal_True; @@ -541,7 +541,7 @@ coerce_value(AstExprValue *ev, ExprType t) return NULL; } case ET_float: - switch (ev->et) + switch (ev->et) { case ET_short: ev->u.fval = (float)ev->u.sval; @@ -590,7 +590,7 @@ coerce_value(AstExprValue *ev, ExprType t) return NULL; } case ET_double: - switch (ev->et) + switch (ev->et) { case ET_short: ev->u.dval = (double)ev->u.sval; @@ -637,7 +637,7 @@ coerce_value(AstExprValue *ev, ExprType t) return NULL; } case ET_byte: - switch (ev->et) + switch (ev->et) { case ET_short: if (ev->u.sval < SAL_MIN_INT8 || ev->u.sval > SAL_MAX_UINT8) @@ -706,9 +706,9 @@ coerce_value(AstExprValue *ev, ExprType t) /* * Evaluate the expression with the evaluation kind requested. Supported * evaluation kinds are - * - EK_const: The expression must evaluate to a constant - * - EK_positive_int: The expression must further evaluate to a - * positive integer + * - EK_const: The expression must evaluate to a constant + * - EK_positive_int: The expression must further evaluate to a + * positive integer */ static AstExprValue * eval_kind(AstExprValue *ev, EvalKind ek) @@ -746,7 +746,7 @@ AstExprValue* AstExpression::coerce(ExprType t, sal_Bool bAssign) copy = new AstExprValue; copy->et = m_exprValue->et; - switch (m_exprValue->et) + switch (m_exprValue->et) { case ET_short: copy->u.sval = m_exprValue->u.sval; @@ -788,7 +788,7 @@ AstExprValue* AstExpression::coerce(ExprType t, sal_Bool bAssign) m_exprValue = coerce_value(copy, t); return m_exprValue; } - + return coerce_value(copy, t); } @@ -796,7 +796,7 @@ void AstExpression::evaluate(EvalKind ek) { m_exprValue = eval_internal(ek); m_exprValue = eval_kind(m_exprValue, ek); -} +} sal_Bool AstExpression::operator==(AstExpression *pExpr) { @@ -808,7 +808,7 @@ sal_Bool AstExpression::operator==(AstExpression *pExpr) return sal_False; if (m_exprValue->et != pExpr->getExprValue()->et) return sal_False; - switch (m_exprValue->et) + switch (m_exprValue->et) { case ET_short: return (m_exprValue->u.sval == pExpr->getExprValue()->u.sval) ? sal_True : sal_False; @@ -836,10 +836,10 @@ sal_Bool AstExpression::operator==(AstExpression *pExpr) } return sal_False; -} +} sal_Bool AstExpression::compare(AstExpression *pExpr) -{ +{ if (m_combOperator != pExpr->getCombOperator()) return sal_False; evaluate(EK_const); @@ -848,7 +848,7 @@ sal_Bool AstExpression::compare(AstExpression *pExpr) return sal_False; if (m_exprValue->et != pExpr->getExprValue()->et) return sal_False; - switch (m_exprValue->et) + switch (m_exprValue->et) { case ET_short: return (m_exprValue->u.sval == pExpr->getExprValue()->u.sval) ? sal_True : sal_False; @@ -876,11 +876,11 @@ sal_Bool AstExpression::compare(AstExpression *pExpr) } return sal_False; -} - +} + void AstExpression::fillDefinitionDetails() { - m_pScope = idlc()->scopes()->depth() > 0 ? idlc()->scopes()->top() : NULL; + m_pScope = idlc()->scopes()->depth() > 0 ? idlc()->scopes()->top() : NULL; m_lineNo = idlc()->getLineNumber(); m_fileName = idlc()->getFileName(); } @@ -895,7 +895,7 @@ AstExprValue* AstExpression::eval_internal(EvalKind ek) /* * OK, must evaluate operator */ - switch (m_combOperator) + switch (m_combOperator) { case EC_add: case EC_minus: @@ -924,7 +924,7 @@ AstExprValue* AstExpression::eval_internal(EvalKind ek) } return NULL; -} +} AstExprValue* AstExpression::eval_bin_op(EvalKind ek) { @@ -954,7 +954,7 @@ AstExprValue* AstExpression::eval_bin_op(EvalKind ek) retval = new AstExprValue(); retval->et = eType; - switch (m_combOperator) + switch (m_combOperator) { case EC_mod: if (m_subExpr2->getExprValue()->u.hval == 0) @@ -978,13 +978,13 @@ AstExprValue* AstExpression::eval_bin_op(EvalKind ek) default: return NULL; } - + return retval; -} - +} + AstExprValue* AstExpression::eval_bit_op(EvalKind ek) { - AstExprValue *retval = NULL; + AstExprValue *retval = NULL; if (ek != EK_const && ek != EK_positive_int) return NULL; @@ -1006,7 +1006,7 @@ AstExprValue* AstExpression::eval_bit_op(EvalKind ek) retval = new AstExprValue; retval->et = ET_long; - switch (m_combOperator) + switch (m_combOperator) { case EC_or: retval->u.lval = m_subExpr1->getExprValue()->u.lval | m_subExpr2->getExprValue()->u.lval; @@ -1026,13 +1026,13 @@ AstExprValue* AstExpression::eval_bit_op(EvalKind ek) default: return NULL; } - + return retval; -} - +} + AstExprValue* AstExpression::eval_un_op(EvalKind ek) { - AstExprValue *retval = NULL; + AstExprValue *retval = NULL; if (m_exprValue != NULL) return m_exprValue; @@ -1051,7 +1051,7 @@ AstExprValue* AstExpression::eval_un_op(EvalKind ek) retval = new AstExprValue(); retval->et = ET_double; - switch (m_combOperator) + switch (m_combOperator) { case EC_u_plus: retval->u.lval = m_subExpr1->getExprValue()->u.lval; @@ -1068,20 +1068,20 @@ AstExprValue* AstExpression::eval_un_op(EvalKind ek) default: return NULL; } - + return retval; -} +} AstExprValue* AstExpression::eval_symbol(EvalKind ek) { - AstScope *pScope = 0; - AstDeclaration *pDecl; - AstConstant *pConst; + AstScope *pScope = 0; + AstDeclaration *pDecl; + AstConstant *pConst; /* * Is there a symbol stored? */ - if (m_pSymbolicName == NULL) + if (m_pSymbolicName == NULL) { idlc()->error()->evalError(this); return NULL; @@ -1091,7 +1091,7 @@ AstExprValue* AstExpression::eval_symbol(EvalKind ek) */ if (idlc()->scopes()->depth() > 0) pScope = idlc()->scopes()->topNonNull(); - if ( !pScope ) + if ( !pScope ) { idlc()->error()->lookupError(*m_pSymbolicName); return NULL; @@ -1100,7 +1100,7 @@ AstExprValue* AstExpression::eval_symbol(EvalKind ek) * Do lookup */ pDecl = pScope->lookupByName(*m_pSymbolicName); - if (pDecl == NULL) + if (pDecl == NULL) { idlc()->error()->lookupError(*m_pSymbolicName); return NULL; @@ -1109,7 +1109,7 @@ AstExprValue* AstExpression::eval_symbol(EvalKind ek) * Is it a constant? */ if (pDecl->getNodeType() != NT_const && - pDecl->getNodeType() != NT_enum_val) + pDecl->getNodeType() != NT_enum_val) { idlc()->error()->constantExpected(pDecl, *m_pSymbolicName); return NULL; @@ -1126,7 +1126,7 @@ AstExprValue* AstExpression::eval_symbol(EvalKind ek) return NULL; return pConst->getConstValue()->eval_internal(ek); } - + OString AstExpression::toString() { OString exprStr; @@ -1135,7 +1135,7 @@ OString AstExpression::toString() if ( m_exprValue ) { - switch (m_exprValue->et) + switch (m_exprValue->et) { case ET_short: return OString::valueOf((sal_Int32)m_exprValue->u.sval); @@ -1156,17 +1156,17 @@ OString AstExpression::toString() case ET_byte: return OString::valueOf((sal_Int32)m_exprValue->u.byval); case ET_boolean: - if ( m_exprValue->u.lval == 0) + if ( m_exprValue->u.lval == 0) return OString("FALSE"); else - return OString("TRUE"); + return OString("TRUE"); default: OSL_ASSERT(false); return OString(); } - } + } - switch (m_combOperator) + switch (m_combOperator) { case EC_u_plus: exprStr += OString("+"); @@ -1182,7 +1182,7 @@ OString AstExpression::toString() } if ( m_subExpr1 ) exprStr += m_subExpr1->toString(); - switch (m_combOperator) + switch (m_combOperator) { case EC_add: exprStr += OString(" + "); @@ -1217,17 +1217,17 @@ OString AstExpression::toString() default: break; } - + if ( m_subExpr2 ) exprStr += m_subExpr2->toString(); return exprStr; -} +} // Convert the type of an AST_Expression to a char * const sal_Char* SAL_CALL exprTypeToString(ExprType t) { - switch (t) + switch (t) { case ET_short: return "short"; diff --git a/idlc/source/astinterface.cxx b/idlc/source/astinterface.cxx index 5400036185c4..03c463441106 100644 --- a/idlc/source/astinterface.cxx +++ b/idlc/source/astinterface.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,7 +38,7 @@ using namespace ::rtl; -AstInterface::AstInterface(const ::rtl::OString& name, +AstInterface::AstInterface(const ::rtl::OString& name, AstInterface const * pInherits, AstScope* pScope) : AstType(NT_interface, name, pScope) @@ -118,7 +118,7 @@ sal_Bool AstInterface::dump(RegistryKey& rKey) RegistryKey localKey; if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) { - fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", + fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(rKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; @@ -261,14 +261,14 @@ sal_Bool AstInterface::dump(RegistryKey& rKey) if (localKey.setValue(emptyStr, RG_VALUETYPE_BINARY, (RegValue)pBlob, aBlobSize)) { - fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", + fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(localKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; } return true; -} +} void AstInterface::checkInheritedInterfaceClashes( DoubleDeclarations & doubleDeclarations, diff --git a/idlc/source/astoperation.cxx b/idlc/source/astoperation.cxx index 2cc90da3ad9c..8cd32ecaf21f 100644 --- a/idlc/source/astoperation.cxx +++ b/idlc/source/astoperation.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -56,9 +56,9 @@ bool AstOperation::isVariadic() const { sal_Bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index) { - sal_uInt16 nParam = getNodeCount(NT_parameter); - sal_uInt16 nExcep = nExceptions(); - RTMethodMode methodMode = RT_MODE_TWOWAY; + sal_uInt16 nParam = getNodeCount(NT_parameter); + sal_uInt16 nExcep = nExceptions(); + RTMethodMode methodMode = RT_MODE_TWOWAY; if ( isOneway() ) methodMode = RT_MODE_ONEWAY; @@ -76,7 +76,7 @@ sal_Bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index) returnTypeName, nParam, nExcep); if ( nParam ) - { + { DeclList::const_iterator iter = getIteratorBegin(); DeclList::const_iterator end = getIteratorEnd(); AstDeclaration* pDecl = NULL; @@ -84,7 +84,7 @@ sal_Bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index) sal_uInt16 paramIndex = 0; while ( iter != end ) { - pDecl = *iter; + pDecl = *iter; if ( pDecl->getNodeType() == NT_parameter ) { AstParameter* pParam = (AstParameter*)pDecl; @@ -102,12 +102,12 @@ sal_Bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index) default: paramMode = RT_PARAM_INVALID; break; - } + } if (pParam->isRest()) { paramMode = static_cast< RTParamMode >( paramMode | RT_PARAM_REST); } - + rBlob.setMethodParameterData( index, paramIndex++, paramMode, OStringToOUString( @@ -117,7 +117,7 @@ sal_Bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index) RTL_TEXTENCODING_UTF8)); } ++iter; - } + } } if ( nExcep ) @@ -132,25 +132,25 @@ sal_Bool AstOperation::dumpBlob(typereg::Writer & rBlob, sal_uInt16 index) OStringToOUString( (*iter)->getRelativName(), RTL_TEXTENCODING_UTF8)); ++iter; - } + } } return sal_True; -} +} AstDeclaration* AstOperation::addDeclaration(AstDeclaration* pDecl) { if ( pDecl->getNodeType() == NT_parameter ) { AstParameter* pParam = (AstParameter*)pDecl; - if ( isOneway() && + if ( isOneway() && (pParam->getDirection() == DIR_OUT || pParam->getDirection() == DIR_INOUT) ) { idlc()->error()->error2(EIDL_ONEWAY_CONFLICT, pDecl, this); - return NULL; + return NULL; } } return AstScope::addDeclaration(pDecl); -} +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/source/astscope.cxx b/idlc/source/astscope.cxx index 0b1a750f5a8b..1333a43f65b3 100644 --- a/idlc/source/astscope.cxx +++ b/idlc/source/astscope.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,37 +40,37 @@ sal_Bool isGlobal(const OString& scopedName) { if ((scopedName.getLength() == 0) || (scopedName.indexOf(':') == 0)) { - return sal_True; + return sal_True; } return sal_False; -} +} AstScope::AstScope(NodeType nodeType) : m_nodeType(nodeType) { - -} + +} AstScope::~AstScope() { - -} + +} AstDeclaration* AstScope::addDeclaration(AstDeclaration* pDecl) { AstDeclaration* pDeclaration = NULL; - if ((pDeclaration = lookupForAdd(pDecl)) != NULL) + if ((pDeclaration = lookupForAdd(pDecl)) != NULL) { if (pDecl->getNodeType() == NT_union_branch ) { m_declarations.push_back(pDecl); - return pDecl; + return pDecl; } if ( pDecl->hasAncestor(pDeclaration) ) { idlc()->error()->error2(EIDL_REDEF_SCOPE, pDecl, pDeclaration); - return NULL; + return NULL; } if ( (pDecl->getNodeType() == pDeclaration->getNodeType()) && (pDecl->getNodeType() == NT_sequence @@ -87,23 +87,23 @@ AstDeclaration* AstScope::addDeclaration(AstDeclaration* pDecl) return pDecl; } if ( (NT_service == m_nodeType) && - ( ((pDecl->getNodeType() == NT_interface_member) + ( ((pDecl->getNodeType() == NT_interface_member) && (pDeclaration->getNodeType() == NT_interface)) || - ((pDecl->getNodeType() == NT_service_member) + ((pDecl->getNodeType() == NT_service_member) && (pDeclaration->getNodeType() == NT_service)) ) ) { m_declarations.push_back(pDecl); return pDecl; } - + idlc()->error()->error2(EIDL_REDEF_SCOPE, scopeAsDecl(this), pDecl); - return NULL; + return NULL; } - + m_declarations.push_back(pDecl); return pDecl; -} +} sal_uInt16 AstScope::getNodeCount(NodeType nodeType) { @@ -111,7 +111,7 @@ sal_uInt16 AstScope::getNodeCount(NodeType nodeType) DeclList::const_iterator end = getIteratorEnd(); AstDeclaration* pDecl = NULL; sal_uInt16 count = 0; - + while ( iter != end ) { pDecl = *iter; @@ -119,23 +119,23 @@ sal_uInt16 AstScope::getNodeCount(NodeType nodeType) count++; ++iter; } - return count; -} + return count; +} AstDeclaration* AstScope::lookupByName(const OString& scopedName) { AstDeclaration* pDecl = NULL; - AstScope* pScope = NULL; + AstScope* pScope = NULL; if (scopedName.getLength() == 0) return NULL; - + // If name starts with "::" start look up in global scope if ( isGlobal(scopedName) ) { pDecl = scopeAsDecl(this); if ( !pDecl ) return NULL; - + pScope = pDecl->getScope(); // If this is the global scope ... if ( !pScope ) @@ -146,7 +146,7 @@ AstDeclaration* AstScope::lookupByName(const OString& scopedName) return pDecl; //return pScope->lookupByName(); } - // OK, not global scope yet, so simply iterate with parent scope + // OK, not global scope yet, so simply iterate with parent scope pDecl = pScope->lookupByName(scopedName); return pDecl; } @@ -155,7 +155,7 @@ AstDeclaration* AstScope::lookupByName(const OString& scopedName) // Look up in the local scope and start with the first scope sal_Int32 nIndex = scopedName.indexOf(':'); OString firstScope = nIndex > 0 ? scopedName.copy(0, nIndex) : scopedName; - sal_Bool bFindFirstScope = sal_True; + sal_Bool bFindFirstScope = sal_True; pDecl = lookupByNameLocal(firstScope); if ( !pDecl ) { @@ -170,10 +170,10 @@ AstDeclaration* AstScope::lookupByName(const OString& scopedName) pDecl = pScope->lookupByName(scopedName); else pDecl = NULL; - + // Special case for scope which is an interface. We // have to look in the inherited interfaces as well. - if ( !pDecl ) + if ( !pDecl ) { if (m_nodeType == NT_interface) pDecl = lookupInInherited(scopedName); @@ -209,20 +209,20 @@ AstDeclaration* AstScope::lookupByName(const OString& scopedName) } else { pDecl = NULL; - } + } } } return pDecl; -} +} AstDeclaration* AstScope::lookupByNameLocal(const OString& name) const { DeclList::const_iterator iter(m_declarations.begin()); DeclList::const_iterator end(m_declarations.end()); AstDeclaration* pDecl = NULL; - + while ( iter != end ) { pDecl = *iter; @@ -230,13 +230,13 @@ AstDeclaration* AstScope::lookupByNameLocal(const OString& name) const return pDecl; ++iter; } - return NULL; -} + return NULL; +} AstDeclaration* AstScope::lookupInInherited(const OString& scopedName) const { - AstInterface* pInterface = (AstInterface*)this; - + AstInterface* pInterface = (AstInterface*)this; + if ( !pInterface ) return NULL; @@ -269,9 +269,9 @@ AstDeclaration* AstScope::lookupInInherited(const OString& scopedName) const AstDeclaration* AstScope::lookupPrimitiveType(ExprType type) { AstDeclaration* pDecl = NULL; - AstScope* pScope = NULL; - AstBaseType* pBaseType = NULL; - OString typeName; + AstScope* pScope = NULL; + AstBaseType* pBaseType = NULL; + OString typeName; pDecl = scopeAsDecl(this); if ( !pDecl ) return NULL; @@ -279,7 +279,7 @@ AstDeclaration* AstScope::lookupPrimitiveType(ExprType type) if ( pScope) return pScope->lookupPrimitiveType(type); - switch (type) + switch (type) { case ET_none: OSL_ASSERT(false); @@ -331,19 +331,19 @@ AstDeclaration* AstScope::lookupPrimitiveType(ExprType type) break; } - pDecl = lookupByNameLocal(typeName); + pDecl = lookupByNameLocal(typeName); if ( pDecl && (pDecl->getNodeType() == NT_predefined) ) { pBaseType = (AstBaseType*)pDecl; - + if ( pBaseType->getExprType() == type ) return pDecl; } return NULL; } - + AstDeclaration* AstScope::lookupForAdd(AstDeclaration* pDecl) { if ( !pDecl ) @@ -351,7 +351,7 @@ AstDeclaration* AstScope::lookupForAdd(AstDeclaration* pDecl) AstDeclaration* pRetDecl = lookupByNameLocal(pDecl->getLocalName()); - return pRetDecl; -} + return pRetDecl; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/source/astservice.cxx b/idlc/source/astservice.cxx index b26997cc3ab9..ae1ff66227f8 100644 --- a/idlc/source/astservice.cxx +++ b/idlc/source/astservice.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/source/aststack.cxx b/idlc/source/aststack.cxx index 711c86d45fad..49063d1f1106 100644 --- a/idlc/source/aststack.cxx +++ b/idlc/source/aststack.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,22 +43,22 @@ AstStack::AstStack() AstStack::~AstStack() { - for(sal_uInt32 i=0; i < m_top; i++) + for(sal_uInt32 i=0; i < m_top; i++) { - if (m_stack[i]) + if (m_stack[i]) delete(m_stack[i]); } - + rtl_freeMemory(m_stack); } sal_uInt32 AstStack::depth() -{ +{ return m_top; } AstScope* AstStack::top() -{ +{ if (m_top < 1) return NULL; return m_stack[m_top - 1]; @@ -68,8 +68,8 @@ AstScope* AstStack::bottom() { if (m_top == 0) return NULL; - return m_stack[0]; -} + return m_stack[0]; +} AstScope* AstStack::nextToTop() { @@ -78,37 +78,37 @@ AstScope* AstStack::nextToTop() if (depth() < 2) return NULL; - tmp = top(); // Save top - (void) pop(); // Pop it - retval = top(); // Get next one down - (void) push(tmp); // Push top back - return retval; // Return next one down -} + tmp = top(); // Save top + (void) pop(); // Pop it + retval = top(); // Get next one down + (void) push(tmp); // Push top back + return retval; // Return next one down +} AstScope* AstStack::topNonNull() { for (sal_uInt32 i = m_top; i > 0; i--) { - if ( m_stack[i - 1] ) + if ( m_stack[i - 1] ) return m_stack[i - 1]; } return NULL; -} +} AstStack* AstStack::push(AstScope* pScope) -{ - AstScope **tmp; -// AstDeclaration *pDecl = ScopeAsDecl(pScope); - sal_uInt32 newSize; - sal_uInt32 i; +{ + AstScope **tmp; +// AstDeclaration *pDecl = ScopeAsDecl(pScope); + sal_uInt32 newSize; + sal_uInt32 i; // Make sure there's space for one more - if (m_size == m_top) + if (m_size == m_top) { newSize = m_size; newSize += STACKSIZE_INCREMENT; - tmp = (AstScope**)rtl_allocateZeroMemory(sizeof(AstScope*) * newSize); - + tmp = (AstScope**)rtl_allocateZeroMemory(sizeof(AstScope*) * newSize); + for(i=0; i < m_size; i++) tmp[i] = m_stack[i]; @@ -123,7 +123,7 @@ AstStack* AstStack::push(AstScope* pScope) } void AstStack::pop() -{ +{ AstScope *pScope; if (m_top < 1) @@ -132,7 +132,7 @@ void AstStack::pop() } void AstStack::clear() -{ +{ m_top = 0; } diff --git a/idlc/source/aststruct.cxx b/idlc/source/aststruct.cxx index 3a8a959062ed..5ac1777948df 100644 --- a/idlc/source/aststruct.cxx +++ b/idlc/source/aststruct.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,8 +51,8 @@ AstStruct::AstStruct( } } -AstStruct::AstStruct(const NodeType type, - const OString& name, +AstStruct::AstStruct(const NodeType type, + const OString& name, AstStruct* pBaseType, AstScope* pScope) : AstType(type, name, pScope) @@ -93,7 +93,7 @@ sal_Bool AstStruct::dump(RegistryKey& rKey) RegistryKey localKey; if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) { - fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", + fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(rKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; @@ -135,9 +135,9 @@ sal_Bool AstStruct::dump(RegistryKey& rKey) DeclList::const_iterator iter = getIteratorBegin(); DeclList::const_iterator end = getIteratorEnd(); AstDeclaration* pDecl = NULL; - AstMember* pMember = NULL; - OUString docu; - sal_uInt16 index = 0; + AstMember* pMember = NULL; + OUString docu; + sal_uInt16 index = 0; while ( iter != end ) { pDecl = *iter; @@ -175,17 +175,17 @@ sal_Bool AstStruct::dump(RegistryKey& rKey) sal_uInt32 aBlobSize; void const * pBlob = aBlob.getBlob(&aBlobSize); - - if (localKey.setValue(emptyStr, RG_VALUETYPE_BINARY, + + if (localKey.setValue(emptyStr, RG_VALUETYPE_BINARY, (RegValue)pBlob, aBlobSize)) { - fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", + fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(localKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; - } + } return sal_True; -} +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/source/aststructinstance.cxx b/idlc/source/aststructinstance.cxx index e2292d016912..16b96c93bceb 100644 --- a/idlc/source/aststructinstance.cxx +++ b/idlc/source/aststructinstance.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/source/astunion.cxx b/idlc/source/astunion.cxx index aaa6ca36aa83..4c0f5c688667 100644 --- a/idlc/source/astunion.cxx +++ b/idlc/source/astunion.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,7 +44,7 @@ AstUnion::AstUnion(const ::rtl::OString& name, AstType* pDiscType, AstScope* pSc { AstBaseType* pBaseType; - if ( !pDiscType ) + if ( !pDiscType ) { m_pDiscriminantType = NULL; m_discExprType = ET_none; @@ -55,17 +55,17 @@ AstUnion::AstUnion(const ::rtl::OString& name, AstType* pDiscType, AstScope* pSc * then install the equivalent coercion target type in * the pd_udisc_type field. */ - if ( pDiscType->getNodeType() == NT_predefined ) + if ( pDiscType->getNodeType() == NT_predefined ) { pBaseType = (AstBaseType*)pDiscType; - if ( !pBaseType ) + if ( !pBaseType ) { m_pDiscriminantType = NULL; m_discExprType = ET_none; return; } m_pDiscriminantType = pDiscType; - switch (pBaseType->getExprType()) + switch (pBaseType->getExprType()) { case ET_long: case ET_ulong: @@ -80,12 +80,12 @@ AstUnion::AstUnion(const ::rtl::OString& name, AstType* pDiscType, AstScope* pSc m_pDiscriminantType = NULL; break; } - } else - if (pDiscType->getNodeType() == NT_enum) + } else + if (pDiscType->getNodeType() == NT_enum) { m_discExprType = ET_any; m_pDiscriminantType = pDiscType; - } else + } else { m_discExprType = ET_none; m_pDiscriminantType = NULL; @@ -97,22 +97,22 @@ AstUnion::AstUnion(const ::rtl::OString& name, AstType* pDiscType, AstScope* pSc AstUnion::~AstUnion() { -} +} AstDeclaration* AstUnion::addDeclaration(AstDeclaration* pDecl) { if ( pDecl->getNodeType() == NT_union_branch ) { AstUnionBranch* pBranch = (AstUnionBranch*)pDecl; - if ( lookupBranch(pBranch) ) + if ( lookupBranch(pBranch) ) { idlc()->error()->error2(EIDL_MULTIPLE_BRANCH, this, pDecl); return NULL; } } - + return AstScope::addDeclaration(pDecl); -} +} AstUnionBranch* AstUnion::lookupBranch(AstUnionBranch* pBranch) { @@ -121,38 +121,38 @@ AstUnionBranch* AstUnion::lookupBranch(AstUnionBranch* pBranch) if ( pBranch ) pLabel = pBranch->getLabel(); - if ( pLabel ) + if ( pLabel ) { if (pLabel->getLabelKind() == UL_default) return lookupDefault(); - if (m_discExprType == ET_any) + if (m_discExprType == ET_any) /* CONVENTION: indicates enum discr */ return lookupEnum(pBranch); return lookupLabel(pBranch); } return NULL; -} +} AstUnionBranch* AstUnion::lookupDefault(sal_Bool bReportError) { DeclList::const_iterator iter = getIteratorBegin(); DeclList::const_iterator end = getIteratorEnd(); - AstUnionBranch *pBranch = NULL; - AstDeclaration *pDecl = NULL; + AstUnionBranch *pBranch = NULL; + AstDeclaration *pDecl = NULL; - while ( iter != end ) + while ( iter != end ) { pDecl = *iter; - if ( pDecl->getNodeType() == NT_union_branch ) + if ( pDecl->getNodeType() == NT_union_branch ) { pBranch = (AstUnionBranch*)pDecl; - if (pBranch == NULL) + if (pBranch == NULL) { ++iter; continue; } if ( pBranch->getLabel() != NULL && - pBranch->getLabel()->getLabelKind() == UL_default) + pBranch->getLabel()->getLabelKind() == UL_default) { if ( bReportError ) idlc()->error()->error2(EIDL_MULTIPLE_BRANCH, this, pBranch); @@ -162,7 +162,7 @@ AstUnionBranch* AstUnion::lookupDefault(sal_Bool bReportError) ++iter; } return NULL; -} +} AstUnionBranch* AstUnion::lookupLabel(AstUnionBranch* pBranch) { @@ -170,10 +170,10 @@ AstUnionBranch* AstUnion::lookupLabel(AstUnionBranch* pBranch) if ( !pLabel->getLabelValue() ) return pBranch; -// pLabel->getLabelValue()->setExprValue(pLabel->getLabelValue()->coerce(m_discExprType, sal_False)); +// pLabel->getLabelValue()->setExprValue(pLabel->getLabelValue()->coerce(m_discExprType, sal_False)); AstExprValue* pLabelValue = pLabel->getLabelValue()->coerce( m_discExprType, sal_False); - if ( !pLabelValue ) + if ( !pLabelValue ) { idlc()->error()->evalError(pLabel->getLabelValue()); return pBranch; @@ -184,23 +184,23 @@ AstUnionBranch* AstUnion::lookupLabel(AstUnionBranch* pBranch) DeclList::const_iterator iter = getIteratorBegin(); DeclList::const_iterator end = getIteratorEnd(); - AstUnionBranch* pB = NULL; - AstDeclaration* pDecl = NULL; + AstUnionBranch* pB = NULL; + AstDeclaration* pDecl = NULL; - while ( iter != end ) + while ( iter != end ) { pDecl = *iter; - if ( pDecl->getNodeType() == NT_union_branch ) + if ( pDecl->getNodeType() == NT_union_branch ) { pB = (AstUnionBranch*)pDecl; - if ( !pB ) + if ( !pB ) { ++iter; continue; } if ( pB->getLabel() != NULL && pB->getLabel()->getLabelKind() == UL_label && - pB->getLabel()->getLabelValue()->compare(pLabel->getLabelValue()) ) + pB->getLabel()->getLabelValue()->compare(pLabel->getLabelValue()) ) { idlc()->error()->error2(EIDL_MULTIPLE_BRANCH, this, pBranch); return pBranch; @@ -209,14 +209,14 @@ AstUnionBranch* AstUnion::lookupLabel(AstUnionBranch* pBranch) ++iter; } return NULL; -} +} AstUnionBranch* AstUnion::lookupEnum(AstUnionBranch* pBranch) { - AstDeclaration const * pType = resolveTypedefs(m_pDiscriminantType); + AstDeclaration const * pType = resolveTypedefs(m_pDiscriminantType); if ( pType->getNodeType() != NT_enum ) return NULL; - + AstUnionLabel* pLabel = pBranch->getLabel(); AstExpression* pExpr = pLabel->getLabelValue(); if ( !pExpr ) @@ -225,7 +225,7 @@ AstUnionBranch* AstUnion::lookupEnum(AstUnionBranch* pBranch) /* * Expecting a symbol label */ - if ( pExpr->getCombOperator() != EC_symbol) + if ( pExpr->getCombOperator() != EC_symbol) { idlc()->error()->enumValExpected(this); return pBranch; @@ -236,7 +236,7 @@ AstUnionBranch* AstUnion::lookupEnum(AstUnionBranch* pBranch) */ AstEnum* pEnum = (AstEnum*)pType; AstDeclaration* pDecl = pEnum->lookupByName(*pExpr->getSymbolicName()); - if ( pDecl == NULL || pDecl->getScope() != pEnum) + if ( pDecl == NULL || pDecl->getScope() != pEnum) { idlc()->error()->enumValLookupFailure(this, pEnum, *pExpr->getSymbolicName()); return pBranch; @@ -245,23 +245,23 @@ AstUnionBranch* AstUnion::lookupEnum(AstUnionBranch* pBranch) DeclList::const_iterator iter = getIteratorBegin(); DeclList::const_iterator end = getIteratorEnd(); - AstUnionBranch* pB = NULL; + AstUnionBranch* pB = NULL; pDecl = NULL; - while ( iter != end ) + while ( iter != end ) { pDecl = *iter; - if ( pDecl->getNodeType() == NT_union_branch ) + if ( pDecl->getNodeType() == NT_union_branch ) { pB = (AstUnionBranch*)pDecl; - if ( !pB ) + if ( !pB ) { ++iter; continue; } if ( pB->getLabel() != NULL && pB->getLabel()->getLabelKind() == UL_label && - pB->getLabel()->getLabelValue()->compare(pLabel->getLabelValue()) ) + pB->getLabel()->getLabelValue()->compare(pLabel->getLabelValue()) ) { idlc()->error()->error2(EIDL_MULTIPLE_BRANCH, this, pBranch); return pBranch; @@ -270,14 +270,14 @@ AstUnionBranch* AstUnion::lookupEnum(AstUnionBranch* pBranch) ++iter; } return NULL; -} +} sal_Bool AstUnion::dump(RegistryKey& rKey) { RegistryKey localKey; if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey)) { - fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", + fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(rKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; @@ -302,16 +302,16 @@ sal_Bool AstUnion::dump(RegistryKey& rKey) AstDeclaration* pDecl = NULL; AstUnionBranch* pBranch = NULL; AstUnionBranch* pDefault = lookupDefault(sal_False); - AstUnionLabel* pLabel = NULL; - AstExprValue* pExprValue = NULL; - RTConstValue aConst; - RTFieldAccess access = RT_ACCESS_READWRITE; - OUString docu; - sal_uInt16 index = 0; + AstUnionLabel* pLabel = NULL; + AstExprValue* pExprValue = NULL; + RTConstValue aConst; + RTFieldAccess access = RT_ACCESS_READWRITE; + OUString docu; + sal_uInt16 index = 0; if ( pDefault ) index = 1; - sal_Int64 disc = 0; + sal_Int64 disc = 0; while ( iter != end ) { pDecl = *iter; @@ -322,7 +322,7 @@ sal_Bool AstUnion::dump(RegistryKey& rKey) { ++iter; continue; - } + } pLabel = pBranch->getLabel(); pExprValue = pLabel->getLabelValue()->coerce(ET_hyper, sal_False); @@ -361,30 +361,30 @@ sal_Bool AstUnion::dump(RegistryKey& rKey) sal_uInt32 aBlobSize; void const * pBlob = aBlob.getBlob(&aBlobSize); - - if (localKey.setValue(OUString(), RG_VALUETYPE_BINARY, + + if (localKey.setValue(OUString(), RG_VALUETYPE_BINARY, (RegValue)pBlob, aBlobSize)) { - fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", + fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(localKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return sal_False; - } - + } + return sal_True; -} +} AstUnionBranch::AstUnionBranch(AstUnionLabel* pLabel, AstType const * pType, const ::rtl::OString& name, AstScope* pScope) : AstMember(NT_union_branch, pType, name, pScope) - , m_pLabel(pLabel) + , m_pLabel(pLabel) { -} +} AstUnionBranch::~AstUnionBranch() { if ( m_pLabel ) delete m_pLabel; -} +} AstUnionLabel::AstUnionLabel(UnionLabel labelKind, AstExpression* pExpr) : m_label(labelKind) @@ -399,6 +399,6 @@ AstUnionLabel::~AstUnionLabel() if ( m_pLabelValue ) delete m_pLabelValue; } - + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/idlc/source/attributeexceptions.hxx b/idlc/source/attributeexceptions.hxx index 080a009bbbcc..7f7741042558 100644 --- a/idlc/source/attributeexceptions.hxx +++ b/idlc/source/attributeexceptions.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/source/errorhandler.cxx b/idlc/source/errorhandler.cxx index 30ecd1ef7ca4..6875d6b78c2d 100644 --- a/idlc/source/errorhandler.cxx +++ b/idlc/source/errorhandler.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -168,7 +168,7 @@ static const sal_Char* errorCodeToMessage(ErrorCode eCode) return "two constructors have identical lists of parameter types"; } return "unknown errror"; -} +} static const sal_Char* warningCodeToMessage(WarningCode wCode) { @@ -186,7 +186,7 @@ static const sal_Char* warningCodeToMessage(WarningCode wCode) return "type or identifier doesn't fulfill the UNO naming convention: "; } return "unkown warning"; -} +} static const sal_Char* parseStateToMessage(ParseState state) { @@ -456,7 +456,7 @@ static const sal_Char* parseStateToMessage(ParseState state) default: return "no wider described syntax error"; } -} +} static OString flagToString(sal_uInt32 flag) { @@ -487,7 +487,7 @@ static OString flagToString(sal_uInt32 flag) flagStr += "'unknown'"; return flagStr; -} +} static void errorHeader(ErrorCode eCode, sal_Int32 lineNumber, sal_uInt32 start, sal_uInt32 end) { @@ -496,12 +496,12 @@ static void errorHeader(ErrorCode eCode, sal_Int32 lineNumber, sal_uInt32 start, file = idlc()->getMainFileName(); else file = idlc()->getFileName(); - + fprintf(stderr, "%s:%lu [%lu:%lu] : %s", file.getStr(), sal::static_int_cast< unsigned long >(lineNumber), sal::static_int_cast< unsigned long >(start), sal::static_int_cast< unsigned long >(end), - errorCodeToMessage(eCode)); + errorCodeToMessage(eCode)); } static void errorHeader(ErrorCode eCode, sal_uInt32 lineNumber) @@ -509,12 +509,12 @@ static void errorHeader(ErrorCode eCode, sal_uInt32 lineNumber) errorHeader(eCode, lineNumber, idlc()->getOffsetStart(), idlc()->getOffsetEnd()); } - + static void errorHeader(ErrorCode eCode) { errorHeader(eCode, idlc()->getLineNumber(), idlc()->getOffsetStart(), idlc()->getOffsetEnd()); -} +} static void warningHeader(WarningCode wCode) { @@ -523,42 +523,42 @@ static void warningHeader(WarningCode wCode) file = idlc()->getMainFileName(); else file = idlc()->getFileName(); - + fprintf(stderr, "%s(%lu) : WARNING, %s", file.getStr(), sal::static_int_cast< unsigned long >(idlc()->getLineNumber()), - warningCodeToMessage(wCode)); -} + warningCodeToMessage(wCode)); +} void ErrorHandler::error0(ErrorCode e) { - errorHeader(e); + errorHeader(e); fprintf(stderr, "\n"); - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} void ErrorHandler::error1(ErrorCode e, AstDeclaration const * d) { errorHeader(e); - fprintf(stderr, "'%s'\n", d->getScopedName().getStr()); - idlc()->incErrorCount(); -} + fprintf(stderr, "'%s'\n", d->getScopedName().getStr()); + idlc()->incErrorCount(); +} void ErrorHandler::error2( ErrorCode e, AstDeclaration const * d1, AstDeclaration const * d2) { - errorHeader(e); - fprintf(stderr, "'%s', '%s'\n", d1->getScopedName().getStr(), - d2->getScopedName().getStr()); - idlc()->incErrorCount(); -} + errorHeader(e); + fprintf(stderr, "'%s', '%s'\n", d1->getScopedName().getStr(), + d2->getScopedName().getStr()); + idlc()->incErrorCount(); +} void ErrorHandler::error3(ErrorCode e, AstDeclaration* d1, AstDeclaration* d2, AstDeclaration* d3) { - errorHeader(e); - fprintf(stderr, "'%s', '%s', '%s'\n", d1->getScopedName().getStr(), - d2->getScopedName().getStr(), d3->getScopedName().getStr()); - idlc()->incErrorCount(); -} + errorHeader(e); + fprintf(stderr, "'%s', '%s', '%s'\n", d1->getScopedName().getStr(), + d2->getScopedName().getStr(), d3->getScopedName().getStr()); + idlc()->incErrorCount(); +} void ErrorHandler::warning0(WarningCode w, const sal_Char* warningmsg) { @@ -568,53 +568,53 @@ void ErrorHandler::warning0(WarningCode w, const sal_Char* warningmsg) } if ( idlc()->getOptions()->isValid("-we") ) - idlc()->incErrorCount(); + idlc()->incErrorCount(); else - idlc()->incWarningCount(); -} + idlc()->incWarningCount(); +} void ErrorHandler::syntaxError(ParseState ps, sal_Int32 lineNumber, const sal_Char* errmsg) { - errorHeader(EIDL_SYNTAX_ERROR, lineNumber); - fprintf(stderr, "%s: %s\n", parseStateToMessage(ps), errmsg); - idlc()->incErrorCount(); -} + errorHeader(EIDL_SYNTAX_ERROR, lineNumber); + fprintf(stderr, "%s: %s\n", parseStateToMessage(ps), errmsg); + idlc()->incErrorCount(); +} void ErrorHandler::coercionError(AstExpression *pExpr, ExprType et) { - errorHeader(EIDL_COERCION_FAILURE); - fprintf(stderr, "'%s' to '%s'\n", pExpr->toString().getStr(), + errorHeader(EIDL_COERCION_FAILURE); + fprintf(stderr, "'%s' to '%s'\n", pExpr->toString().getStr(), exprTypeToString(et)); - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} void ErrorHandler::lookupError(const ::rtl::OString& n) { errorHeader(EIDL_LOOKUP_ERROR); fprintf(stderr, "'%s'\n", n.getStr()); - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} void ErrorHandler::lookupError(ErrorCode e, const ::rtl::OString& n, AstDeclaration* pScope) { errorHeader(e); fprintf(stderr, "'%s' in '%s'\n", n.getStr(), pScope->getFullName().getStr()); - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} void ErrorHandler::flagError(ErrorCode e, sal_uInt32 flag) { errorHeader(e); fprintf(stderr, "'%s'\n", flagToString(flag).getStr()); - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} void ErrorHandler::noTypeError(AstDeclaration const * pDecl) { errorHeader(EIDL_NOT_A_TYPE); fprintf(stderr, "'%s'\n", pDecl->getScopedName().getStr()); - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} namespace { @@ -639,7 +639,7 @@ char const * nodeTypeName(NodeType nodeType) { void ErrorHandler::inheritanceError(NodeType nodeType, const OString* name, AstDeclaration* pDecl) { if ( nodeType == NT_interface && - (pDecl->getNodeType() == NT_interface) && + (pDecl->getNodeType() == NT_interface) && !((AstInterface*)pDecl)->isDefined() ) { errorHeader(EIDL_INHERIT_FWD_ERROR); @@ -652,48 +652,48 @@ void ErrorHandler::inheritanceError(NodeType nodeType, const OString* name, AstD nodeTypeName(nodeType), name->getStr(), pDecl->getScopedName().getStr()); } - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} -void ErrorHandler::forwardLookupError(AstDeclaration* pForward, +void ErrorHandler::forwardLookupError(AstDeclaration* pForward, const ::rtl::OString& name) { errorHeader(EIDL_FWD_DECL_LOOKUP); fprintf(stderr, "trying to look up '%s' in undefined forward declared interface '%s'\n", pForward->getScopedName().getStr(), name.getStr()); - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} -void ErrorHandler::constantExpected(AstDeclaration* pDecl, +void ErrorHandler::constantExpected(AstDeclaration* pDecl, const ::rtl::OString& name) { errorHeader(EIDL_CONSTANT_EXPECTED); fprintf(stderr, "'%s' is bound to '%s'\n", name.getStr(), pDecl->getScopedName().getStr()); - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} void ErrorHandler::evalError(AstExpression* pExpr) { errorHeader(EIDL_EVAL_ERROR); fprintf(stderr, "'%s'\n", pExpr->toString().getStr()); - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} void ErrorHandler::enumValExpected(AstUnion* pUnion) { errorHeader(EIDL_ENUM_VAL_EXPECTED); fprintf(stderr, " union %s\n", pUnion->getLocalName().getStr()); - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} void ErrorHandler::enumValLookupFailure(AstUnion* pUnion, AstEnum* pEnum, const ::rtl::OString& name) { errorHeader(EIDL_ENUM_VAL_NOT_FOUND); - fprintf(stderr, " union %s, enum %s, enumerator %s\n", - pUnion->getLocalName().getStr(), + fprintf(stderr, " union %s, enum %s, enumerator %s\n", + pUnion->getLocalName().getStr(), pEnum->getLocalName().getStr(), name.getStr()); - idlc()->incErrorCount(); -} + idlc()->incErrorCount(); +} bool ErrorHandler::checkPublished(AstDeclaration const * decl, bool bOptional) { if (idlc()->isPublished() && !decl->isPublished() && !bOptional) { diff --git a/idlc/source/fehelper.cxx b/idlc/source/fehelper.cxx index 306d4f16306a..5598c993cc8c 100644 --- a/idlc/source/fehelper.cxx +++ b/idlc/source/fehelper.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,11 +40,11 @@ FeDeclarator::FeDeclarator(const OString& name, DeclaratorType declType, AstDecl , m_name(name) , m_declType(declType) { -} +} FeDeclarator::~FeDeclarator() { -} +} sal_Bool FeDeclarator::checkType(AstDeclaration const * type) { @@ -57,27 +57,27 @@ sal_Bool FeDeclarator::checkType(AstDeclaration const * type) return sal_False; else return sal_True; -} +} AstType const * FeDeclarator::compose(AstDeclaration const * pDecl) { - AstArray* pArray; - AstType* pType; + AstArray* pArray; + AstType* pType; if ( pDecl == 0 ) { return NULL; } - if ( !pDecl->isType() ) + if ( !pDecl->isType() ) { idlc()->error()->noTypeError(pDecl); return NULL; } pType = (AstType*)pDecl; - if (m_declType == FD_simple || m_pComplexPart == NULL) + if (m_declType == FD_simple || m_pComplexPart == NULL) return pType; - if (m_pComplexPart->getNodeType() == NT_array) + if (m_pComplexPart->getNodeType() == NT_array) { pArray = (AstArray*)m_pComplexPart; pArray->setType(pType); @@ -90,14 +90,14 @@ AstType const * FeDeclarator::compose(AstDeclaration const * pDecl) if ( (AstDeclaration*)pArray != pDecl2 ) { delete m_pComplexPart; - m_pComplexPart = pDecl2; + m_pComplexPart = pDecl2; } } return pArray; } return NULL; // return through this statement should not happen -} +} FeInheritanceHeader::FeInheritanceHeader( NodeType nodeType, ::rtl::OString* pName, ::rtl::OString* pInherits, diff --git a/idlc/source/idlc.cxx b/idlc/source/idlc.cxx index d1b3b9587d5b..7fcc8e8abcf2 100644 --- a/idlc/source/idlc.cxx +++ b/idlc/source/idlc.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ AstDeclaration* SAL_CALL scopeAsDecl(AstScope* pScope) { if (pScope == NULL) return NULL; - switch( pScope->getScopeNodeType() ) + switch( pScope->getScopeNodeType() ) { case NT_service: case NT_singleton: @@ -79,13 +79,13 @@ AstDeclaration* SAL_CALL scopeAsDecl(AstScope* pScope) default: return NULL; } -} +} AstScope* SAL_CALL declAsScope(AstDeclaration* pDecl) { if (pDecl == NULL) return NULL; - switch(pDecl->getNodeType()) + switch(pDecl->getNodeType()) { case NT_interface: return (AstInterface*)(pDecl); @@ -110,7 +110,7 @@ AstScope* SAL_CALL declAsScope(AstDeclaration* pDecl) default: return NULL; } -} +} static void SAL_CALL predefineXInterface(AstModule* pRoot) { @@ -122,7 +122,7 @@ static void SAL_CALL predefineXInterface(AstModule* pRoot) pParentScope = pModule; pModule = new AstModule(OString("sun"), pParentScope); pModule->setPredefined(true); - pParentScope->addDeclaration(pModule); + pParentScope->addDeclaration(pModule); pParentScope = pModule; pModule = new AstModule(OString("star"), pParentScope); pModule->setPredefined(true); @@ -153,7 +153,7 @@ static void SAL_CALL predefineXInterface(AstModule* pRoot) pOp = new AstOperation(1, (AstType*)(pRoot->lookupPrimitiveType(ET_void)), OString("acquire"), pInterface); pInterface->addMember(pOp); - + // define XInterface::release pOp = new AstOperation(1, (AstType*)(pRoot->lookupPrimitiveType(ET_void)), OString("release"), pInterface); @@ -167,7 +167,7 @@ static void SAL_CALL initializePredefinedTypes(AstModule* pRoot) { pPredefined = new AstBaseType(ET_long, OString("long"), pRoot); pRoot->addDeclaration(pPredefined); - + pPredefined = new AstBaseType(ET_ulong, OString("unsigned long"), pRoot); pRoot->addDeclaration(pPredefined); @@ -176,37 +176,37 @@ static void SAL_CALL initializePredefinedTypes(AstModule* pRoot) pPredefined = new AstBaseType(ET_uhyper, OString("unsigned hyper"), pRoot); pRoot->addDeclaration(pPredefined); - + pPredefined = new AstBaseType(ET_short, OString("short"), pRoot); pRoot->addDeclaration(pPredefined); - + pPredefined = new AstBaseType(ET_ushort, OString("unsigned short"), pRoot); pRoot->addDeclaration(pPredefined); - + pPredefined = new AstBaseType(ET_float, OString("float"), pRoot); pRoot->addDeclaration(pPredefined); - + pPredefined = new AstBaseType(ET_double, OString("double"), pRoot); pRoot->addDeclaration(pPredefined); - + pPredefined = new AstBaseType(ET_char, OString("char"), pRoot); pRoot->addDeclaration(pPredefined); - + pPredefined = new AstBaseType(ET_byte, OString("byte"), pRoot); pRoot->addDeclaration(pPredefined); - + pPredefined = new AstBaseType(ET_any, OString("any"), pRoot); pRoot->addDeclaration(pPredefined); pPredefined = new AstBaseType(ET_string, OString("string"), pRoot); pRoot->addDeclaration(pPredefined); - + pPredefined = new AstBaseType(ET_type, OString("type"), pRoot); pRoot->addDeclaration(pPredefined); - + pPredefined = new AstBaseType(ET_boolean, OString("boolean"), pRoot); pRoot->addDeclaration(pPredefined); - + pPredefined = new AstBaseType(ET_void, OString("void"), pRoot); pRoot->addDeclaration(pPredefined); } @@ -227,9 +227,9 @@ Idlc::Idlc(Options* pOptions) m_pScopes = new AstStack(); // init root object after construction m_pRoot = NULL; - m_pErrorHandler = new ErrorHandler(); + m_pErrorHandler = new ErrorHandler(); m_bGenerateDoc = m_pOptions->isValid("-C"); -} +} Idlc::~Idlc() { @@ -239,13 +239,13 @@ Idlc::~Idlc() delete m_pScopes; if (m_pErrorHandler) delete m_pErrorHandler; -} +} void Idlc::init() { if ( m_pRoot ) delete m_pRoot; - + m_pRoot = new AstModule(NT_root, OString(), NULL); // push the root node on the stack @@ -253,7 +253,7 @@ void Idlc::init() initializePredefinedTypes(m_pRoot); predefineXInterface(m_pRoot); } - + void Idlc::reset() { m_bIsDocValid = sal_False; @@ -269,31 +269,31 @@ void Idlc::reset() m_mainFileName = OString(); m_realFileName = OString(); m_documentation = OString(); - + m_pScopes->clear(); if ( m_pRoot) delete m_pRoot; m_pRoot = new AstModule(NT_root, OString(), NULL); - + // push the root node on the stack m_pScopes->push(m_pRoot); - initializePredefinedTypes(m_pRoot); + initializePredefinedTypes(m_pRoot); } sal_Bool Idlc::isDocValid() -{ +{ if ( m_bGenerateDoc ) - return m_bIsDocValid; + return m_bIsDocValid; return sal_False;; } - + static Idlc* pStaticIdlc = NULL; Idlc* SAL_CALL idlc() { return pStaticIdlc; -} +} Idlc* SAL_CALL setIdlc(Options* pOptions) { @@ -304,7 +304,7 @@ Idlc* SAL_CALL setIdlc(Options* pOptions) pStaticIdlc = new Idlc(pOptions); pStaticIdlc->init(); return pStaticIdlc; -} +} AstDeclaration const * resolveTypedefs(AstDeclaration const * type) { if (type != 0) { diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx index 48c975b280a9..8453a3e8be49 100644 --- a/idlc/source/idlccompile.cxx +++ b/idlc/source/idlccompile.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,10 +40,10 @@ #include <io.h> #endif -#ifdef SAL_UNX +#ifdef SAL_UNX #include <unistd.h> #if defined(MACOSX) || defined(FREEBSD) || defined(NETBSD) || \ - defined(AIX) || defined(OPENBSD) + defined(AIX) || defined(OPENBSD) #include <sys/wait.h> #else #include <wait.h> @@ -302,9 +302,9 @@ sal_Int32 compileFile(const OString * pathname) #ifdef SAL_OS2_00 char* tok = strtok( (char*)cppArgs.getStr(), " \t\n\r"); while( tok) { - if (tok[strlen(tok)-1] == '\"') + if (tok[strlen(tok)-1] == '\"') tok[strlen(tok)-1] = '\0'; - if (*tok == '\"') + if (*tok == '\"') memcpy( tok, tok+1, strlen(tok)); if (strlen(tok)>0) { fputs(tok, pCmdFile); @@ -328,15 +328,15 @@ sal_Int32 compileFile(const OString * pathname) sal_Int32 idx= cpp.lastIndexOf(OUString( RTL_CONSTASCII_USTRINGPARAM("idlc")) ); cpp = cpp.copy(0, idx); - + #if defined(SAL_W32) || defined(SAL_OS2) cpp += OUString( RTL_CONSTASCII_USTRINGPARAM("idlcpp.exe")); #else cpp += OUString( RTL_CONSTASCII_USTRINGPARAM("idlcpp")); #endif - oslProcess hProcess = NULL; - oslProcessError procError = osl_Process_E_None; + oslProcess hProcess = NULL; + oslProcessError procError = osl_Process_E_None; procError = osl_executeProcess(cpp.pData, &cmdArg.pData, 1, osl_Process_WAIT, 0, startDir.pData, 0, 0, &hProcess); diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx index 4a7cdbbb7f2b..21f8b89c36fd 100644 --- a/idlc/source/idlcmain.cxx +++ b/idlc/source/idlcmain.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,14 +37,14 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { Options options; - try + try { if (!options.initOptions(argc, argv)) exit(1); } catch( IllegalArgument& e) { - fprintf(stderr, "Illegal argument: %s\n%s", + fprintf(stderr, "Illegal argument: %s\n%s", e.m_message.getStr(), options.prepareVersion().getStr()); exit(99); @@ -114,21 +114,21 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) OString strippedFileName(sysFileName.copy(sysFileName.lastIndexOf(SEPARATOR) + 1)); outputFileUrl = convertToFileUrl(options.getOption("-O")); sal_Char c = outputFileUrl.getStr()[outputFileUrl.getLength()-1]; - + if ( c != '/' ) outputFileUrl += OString::valueOf('/'); - + outputFileUrl += strippedFileName.replaceAt(strippedFileName.getLength() -3 , 3, "urd"); } else { outputFileUrl = convertToFileUrl(sysFileName.replaceAt(sysFileName.getLength() -3 , 3, "urd")); } - + if ( nErrors ) removeIfExists(outputFileUrl); else nErrors = produceFile(outputFileUrl); - + idlc()->reset(); } @@ -136,7 +136,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { fprintf(stderr, "%s: detected %ld errors%s", options.getProgramName().getStr(), - sal::static_int_cast< long >(nErrors), + sal::static_int_cast< long >(nErrors), options.prepareVersion().getStr()); } else { diff --git a/idlc/source/idlcproduce.cxx b/idlc/source/idlcproduce.cxx index f97357a4e500..5633ddb3608b 100644 --- a/idlc/source/idlcproduce.cxx +++ b/idlc/source/idlcproduce.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -73,7 +73,7 @@ static sal_Bool checkOutputPath(const OString& completeName) } else nIndex = 0; - + do { buffer.append(sysPathName.getToken(0, SEPARATOR, nIndex)); @@ -87,8 +87,8 @@ static sal_Bool checkOutputPath(const OString& completeName) #endif { if (errno == ENOENT) - { - fprintf(stderr, "%s: cannot create directory '%s'\n", + { + fprintf(stderr, "%s: cannot create directory '%s'\n", idlc()->getOptions()->getProgramName().getStr(), buffer.getStr()); return sal_False; } @@ -96,13 +96,13 @@ static sal_Bool checkOutputPath(const OString& completeName) { if ( !pCreatedDirectories ) pCreatedDirectories = new StringList(); - pCreatedDirectories->push_front(buffer.getStr()); + pCreatedDirectories->push_front(buffer.getStr()); } } buffer.append(SEPARATOR); } while( nIndex != -1 ); return sal_True; -} +} static sal_Bool cleanPath() { @@ -113,12 +113,12 @@ static sal_Bool cleanPath() while ( iter != end ) { //#ifdef SAL_UNX -// if (rmdir((char*)(*iter).getStr(), 0777) == -1) +// if (rmdir((char*)(*iter).getStr(), 0777) == -1) //#else if (rmdir((char*)(*iter).getStr()) == -1) //#endif { - fprintf(stderr, "%s: cannot remove directory '%s'\n", + fprintf(stderr, "%s: cannot remove directory '%s'\n", idlc()->getOptions()->getProgramName().getStr(), (*iter).getStr()); return sal_False; } @@ -133,19 +133,19 @@ void removeIfExists(const OString& pathname) { unlink(pathname.getStr()); } - + sal_Int32 SAL_CALL produceFile(const OString& regFileName) { Options* pOptions = idlc()->getOptions(); OString regTmpName = regFileName.replaceAt(regFileName.getLength() -3, 3, "_idlc_"); - if ( !checkOutputPath(regFileName) ) + if ( !checkOutputPath(regFileName) ) { - fprintf(stderr, "%s: could not create path of registry file '%s'.\n", + fprintf(stderr, "%s: could not create path of registry file '%s'.\n", pOptions->getProgramName().getStr(), regFileName.getStr()); return 1; - } + } removeIfExists(regTmpName); OString urlRegTmpName = convertToFileUrl(regTmpName); @@ -153,26 +153,26 @@ sal_Int32 SAL_CALL produceFile(const OString& regFileName) Registry regFile; if ( regFile.create(OStringToOUString(urlRegTmpName, RTL_TEXTENCODING_UTF8)) != REG_NO_ERROR ) { - fprintf(stderr, "%s: could not create registry file '%s'\n", + fprintf(stderr, "%s: could not create registry file '%s'\n", pOptions->getProgramName().getStr(), regTmpName.getStr()); removeIfExists(regTmpName); removeIfExists(regFileName); cleanPath(); - return 1; + return 1; } RegistryKey rootKey; if ( regFile.openRootKey(rootKey) != REG_NO_ERROR ) { - fprintf(stderr, "%s: could not open root of registry file '%s'\n", + fprintf(stderr, "%s: could not open root of registry file '%s'\n", pOptions->getProgramName().getStr(), regFileName.getStr()); removeIfExists(regTmpName); removeIfExists(regFileName); cleanPath(); - return 1; + return 1; } - // produce registry file + // produce registry file if ( !idlc()->getRoot()->dump(rootKey) ) { rootKey.releaseKey(); @@ -181,12 +181,12 @@ sal_Int32 SAL_CALL produceFile(const OString& regFileName) removeIfExists(regFileName); cleanPath(); return 1; - } + } rootKey.releaseKey(); if ( regFile.close() != REG_NO_ERROR ) { - fprintf(stderr, "%s: could not close registry file '%s'\n", + fprintf(stderr, "%s: could not close registry file '%s'\n", pOptions->getProgramName().getStr(), regFileName.getStr()); removeIfExists(regTmpName); removeIfExists(regFileName); @@ -198,15 +198,15 @@ sal_Int32 SAL_CALL produceFile(const OString& regFileName) if ( File::move(OStringToOUString(regTmpName, osl_getThreadTextEncoding()), OStringToOUString(regFileName, osl_getThreadTextEncoding())) != FileBase::E_None ) { - fprintf(stderr, "%s: cannot rename temporary registry '%s' to '%s'\n", - idlc()->getOptions()->getProgramName().getStr(), + fprintf(stderr, "%s: cannot rename temporary registry '%s' to '%s'\n", + idlc()->getOptions()->getProgramName().getStr(), regTmpName.getStr(), regFileName.getStr()); removeIfExists(regTmpName); cleanPath(); return 1; } removeIfExists(regTmpName); - + return 0; } diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx index fe02e3a6e169..ec9315ce2337 100644 --- a/idlc/source/options.cxx +++ b/idlc/source/options.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,37 +37,37 @@ using namespace rtl; Options::Options(): m_stdin(false), m_verbose(false), m_quiet(false) { -} +} Options::~Options() { } -sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) +sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) throw( IllegalArgument ) { - sal_Bool ret = sal_True; - sal_uInt16 j=0; - + sal_Bool ret = sal_True; + sal_uInt16 j=0; + if (!bCmdFile) { bCmdFile = sal_True; - + m_program = av[0]; - + if (ac < 2) { fprintf(stderr, "%s", prepareHelp().getStr()); ret = sal_False; } - + j = 1; } else { j = 0; } - - char *s=NULL; + + char *s=NULL; for (; j < ac; j++) { if (av[j][0] == '-') @@ -88,14 +88,14 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) { tmp += " your input '" + OString(av[j+1]) + "'"; } - + throw IllegalArgument(tmp); } } else { s = av[j] + 2; } - + m_options["-O"] = OString(s); break; case 'I': @@ -113,14 +113,14 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) { tmp += " your input '" + OString(av[j+1]) + "'"; } - + throw IllegalArgument(tmp); } } else { s = av[j] + 2; } - + OString inc(s); if ( inc.indexOf(';') > 0 ) { @@ -130,7 +130,7 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) do inc = inc + " -I\"" + tmp.getToken( 0, ';', nIndex ) +"\""; while( nIndex != -1 ); } else inc = OString("-I\"") + s + "\""; - + if (m_options.count("-I") > 0) { OString tmp(m_options["-I"]); @@ -156,14 +156,14 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) { tmp += " your input '" + OString(av[j+1]) + "'"; } - + throw IllegalArgument(tmp); } } else { s = av[j]; } - + if (m_options.count("-D") > 0) { OString tmp(m_options["-D"]); @@ -176,7 +176,7 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) if (av[j][2] != '\0') { throw IllegalArgument(OString(av[j]) + ", please check your input"); - } + } if (m_options.count("-C") == 0) m_options["-C"] = OString(av[j]); break; @@ -209,12 +209,12 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) if (m_options.count("-we") == 0) m_options["-we"] = OString(av[j]); } else { - if (av[j][2] == '\0') { + if (av[j][2] == '\0') { if (m_options.count("-w") == 0) m_options["-w"] = OString(av[j]); } else throw IllegalArgument(OString(av[j]) + ", please check your input"); - } + } break; case 'h': case '?': @@ -225,7 +225,7 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) { fprintf(stdout, "%s", prepareHelp().getStr()); exit(0); - } + } case 's': if (/*MSVC trouble: std::*/strcmp(&av[j][2], "tdin") == 0) { @@ -267,7 +267,7 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) if (c!=13 && c!=10) { if (found || c!=' ') { buffer[i++]=c; - continue; + continue; } } if (i==0) @@ -286,33 +286,33 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) rargc++; } fclose(cmdFile); - + ret = initOptions(rargc, rargv, bCmdFile); - + long ii = 0; - for (ii=0; ii < rargc; ii++) + for (ii=0; ii < rargc; ii++) { free(rargv[ii]); } - } + } } else { OString name(av[j]); name = name.toAsciiLowerCase(); if ( name.lastIndexOf(".idl") != (name.getLength() - 4) ) { - throw IllegalArgument("'" + OString(av[j]) + + throw IllegalArgument("'" + OString(av[j]) + "' is not a valid input file, only '*.idl' files will be accepted"); } m_inputFiles.push_back(av[j]); - } + } } } + + return ret; +} - return ret; -} - -OString Options::prepareHelp() +OString Options::prepareHelp() { OString help("\nusing: "); help += m_program @@ -338,26 +338,26 @@ OString Options::prepareHelp() help += " -we = treat warnings as errors.\n"; help += " -h|-? = print this help message and exit.\n"; help += prepareVersion(); - + return help; -} +} -OString Options::prepareVersion() +OString Options::prepareVersion() { OString version("\nSun Microsystems (R) "); version += m_program + " Version 1.1\n\n"; return version; -} +} const OString& Options::getProgramName() const { return m_program; -} +} sal_Bool Options::isValid(const OString& option) { - return (m_options.count(option) > 0); -} + return (m_options.count(option) > 0); +} const OString Options::getOption(const OString& option) throw( IllegalArgument ) diff --git a/idlc/source/preproc/cpp.c b/idlc/source/preproc/cpp.c index e56ae306ac11..496c1749f562 100644 --- a/idlc/source/preproc/cpp.c +++ b/idlc/source/preproc/cpp.c @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,7 +32,7 @@ #include <stdarg.h> #include "cpp.h" -#define OUTS 16384 +#define OUTS 16384 char outbuf[OUTS]; char *outptr = outbuf; Source *cursource; @@ -51,9 +51,9 @@ char* realargv[512]; void checkCommandFile(char* cmdfile) { - FILE *commandfile; - char option[256]; - + FILE *commandfile; + char option[256]; + commandfile = fopen(cmdfile+1, "r"); if( commandfile == NULL ) { @@ -76,8 +76,8 @@ void checkCommandFile(char* cmdfile) if (c!=13 && c!=10) { if (found || c!=' ') { option[i++]=c; - continue; - } + continue; + } } if (i==0) continue; @@ -101,8 +101,8 @@ void checkCommandFile(char* cmdfile) realargc++; } fclose(commandfile); - } -} + } +} void checkCommandArgs(int argc, char **argv) { @@ -119,7 +119,7 @@ void checkCommandArgs(int argc, char **argv) realargc++; } } -} +} void cleanCommandArgs() { @@ -129,7 +129,7 @@ void cleanCommandArgs() { free(realargv[i]); } -} +} #ifdef WNT int __cdecl main(int argc, char **argv) diff --git a/idlc/source/preproc/cpp.h b/idlc/source/preproc/cpp.h index b40647cd38b7..89de35a0dde6 100644 --- a/idlc/source/preproc/cpp.h +++ b/idlc/source/preproc/cpp.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -26,19 +26,19 @@ * ************************************************************************/ -#define INS 32768 /* input buffer */ -#define OBS 8092 /* outbut buffer */ -#define NARG 32 /* Max number arguments to a macro */ -#define NINCLUDE 32 /* Max number of include directories (-I) */ -#define NIF 64 /* depth of nesting of #if */ -#define NINC 32 /* depth of nesting of #include */ +#define INS 32768 /* input buffer */ +#define OBS 8092 /* outbut buffer */ +#define NARG 32 /* Max number arguments to a macro */ +#define NINCLUDE 32 /* Max number of include directories (-I) */ +#define NIF 64 /* depth of nesting of #if */ +#define NINC 32 /* depth of nesting of #include */ #ifndef EOF -#define EOF (-1) +#define EOF (-1) #endif #ifndef NULL -#define NULL 0 +#define NULL 0 #endif typedef unsigned char uchar; @@ -59,21 +59,21 @@ enum toktype enum kwtype { KIF, KIFDEF, KIFNDEF, KELIF, KELSE, KENDIF, KINCLUDE, KINCLUDENEXT, - KIMPORT, KDEFINE, KUNDEF, KLINE, KERROR, KPRAGMA, KIDENT, KDEFINED, + KIMPORT, KDEFINE, KUNDEF, KLINE, KERROR, KPRAGMA, KIDENT, KDEFINED, KMACHINE, KLINENO, KFILE, KDATE, KTIME, KSTDC, KEVAL }; -#define ISDEFINED 0x01 /* has #defined value */ -#define ISKW 0x02 /* is PP keyword */ -#define ISUNCHANGE 0x04 /* can't be #defined in PP */ -#define ISMAC 0x08 /* builtin macro, e.g. __LINE__ */ -#define ISARCHITECTURE 0x10 /* architecture */ -#define ISACTIVE 0x80 /* is macro currently expanded */ +#define ISDEFINED 0x01 /* has #defined value */ +#define ISKW 0x02 /* is PP keyword */ +#define ISUNCHANGE 0x04 /* can't be #defined in PP */ +#define ISMAC 0x08 /* builtin macro, e.g. __LINE__ */ +#define ISARCHITECTURE 0x10 /* architecture */ +#define ISACTIVE 0x80 /* is macro currently expanded */ -#define EOB 0xFE /* sentinel for end of input buffer */ -#define EOFC 0xFD /* sentinel for end of input file */ -#define XPWS 1 /* token flag: white space to assure token sep. */ -#define XTWS 2 +#define EOB 0xFE /* sentinel for end of input buffer */ +#define EOFC 0xFD /* sentinel for end of input file */ +#define XPWS 1 /* token flag: white space to assure token sep. */ +#define XTWS 2 typedef struct token { @@ -116,7 +116,7 @@ typedef struct nlist Tokenrow *ap; /* list of argument names, if any */ char val; /* value as preprocessor name */ char flag; /* is defined, is pp name */ - uchar *loc; /* location of definition */ + uchar *loc; /* location of definition */ } Nlist; typedef struct includelist @@ -131,9 +131,9 @@ typedef struct wraplist char *file; } Wraplist; -#define new(t) (t *)domalloc(sizeof(t)) -#define quicklook(a,b) (namebit[(a)&077] & (1<<((b)&037))) -#define quickset(a,b) namebit[(a)&077] |= (1<<((b)&037)) +#define new(t) (t *)domalloc(sizeof(t)) +#define quicklook(a,b) (namebit[(a)&077] & (1<<((b)&037))) +#define quickset(a,b) namebit[(a)&077] |= (1<<((b)&037)) extern unsigned long namebit[077 + 1]; enum errtype @@ -188,7 +188,7 @@ char *outnum(char *, int); int digit(int); uchar *newstring(uchar *, int, int); -#define rowlen(tokrow) ((tokrow)->lp - (tokrow)->bp) +#define rowlen(tokrow) ((tokrow)->lp - (tokrow)->bp) extern char *outptr; extern Token nltoken; diff --git a/idlc/source/preproc/eval.c b/idlc/source/preproc/eval.c index 292cc95336bc..e908d19cb503 100644 --- a/idlc/source/preproc/eval.c +++ b/idlc/source/preproc/eval.c @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -29,12 +29,12 @@ #include <string.h> #include "cpp.h" -#define NSTAK 32 -#define SGN 0 -#define UNS 1 -#define UND 2 +#define NSTAK 32 +#define SGN 0 +#define UNS 1 +#define UND 2 -#define UNSMARK 0x1000 +#define UNSMARK 0x1000 struct value { @@ -43,12 +43,12 @@ struct value }; /* conversion types */ -#define RELAT 1 -#define ARITH 2 -#define LOGIC 3 -#define SPCL 4 -#define SHIFT 5 -#define UNARY 6 +#define RELAT 1 +#define ARITH 2 +#define LOGIC 3 +#define SPCL 4 +#define SHIFT 5 +#define UNARY 6 /* operator priority, arity, and conversion type, indexed by tokentype */ struct pri diff --git a/idlc/source/preproc/include.c b/idlc/source/preproc/include.c index b56622b571ee..da750b29dacb 100644 --- a/idlc/source/preproc/include.c +++ b/idlc/source/preproc/include.c @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -26,12 +26,12 @@ * ************************************************************************/ #if (defined(_WIN32) || defined(_MSDOS) || defined(__IBMC__)) -# include <io.h> +# include <io.h> #else -# include <unistd.h> +# include <unistd.h> #endif #ifdef _MSC_VER -# define _POSIX_ +# define _POSIX_ #endif #include <stdio.h> #include <stdlib.h> @@ -39,7 +39,7 @@ #include <fcntl.h> #ifdef __hpux -# define _HPUX_SOURCE +# define _HPUX_SOURCE #endif #ifdef SCO #define _IBCS2 diff --git a/idlc/source/preproc/lex.c b/idlc/source/preproc/lex.c index 4b565b9c133f..522f85a91ff0 100644 --- a/idlc/source/preproc/lex.c +++ b/idlc/source/preproc/lex.c @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,17 +54,17 @@ * nextstate: 6 bits; ?\ marker: 1 bit; tokentype: 9 bits. */ -#define MAXSTATE 32 -#define ACT(tok,act) ((tok<<7)+act) -#define QBSBIT 0100 -#define GETACT(st) ((st>>7)&0x1ff) +#define MAXSTATE 32 +#define ACT(tok,act) ((tok<<7)+act) +#define QBSBIT 0100 +#define GETACT(st) ((st>>7)&0x1ff) /* character classes */ -#define C_WS 1 -#define C_ALPH 2 -#define C_NUM 3 -#define C_EOF 4 -#define C_XX 5 +#define C_WS 1 +#define C_ALPH 2 +#define C_NUM 3 +#define C_EOF 4 +#define C_XX 5 enum state { @@ -382,7 +382,7 @@ continue2: oldstate = state; c = *ip; - + if ((state = bigfsm[c][state]) >= 0) { ip += runelen; @@ -428,7 +428,7 @@ continue2: if (c == '\n') { while (s->inp + 1 >= s->inl && fillbuf(s) != EOF); - + if (s->inp[1] == '\r') { memmove(s->inp + 1, s->inp + 2, s->inl - s->inp + 2); @@ -441,7 +441,7 @@ continue2: if (c == '\r') { while (s->inp + 1 >= s->inl && fillbuf(s) != EOF); - + if (s->inp[1] == '\n') { memmove(s->inp, s->inp + 1, s->inl - s->inp + 1); diff --git a/idlc/source/preproc/macro.c b/idlc/source/preproc/macro.c index be9f30abf085..1d253d6a8729 100644 --- a/idlc/source/preproc/macro.c +++ b/idlc/source/preproc/macro.c @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -26,17 +26,17 @@ * ************************************************************************/ #ifdef _MSC_VER -# define _POSIX_ +# define _POSIX_ #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef __hpux -# define _HPUX_SOURCE +# define _HPUX_SOURCE #endif #ifdef SCO -# define _IBCS2 +# define _IBCS2 #endif #include <limits.h> @@ -329,7 +329,7 @@ void trp->tp += ntokc; return; } - substargs(np, &ntr, atr); /* put args into replacement */ + substargs(np, &ntr, atr); /* put args into replacement */ for (i = 0; i < narg; i++) { dofree(atr[i]->bp); @@ -597,7 +597,7 @@ int /* * Return a quoted version of the tokenrow (from # arg) */ -#define STRLEN 512 +#define STRLEN 512 Tokenrow * stringify(Tokenrow * vp) { diff --git a/idlc/source/preproc/nlist.c b/idlc/source/preproc/nlist.c index d3256fa0fce8..af8ff103dad4 100644 --- a/idlc/source/preproc/nlist.c +++ b/idlc/source/preproc/nlist.c @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,14 +34,14 @@ extern int Cplusplus; Nlist *kwdefined; char wd[128]; -/* +/* ER: Tabelle extra gross gemacht, da es anscheinend ein Problem mit der der Verkettung gibt, irgendwann irgendwo wird mal ein nlist->next ueberschrieben, was in eineme SIGSEGV resultiert. Den GDB mit watchpoint hab ich aber nach 2 Tagen abgebrochen.. so loeppt's jedenfalls erstmal.. */ -#define NLSIZE 15000 +#define NLSIZE 15000 static Nlist *nlist[NLSIZE]; diff --git a/idlc/source/preproc/tokens.c b/idlc/source/preproc/tokens.c index e119fc5cc2b8..cb1b17f6b404 100644 --- a/idlc/source/preproc/tokens.c +++ b/idlc/source/preproc/tokens.c @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/source/preproc/unix.c b/idlc/source/preproc/unix.c index 57b49a74128a..23b0ae69bbe1 100644 --- a/idlc/source/preproc/unix.c +++ b/idlc/source/preproc/unix.c @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,7 +44,7 @@ extern char rcsid[]; int Pflag = 0; /* print no line information */ -int Iflag = 0; /* print includes */ +int Iflag = 0; /* print includes */ int Mflag = 0; /* print macor expansion */ int Aflag = 0; /* translate character sets */ int Xflag = 0; /* print pragma for include/import */ diff --git a/idlc/source/wrap_parser.cxx b/idlc/source/wrap_parser.cxx index f03b3cc7f173..f568b8753dbf 100644 --- a/idlc/source/wrap_parser.cxx +++ b/idlc/source/wrap_parser.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/source/wrap_scanner.cxx b/idlc/source/wrap_scanner.cxx index 6ea04c00e96e..2b669e9293fd 100644 --- a/idlc/source/wrap_scanner.cxx +++ b/idlc/source/wrap_scanner.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/idlc/test/const.idl b/idlc/test/const.idl index 76b3d2a02e6b..8fbf80cde8bf 100644 --- a/idlc/test/const.idl +++ b/idlc/test/const.idl @@ -39,11 +39,11 @@ constants USER /// = 4 const long FLAG9 = FLAG1 << 2; /// = 32 - const long FLAG10 = (FLAG5 >> 1) << 2; + const long FLAG10 = (FLAG5 >> 1) << 2; /// = 1 - const long FLAG11 = 33 % 4; + const long FLAG11 = 33 % 4; /// = 4 - const long FLAG12 = FLAG10 / 8; + const long FLAG12 = FLAG10 / 8; }; }; diff --git a/idlc/test/enum.idl b/idlc/test/enum.idl index 2920d7fe6a0f..d287c57fccd9 100644 --- a/idlc/test/enum.idl +++ b/idlc/test/enum.idl @@ -16,7 +16,7 @@ enum Warning NO, USER = 2, WRONGPASSWORD = 4, - IDFAILURE + IDFAILURE }; diff --git a/idlc/test/exception.idl b/idlc/test/exception.idl index b53d1dbe74fd..d527301687f3 100644 --- a/idlc/test/exception.idl +++ b/idlc/test/exception.idl @@ -5,13 +5,13 @@ module test exception BaseException { - string Description; + string Description; }; exception RuntimeException : BaseException { - long Id; - type Context; + long Id; + type Context; }; diff --git a/idlc/test/interface.idl b/idlc/test/interface.idl index 18116bf963db..336d8858a32b 100644 --- a/idlc/test/interface.idl +++ b/idlc/test/interface.idl @@ -19,31 +19,31 @@ interface XTestBaseTypes : XBase void voidFunc(); [oneway] void onewayFunc(); - short shortFunc( [in] short inparam, [out] short outparam, [inout] short inoutparam); - unsigned short uShortFunc( [in] unsigned short inparam, [out] unsigned short outparam, [inout] unsigned short inoutparam); + short shortFunc( [in] short inparam, [out] short outparam, [inout] short inoutparam); + unsigned short uShortFunc( [in] unsigned short inparam, [out] unsigned short outparam, [inout] unsigned short inoutparam); - long longFunc( [in] long inparam, [out] long outparam, [inout] long inoutparam); - unsigned long ulongFunc( [in] unsigned long inparam, [out] unsigned long outparam, [inout] unsigned long inoutparam); + long longFunc( [in] long inparam, [out] long outparam, [inout] long inoutparam); + unsigned long ulongFunc( [in] unsigned long inparam, [out] unsigned long outparam, [inout] unsigned long inoutparam); - hyper hyperFunc( [in] hyper inparam, [out] hyper outparam, [inout] hyper inoutparam); - unsigned hyper uHyperFunc( [in] unsigned hyper inparam, [out] unsigned hyper outparam, [inout] unsigned hyper inoutparam); + hyper hyperFunc( [in] hyper inparam, [out] hyper outparam, [inout] hyper inoutparam); + unsigned hyper uHyperFunc( [in] unsigned hyper inparam, [out] unsigned hyper outparam, [inout] unsigned hyper inoutparam); - float floatFunc( [in] float inparam, [out] float outparam, [inout] float inoutparam); - double doubleFunc( [in] double inparam, [out] double outparam, [inout] double inoutparam); - char charFunc( [in] char inparam, [out] char outparam, [inout] char inoutparam); - string stringFunc( [in] string inparam, [out] string outparam, [inout] string inoutparam); - byte byteFunc( [in] byte inparam, [out] byte outparam, [inout] byte inoutparam); + float floatFunc( [in] float inparam, [out] float outparam, [inout] float inoutparam); + double doubleFunc( [in] double inparam, [out] double outparam, [inout] double inoutparam); + char charFunc( [in] char inparam, [out] char outparam, [inout] char inoutparam); + string stringFunc( [in] string inparam, [out] string outparam, [inout] string inoutparam); + byte byteFunc( [in] byte inparam, [out] byte outparam, [inout] byte inoutparam); - type typeFunc( [in] type inparam, [out] type outparam, [inout] type inoutparam); - any anyFunc( [in] any inparam, [out] any outparam, [inout] any inoutparam); + type typeFunc( [in] type inparam, [out] type outparam, [inout] type inoutparam); + any anyFunc( [in] any inparam, [out] any outparam, [inout] any inoutparam); }; interface XTestComplexTypes : XBase { - Error enumFunc( [in] Error inparam, [out] Error outparam, [inout] Error inoutparam); + Error enumFunc( [in] Error inparam, [out] Error outparam, [inout] Error inoutparam); - BaseStruct structFunc( [in] ::idlc::test::BaseStruct inparam, [out] idlc::test::BaseStruct outparam, [inout] BaseStruct inoutparam); + BaseStruct structFunc( [in] ::idlc::test::BaseStruct inparam, [out] idlc::test::BaseStruct outparam, [inout] BaseStruct inoutparam); }; }; diff --git a/idlc/test/service.idl b/idlc/test/service.idl index 5a962d8fe948..121d5f5402fe 100644 --- a/idlc/test/service.idl +++ b/idlc/test/service.idl @@ -11,10 +11,10 @@ exception bla service IdlTest { -// [property] bla p0; +// [property] bla p0; [property] short p1; [optional, property] unsigned short p2; - + [maybevoid, property] long p3; [bound, property] unsigned long p4; @@ -34,7 +34,7 @@ service IdlTest service BetterIdlTest { service IdlTest; - + interface XTestBaseTypes; [optional] interface ::idlc::test::XTestComplexTypes; }; diff --git a/idlc/test/singleton.idl b/idlc/test/singleton.idl index a4b2590c726a..2754402ada5c 100644 --- a/idlc/test/singleton.idl +++ b/idlc/test/singleton.idl @@ -11,10 +11,10 @@ exception bla service IdlTest { -// [property] bla p0; +// [property] bla p0; [property] short p1; [optional, property] unsigned short p2; - + [maybevoid, property] long p3; [bound, property] unsigned long p4; diff --git a/idlc/test/struct.idl b/idlc/test/struct.idl index 887b45c7859b..f87cd504af72 100644 --- a/idlc/test/struct.idl +++ b/idlc/test/struct.idl @@ -13,7 +13,7 @@ module test typedef sequence< long > Id; //struct Bla //{ -// long bla; +// long bla; //}; /** bla @@ -24,46 +24,46 @@ struct BaseStruct Id Id; /// a short member - short m1; + short m1; /// a unsigned short member - unsigned short m2; + unsigned short m2; /// a long member - long m3; + long m3; /// a unsigned long member - unsigned long m4; + unsigned long m4; /// a hyper member - hyper m5; + hyper m5; /// a unsigned hyper member - unsigned hyper m6; + unsigned hyper m6; /// a string member - string m7; + string m7; /// a byte member - byte m8; + byte m8; /// a type member - type m9; + type m9; /// a float member - float m10; + float m10; /// a double member - double m11; + double m11; /// a char member - char m12; + char m12; /// a boolean member - boolean m13; + boolean m13; /// a any member - any m14; + any m14; }; interface XTestBaseTypes; @@ -72,22 +72,22 @@ typedef sequence< long > LongSeq; typedef sequence< LongSeq > LongSeqSeq; -/** TestStruct deinfes a struct which inherits - from the base strcut type BaseStruct. +/** TestStruct deinfes a struct which inherits + from the base strcut type BaseStruct. */ struct TestStruct : BaseStruct { /// a sequence< long > member - sequence< long > ms1; + sequence< long > ms1; /// a sequence< sequence< long > > member - sequence< sequence< long > > ms2; + sequence< sequence< long > > ms2; /// a long array member with dimesion 5,10 -// long ms3[5][10]; +// long ms3[5][10]; /// a string array member with dimension 4,8 -// long[5][10] ms4; +// long[5][10] ms4; /// an interface member XTestBaseTypes ms5; diff --git a/idlc/test/typelookup.idl b/idlc/test/typelookup.idl index ba1b6f29e8f3..315787744a31 100644 --- a/idlc/test/typelookup.idl +++ b/idlc/test/typelookup.idl @@ -22,40 +22,40 @@ module test struct BaseStruct { /// a long member - long m1; + long m1; /// a string member - string m2; + string m2; /// a byte member - byte m3; + byte m3; /// a type member - type m4; + type m4; /// a enum member, Error in moudle idlc::test - Error m5; + Error m5; /// a typedef member, global Error (typedef short) - ::Error m6; + ::Error m6; /// a typedef member, Error in moudle idlc (typedef long) - ::idlc::Error m7; + ::idlc::Error m7; /// a typedef member, Error in moudle idlc (typedef long) - idlc::Error m8; + idlc::Error m8; /// a enum member, Error in moudle idlc::test - test::Error m9; + test::Error m9; }; -/** TestStruct deinfes a struct which inherits - from the base strcut type BaseStruct. +/** TestStruct deinfes a struct which inherits + from the base strcut type BaseStruct. */ struct TestStruct : BaseStruct { /// a short member - short ms1; + short ms1; /// a hyper member - hyper ms2; + hyper ms2; /// a sequence<long> member - sequence< long > ms3; + sequence< long > ms3; /// a long array member with dimesion 5,10 - long ms4[5][10]; + long ms4[5][10]; /// a string array member with dimension 4,8 - long[5][10] ms5; + long[5][10] ms5; }; }; // test |