Kaydet (Commit) 41dc56df authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constparams codemaker,idl,idlc

Change-Id: Ic72b7525cfbfbd3c5afb12fe9ea814176e6c8c9d
Reviewed-on: https://gerrit.libreoffice.org/40126Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 50985d9b
......@@ -345,7 +345,7 @@ FileStream &operator<<(FileStream& o, char const * s) {
osl_writeFile(o.m_file, s, strlen(s), &writtenBytes);
return o;
}
FileStream &operator<<(FileStream& o, ::rtl::OString* s) {
FileStream &operator<<(FileStream& o, ::rtl::OString const * s) {
sal_uInt64 writtenBytes;
osl_writeFile(o.m_file, s->getStr(), s->getLength() * sizeof(sal_Char), &writtenBytes);
return o;
......@@ -356,7 +356,7 @@ FileStream &operator<<(FileStream& o, const ::rtl::OString& s) {
return o;
}
FileStream &operator<<(FileStream& o, ::rtl::OStringBuffer* s) {
FileStream &operator<<(FileStream& o, ::rtl::OStringBuffer const * s) {
sal_uInt64 writtenBytes;
osl_writeFile(o.m_file, s->getStr(), s->getLength() * sizeof(sal_Char), &writtenBytes);
return o;
......
......@@ -41,7 +41,7 @@ public:
operator bool() const { return bVal; }
bool IsSet() const { return bSet; }
bool ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm );
bool ReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm );
};
......@@ -56,7 +56,7 @@ public:
void setString(const OString& rStr) { m_aStr = rStr; }
const OString& getString() const { return m_aStr; }
bool ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm );
bool ReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm );
bool IsSet() const
{
return !m_aStr.isEmpty() || nValue != 0;
......@@ -68,7 +68,7 @@ public:
};
bool ReadStringSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm, OString& aString );
bool ReadStringSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm, OString& aString );
#endif // INCLUDED_IDL_INC_BASTYPE_HXX
......
......@@ -114,7 +114,7 @@ public:
void Write(const OString& rText);
void WriteError( SvTokenStream & rInStm );
void SetError( const OString& rError, SvToken& rTok );
void SetError( const OString& rError, SvToken const & rTok );
void SetAndWriteError( SvTokenStream & rInStm, const OString& rError );
void Push( SvMetaObject * pObj );
sal_uInt32 GetUniqueId() { return ++nUniqueId; }
......
......@@ -85,7 +85,7 @@ public:
void SetHash( SvStringHashEntry * pHashP )
{ pHash = pHashP; nType = SVTOKENTYPE::HashId; }
bool Is( SvStringHashEntry * pEntry ) const
bool Is( SvStringHashEntry const * pEntry ) const
{ return IsIdentifierHash() && pHash == pEntry; }
};
......
......@@ -56,15 +56,15 @@ public:
SvMetaClass* ReadKnownClass();
SvMetaType* ReadKnownType();
void Read(char cChar);
bool ReadIfBoolAttribute( SvBOOL&, SvStringHashEntry* pName);
bool ReadIfIdAttribute( SvIdentifier& rIdentifier, SvStringHashEntry* pName );
bool ReadIfBoolAttribute( SvBOOL&, SvStringHashEntry const * pName);
bool ReadIfIdAttribute( SvIdentifier& rIdentifier, SvStringHashEntry const * pName );
bool ReadIf(char cChar);
void ReadDelimiter();
bool ReadIfDelimiter();
OString ReadIdentifier();
OString ReadString();
void Read(SvStringHashEntry*);
bool ReadIf(SvStringHashEntry*);
void Read(SvStringHashEntry const *);
bool ReadIf(SvStringHashEntry const *);
};
#endif // INCLUDED_IDL_INC_PARSER_HXX
......
......@@ -55,7 +55,7 @@ class SvMetaType : public SvMetaReference
MetaTypeType nType;
bool bIsItem;
void WriteSfxItem( const OString& rItemName, SvIdlDataBase & rBase,
void WriteSfxItem( const OString& rItemName, SvIdlDataBase const & rBase,
SvStream & rOutStm );
protected:
bool ReadHeaderSvIdl( SvTokenStream & rInStm );
......
......@@ -26,7 +26,7 @@
#include <database.hxx>
#include <tools/stream.hxx>
bool SvBOOL::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm )
bool SvBOOL::ReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
SvToken& rTok = rInStm.GetToken_Next();
......@@ -49,7 +49,7 @@ bool SvBOOL::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm )
return false;
}
bool SvIdentifier::ReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm )
bool SvIdentifier::ReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm )
{
sal_uInt32 nTokPos = rInStm.Tell();
SvToken& rTok = rInStm.GetToken_Next();
......@@ -94,7 +94,7 @@ void SvIdentifier::ReadSvIdl( SvIdlDataBase & rBase,
rInStm.Seek( nTokPos );
}
bool ReadStringSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm, OString& aRetString )
bool ReadStringSvIdl( SvStringHashEntry const * pName, SvTokenStream & rInStm, OString& aRetString )
{
sal_uInt32 nTokPos = rInStm.Tell();
SvToken& rTok = rInStm.GetToken_Next();
......
......@@ -348,7 +348,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList)
}
static OString MakeSlotName( SvStringHashEntry * pEntry )
static OString MakeSlotName( SvStringHashEntry const * pEntry )
{
return "SfxSlotMode::" + pEntry->GetName().toAsciiUpperCase();
};
......
......@@ -218,7 +218,7 @@ sal_uLong SvMetaType::MakeSfx( OStringBuffer& rAttrArray )
}
void SvMetaType::WriteSfxItem(
const OString& rItemName, SvIdlDataBase& rBase, SvStream& rOutStm )
const OString& rItemName, SvIdlDataBase const & rBase, SvStream& rOutStm )
{
WriteStars( rOutStm );
OString aVarName = " a" + rItemName + "_Impl";
......
......@@ -85,7 +85,7 @@ SvRefMemberList<SvMetaType *>& SvIdlDataBase::GetTypeList()
return aTypeList;
}
void SvIdlDataBase::SetError( const OString& rError, SvToken& rTok )
void SvIdlDataBase::SetError( const OString& rError, SvToken const & rTok )
{
if( rTok.GetLine() > 10000 )
aError.SetText( "line count overflow" );
......
......@@ -476,7 +476,7 @@ SvMetaType * SvIdlParser::ReadKnownType()
throw SvParseException( rInStm, "wrong typedef: ");
}
bool SvIdlParser::ReadIfBoolAttribute( SvBOOL& rBool, SvStringHashEntry * pName )
bool SvIdlParser::ReadIfBoolAttribute( SvBOOL& rBool, SvStringHashEntry const * pName )
{
sal_uInt32 nTokPos = rInStm.Tell();
SvToken& rTok = rInStm.GetToken_Next();
......@@ -499,7 +499,7 @@ bool SvIdlParser::ReadIfBoolAttribute( SvBOOL& rBool, SvStringHashEntry * pName
return false;
}
bool SvIdlParser::ReadIfIdAttribute( SvIdentifier& rIdentifier, SvStringHashEntry * pName )
bool SvIdlParser::ReadIfIdAttribute( SvIdentifier& rIdentifier, SvStringHashEntry const * pName )
{
sal_uInt32 nTokPos = rInStm.Tell();
SvToken& rTok = rInStm.GetToken_Next();
......@@ -572,14 +572,14 @@ bool SvIdlParser::ReadIf(char cChar)
return false;
}
void SvIdlParser::Read(SvStringHashEntry* entry)
void SvIdlParser::Read(SvStringHashEntry const * entry)
{
if( !rInStm.GetToken().Is(entry) )
throw SvParseException("expected " + entry->GetName(), rInStm.GetToken());
rInStm.GetToken_Next();
}
bool SvIdlParser::ReadIf(SvStringHashEntry* entry)
bool SvIdlParser::ReadIf(SvStringHashEntry const * entry)
{
if( rInStm.GetToken().Is(entry) )
{
......
......@@ -54,7 +54,7 @@ public:
// Look up a predefined type by its ExprType
AstDeclaration* lookupPrimitiveType(ExprType type);
AstDeclaration* lookupForAdd(AstDeclaration* pDecl);
AstDeclaration* lookupForAdd(AstDeclaration const * pDecl);
protected:
AstDeclaration const * getLast() const
......
......@@ -80,7 +80,7 @@ public:
static void error1(ErrorCode e, AstDeclaration const * d);
static void error2(
ErrorCode e, AstDeclaration const * d1, AstDeclaration const * d2);
static void error3(ErrorCode e, AstDeclaration* d1, AstDeclaration* d2, AstDeclaration* d3);
static void error3(ErrorCode e, AstDeclaration const * d1, AstDeclaration const * d2, AstDeclaration const * d3);
// Warning
static void warning0(WarningCode e, const sal_Char* warningmsg);
......@@ -100,13 +100,13 @@ public:
// Report a type error
static void noTypeError(AstDeclaration const * pDecl);
static void inheritanceError(NodeType nodeType, const OString* name, AstDeclaration* pDecl);
static void inheritanceError(NodeType nodeType, const OString* name, AstDeclaration const * pDecl);
static void flagError(ErrorCode e, sal_uInt32 flag);
static void forwardLookupError(const AstDeclaration* pForward, const OString& name);
static void constantExpected(AstDeclaration* pDecl, const OString& name);
static void constantExpected(AstDeclaration const * pDecl, const OString& name);
static void evalError(AstExpression* pExpr);
......
......@@ -63,7 +63,7 @@ public:
{ return m_typeParameters; }
private:
void initializeInherits(OString* pinherits);
void initializeInherits(OString const * pinherits);
NodeType m_nodeType;
OString* m_pName;
......
......@@ -319,7 +319,7 @@ AstDeclaration* AstScope::lookupPrimitiveType(ExprType type)
return nullptr;
}
AstDeclaration* AstScope::lookupForAdd(AstDeclaration* pDecl)
AstDeclaration* AstScope::lookupForAdd(AstDeclaration const * pDecl)
{
if ( !pDecl )
return nullptr;
......
......@@ -444,7 +444,7 @@ void ErrorHandler::error2(
idlc()->incErrorCount();
}
void ErrorHandler::error3(ErrorCode e, AstDeclaration* d1, AstDeclaration* d2, AstDeclaration* d3)
void ErrorHandler::error3(ErrorCode e, AstDeclaration const * d1, AstDeclaration const * d2, AstDeclaration const * d3)
{
errorHeader(e);
fprintf(stderr, "'%s', '%s', '%s'\n", d1->getScopedName().getStr(),
......@@ -528,11 +528,11 @@ char const * nodeTypeName(NodeType nodeType) {
}
void ErrorHandler::inheritanceError(NodeType nodeType, const OString* name, AstDeclaration* pDecl)
void ErrorHandler::inheritanceError(NodeType nodeType, const OString* name, AstDeclaration const * pDecl)
{
if ( nodeType == NT_interface &&
(pDecl->getNodeType() == NT_interface) &&
!(static_cast<AstInterface*>(pDecl)->isDefined()) )
!(static_cast<AstInterface const *>(pDecl)->isDefined()) )
{
errorHeader(ErrorCode::CannotInheritFromForward);
fprintf(stderr, "interface '%s' cannot inherit from forward declared interface '%s'\n",
......@@ -556,7 +556,7 @@ void ErrorHandler::forwardLookupError(const AstDeclaration* pForward,
idlc()->incErrorCount();
}
void ErrorHandler::constantExpected(AstDeclaration* pDecl,
void ErrorHandler::constantExpected(AstDeclaration const * pDecl,
const OString& name)
{
errorHeader(ErrorCode::ExpectedConstant);
......
......@@ -70,7 +70,7 @@ FeInheritanceHeader::FeInheritanceHeader(
initializeInherits(pInherits);
}
void FeInheritanceHeader::initializeInherits(OString* pInherits)
void FeInheritanceHeader::initializeInherits(OString const * pInherits)
{
if ( pInherits )
{
......
......@@ -66,7 +66,7 @@ using ::rtl::OStringBuffer;
extern int yylex(void);
void yyerror(char const *);
void checkIdentifier(::rtl::OString* id)
void checkIdentifier(::rtl::OString const * id)
{
static short check = 0;
if (check == 0) {
......
......@@ -55,9 +55,9 @@ public:
// friend functions
friend FileStream &operator<<(FileStream& o, sal_uInt32 i);
friend FileStream &operator<<(FileStream& o, char const * s);
friend FileStream &operator<<(FileStream& o, ::rtl::OString* s);
friend FileStream &operator<<(FileStream& o, ::rtl::OString const * s);
friend FileStream &operator<<(FileStream& o, const ::rtl::OString& s);
friend FileStream &operator<<(FileStream& o, ::rtl::OStringBuffer* s);
friend FileStream &operator<<(FileStream& o, ::rtl::OStringBuffer const * s);
friend FileStream &operator<<(FileStream& o, const ::rtl::OStringBuffer& s);
friend FileStream & operator <<(FileStream & out, rtl::OUString const & s);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment