Kaydet (Commit) 6f3b3949 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constparams in store,registry

Change-Id: I5633203b372a9abd0138a396958c235ea8aaf66d
Reviewed-on: https://gerrit.libreoffice.org/40039Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst dd323b05
...@@ -216,7 +216,7 @@ protected: ...@@ -216,7 +216,7 @@ protected:
@param phKeys points to an array of open keys. @param phKeys points to an array of open keys.
@param length specifies the length of the array specified by phKeys. @param length specifies the length of the array specified by phKeys.
*/ */
inline void setKeyHandles(Registry& registry, RegKeyHandle* phKeys, sal_uInt32 length); inline void setKeyHandles(Registry const & registry, RegKeyHandle* phKeys, sal_uInt32 length);
/// stores the number of open subkeys, the number of elements. /// stores the number of open subkeys, the number of elements.
sal_uInt32 m_length; sal_uInt32 m_length;
...@@ -254,7 +254,7 @@ protected: ...@@ -254,7 +254,7 @@ protected:
@param pKeyNames points to an array of key names. @param pKeyNames points to an array of key names.
@param length specifies the length of the array specified by pKeyNames. @param length specifies the length of the array specified by pKeyNames.
*/ */
inline void setKeyNames(Registry& registry, rtl_uString** pKeyNames, sal_uInt32 length); inline void setKeyNames(Registry const & registry, rtl_uString** pKeyNames, sal_uInt32 length);
/// stores the number of key names, the number of elements. /// stores the number of key names, the number of elements.
sal_uInt32 m_length; sal_uInt32 m_length;
...@@ -560,7 +560,7 @@ public: ...@@ -560,7 +560,7 @@ public:
protected: protected:
/** sets the internal registry on which this key should work. /** sets the internal registry on which this key should work.
*/ */
inline void setRegistry(Registry& registry); inline void setRegistry(Registry const & registry);
/// @endcond /// @endcond
...@@ -596,7 +596,7 @@ inline sal_uInt32 RegistryKeyArray::getLength() ...@@ -596,7 +596,7 @@ inline sal_uInt32 RegistryKeyArray::getLength()
return m_length; return m_length;
} }
inline void RegistryKeyArray::setKeyHandles(Registry& registry, inline void RegistryKeyArray::setKeyHandles(Registry const & registry,
RegKeyHandle* phKeys, RegKeyHandle* phKeys,
sal_uInt32 length) sal_uInt32 length)
{ {
...@@ -631,7 +631,7 @@ inline sal_uInt32 RegistryKeyNames::getLength() ...@@ -631,7 +631,7 @@ inline sal_uInt32 RegistryKeyNames::getLength()
return m_length; return m_length;
} }
inline void RegistryKeyNames::setKeyNames(Registry& registry, inline void RegistryKeyNames::setKeyNames(Registry const & registry,
rtl_uString** pKeyNames, rtl_uString** pKeyNames,
sal_uInt32 length) sal_uInt32 length)
{ {
...@@ -663,7 +663,7 @@ inline RegistryKey::RegistryKey(const RegistryKey& toCopy) ...@@ -663,7 +663,7 @@ inline RegistryKey::RegistryKey(const RegistryKey& toCopy)
} }
/// @cond INTERNAL /// @cond INTERNAL
inline void RegistryKey::setRegistry(Registry& registry) inline void RegistryKey::setRegistry(Registry const & registry)
{ {
m_registry = registry; m_registry = registry;
} }
......
...@@ -91,7 +91,7 @@ REG_DLLPUBLIC void SAL_CALL typereg_reader_release(void * handle); ...@@ -91,7 +91,7 @@ REG_DLLPUBLIC void SAL_CALL typereg_reader_release(void * handle);
@since UDK 3.2.0 @since UDK 3.2.0
*/ */
REG_DLLPUBLIC typereg_Version SAL_CALL typereg_reader_getVersion(void * handle); REG_DLLPUBLIC typereg_Version SAL_CALL typereg_reader_getVersion(void const * handle);
/** /**
Returns the documentation of a type reader. Returns the documentation of a type reader.
......
...@@ -185,7 +185,7 @@ REG_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setMethodData( ...@@ -185,7 +185,7 @@ REG_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setMethodData(
@since UDK 3.2.0 @since UDK 3.2.0
*/ */
REG_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setMethodParameterData( REG_DLLPUBLIC sal_Bool SAL_CALL typereg_writer_setMethodParameterData(
void * handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex, void const * handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex,
RTParamMode flags, rtl_uString const * name, rtl_uString const * typeName) RTParamMode flags, rtl_uString const * name, rtl_uString const * typeName)
SAL_THROW_EXTERN_C(); SAL_THROW_EXTERN_C();
......
...@@ -1263,10 +1263,10 @@ void TYPEREG_CALLTYPE typereg_reader_release(void * hEntry) ...@@ -1263,10 +1263,10 @@ void TYPEREG_CALLTYPE typereg_reader_release(void * hEntry)
} }
} }
typereg_Version TYPEREG_CALLTYPE typereg_reader_getVersion(void * handle) { typereg_Version TYPEREG_CALLTYPE typereg_reader_getVersion(void const * handle) {
if (handle != nullptr) { if (handle != nullptr) {
try { try {
return static_cast< TypeRegistryEntry * >(handle)->getVersion(); return static_cast< TypeRegistryEntry const * >(handle)->getVersion();
} catch (BlopObject::BoundsError &) { } catch (BlopObject::BoundsError &) {
SAL_WARN("registry", "bad data"); SAL_WARN("registry", "bad data");
} }
......
...@@ -1144,10 +1144,10 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setFieldData( ...@@ -1144,10 +1144,10 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setFieldData(
static void TYPEREG_CALLTYPE setFieldData(TypeWriterImpl hEntry, static void TYPEREG_CALLTYPE setFieldData(TypeWriterImpl hEntry,
sal_uInt16 index, sal_uInt16 index,
rtl_uString* name, rtl_uString const * name,
rtl_uString* typeName, rtl_uString const * typeName,
rtl_uString* doku, rtl_uString const * doku,
rtl_uString* fileName, rtl_uString const * fileName,
RTFieldAccess access, RTFieldAccess access,
RTValueType valueType, RTValueType valueType,
RTConstValueUnion constValue) RTConstValueUnion constValue)
...@@ -1175,12 +1175,12 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodData( ...@@ -1175,12 +1175,12 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodData(
} }
sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodParameterData( sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodParameterData(
void * handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex, void const * handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex,
RTParamMode flags, rtl_uString const * name, rtl_uString const * typeName) RTParamMode flags, rtl_uString const * name, rtl_uString const * typeName)
SAL_THROW_EXTERN_C() SAL_THROW_EXTERN_C()
{ {
try { try {
static_cast< TypeWriter * >(handle)-> static_cast< TypeWriter const * >(handle)->
m_methods[methodIndex].m_params[parameterIndex].setData( m_methods[methodIndex].m_params[parameterIndex].setData(
toByteString(typeName), toByteString(name), flags); toByteString(typeName), toByteString(name), flags);
} catch (std::bad_alloc &) { } catch (std::bad_alloc &) {
...@@ -1281,7 +1281,7 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setSuperTypeName( ...@@ -1281,7 +1281,7 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setSuperTypeName(
} }
static TypeWriterImpl TYPEREG_CALLTYPE createEntry( static TypeWriterImpl TYPEREG_CALLTYPE createEntry(
RTTypeClass typeClass, rtl_uString * typeName, rtl_uString * superTypeName, RTTypeClass typeClass, rtl_uString const * typeName, rtl_uString const * superTypeName,
sal_uInt16 fieldCount, sal_uInt16 methodCount, sal_uInt16 referenceCount) sal_uInt16 fieldCount, sal_uInt16 methodCount, sal_uInt16 referenceCount)
{ {
OUString empty; OUString empty;
......
...@@ -896,7 +896,7 @@ RegError ORegistry::loadKey(RegKeyHandle hKey, const OUString& regFileName, ...@@ -896,7 +896,7 @@ RegError ORegistry::loadKey(RegKeyHandle hKey, const OUString& regFileName,
} }
RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey, RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
ORegKey* pSourceKey, ORegKey const * pSourceKey,
const OUString& valueName, const OUString& valueName,
sal_uInt32 nCut, sal_uInt32 nCut,
bool bWarnings, bool bWarnings,
...@@ -1021,7 +1021,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey, ...@@ -1021,7 +1021,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
RegError ORegistry::checkBlop(OStoreStream& rValue, RegError ORegistry::checkBlop(OStoreStream& rValue,
const OUString& sTargetPath, const OUString& sTargetPath,
sal_uInt32 srcValueSize, sal_uInt32 srcValueSize,
sal_uInt8* pSrcBuffer, sal_uInt8 const * pSrcBuffer,
bool bReport) bool bReport)
{ {
RegistryTypeReader reader(pSrcBuffer, srcValueSize); RegistryTypeReader reader(pSrcBuffer, srcValueSize);
...@@ -1123,8 +1123,8 @@ RegError ORegistry::checkBlop(OStoreStream& rValue, ...@@ -1123,8 +1123,8 @@ RegError ORegistry::checkBlop(OStoreStream& rValue,
} }
} }
static sal_uInt32 checkTypeReaders(RegistryTypeReader& reader1, static sal_uInt32 checkTypeReaders(RegistryTypeReader const & reader1,
RegistryTypeReader& reader2, RegistryTypeReader const & reader2,
std::set< OUString >& nameSet) std::set< OUString >& nameSet)
{ {
sal_uInt32 count=0; sal_uInt32 count=0;
...@@ -1145,8 +1145,8 @@ static sal_uInt32 checkTypeReaders(RegistryTypeReader& reader1, ...@@ -1145,8 +1145,8 @@ static sal_uInt32 checkTypeReaders(RegistryTypeReader& reader1,
} }
RegError ORegistry::mergeModuleValue(OStoreStream& rTargetValue, RegError ORegistry::mergeModuleValue(OStoreStream& rTargetValue,
RegistryTypeReader& reader, RegistryTypeReader const & reader,
RegistryTypeReader& reader2) RegistryTypeReader const & reader2)
{ {
std::set< OUString > nameSet; std::set< OUString > nameSet;
sal_uInt32 count = checkTypeReaders(reader, reader2, nameSet); sal_uInt32 count = checkTypeReaders(reader, reader2, nameSet);
......
...@@ -104,7 +104,7 @@ private: ...@@ -104,7 +104,7 @@ private:
RegError deleteSubkeysAndValues(ORegKey* pKey); RegError deleteSubkeysAndValues(ORegKey* pKey);
RegError loadAndSaveValue(ORegKey* pTargetKey, RegError loadAndSaveValue(ORegKey* pTargetKey,
ORegKey* pSourceKey, ORegKey const * pSourceKey,
const OUString& valueName, const OUString& valueName,
sal_uInt32 nCut, sal_uInt32 nCut,
bool bWarnings, bool bWarnings,
...@@ -113,12 +113,12 @@ private: ...@@ -113,12 +113,12 @@ private:
static RegError checkBlop(store::OStoreStream& rValue, static RegError checkBlop(store::OStoreStream& rValue,
const OUString& sTargetPath, const OUString& sTargetPath,
sal_uInt32 srcValueSize, sal_uInt32 srcValueSize,
sal_uInt8* pSrcBuffer, sal_uInt8 const * pSrcBuffer,
bool bReport); bool bReport);
static RegError mergeModuleValue(store::OStoreStream& rTargetValue, static RegError mergeModuleValue(store::OStoreStream& rTargetValue,
RegistryTypeReader& reader, RegistryTypeReader const & reader,
RegistryTypeReader& reader2); RegistryTypeReader const & reader2);
RegError loadAndSaveKeys(ORegKey* pTargetKey, RegError loadAndSaveKeys(ORegKey* pTargetKey,
ORegKey* pSourceKey, ORegKey* pSourceKey,
......
...@@ -101,8 +101,8 @@ bool OStoreDirectory_Impl::isKindOf (sal_uInt32 nTypeId) ...@@ -101,8 +101,8 @@ bool OStoreDirectory_Impl::isKindOf (sal_uInt32 nTypeId)
*/ */
storeError OStoreDirectory_Impl::create ( storeError OStoreDirectory_Impl::create (
OStorePageManager *pManager, OStorePageManager *pManager,
rtl_String *pPath, rtl_String const *pPath,
rtl_String *pName, rtl_String const *pName,
storeAccessMode eMode) storeAccessMode eMode)
{ {
rtl::Reference<OStorePageManager> xManager (pManager); rtl::Reference<OStorePageManager> xManager (pManager);
......
...@@ -51,8 +51,8 @@ public: ...@@ -51,8 +51,8 @@ public:
*/ */
storeError create ( storeError create (
OStorePageManager *pManager, OStorePageManager *pManager,
rtl_String *pPath, rtl_String const *pPath,
rtl_String *pName, rtl_String const *pName,
storeAccessMode eAccessMode); storeAccessMode eAccessMode);
/** iterate. /** iterate.
......
...@@ -75,8 +75,8 @@ bool OStoreLockBytes::isKindOf (sal_uInt32 nTypeId) ...@@ -75,8 +75,8 @@ bool OStoreLockBytes::isKindOf (sal_uInt32 nTypeId)
*/ */
storeError OStoreLockBytes::create ( storeError OStoreLockBytes::create (
OStorePageManager *pManager, OStorePageManager *pManager,
rtl_String *pPath, rtl_String const *pPath,
rtl_String *pName, rtl_String const *pName,
storeAccessMode eMode) storeAccessMode eMode)
{ {
rtl::Reference<OStorePageManager> xManager (pManager); rtl::Reference<OStorePageManager> xManager (pManager);
......
...@@ -51,8 +51,8 @@ public: ...@@ -51,8 +51,8 @@ public:
*/ */
storeError create ( storeError create (
OStorePageManager *pManager, OStorePageManager *pManager,
rtl_String *pPath, rtl_String const *pPath,
rtl_String *pName, rtl_String const *pName,
storeAccessMode eAccessMode); storeAccessMode eAccessMode);
/** Read at Offset into Buffer. /** Read at Offset into Buffer.
......
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