From 0e9f7614893405dd27a00ccd7274ed3097ac73d7 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 26 Mar 2015 15:30:02 +0100 Subject: const_cast: convert some C-style casts and remove some redundant ones Change-Id: I32d7a1d4fed6ef5c56f485cd92464f2d0960e5fd --- registry/source/reflread.cxx | 2 +- registry/source/reflwrit.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'registry') diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx index 23f267d5a369..532b75f05129 100644 --- a/registry/source/reflread.cxx +++ b/registry/source/reflread.cxx @@ -171,7 +171,7 @@ BlopObject::~BlopObject() { if (m_isCopied) { - delete[] const_cast(m_pBuffer); + delete[] m_pBuffer; } } diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index b35af8d3db4d..7bc706dc3d67 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -90,7 +90,7 @@ sal_uInt32 readString(const sal_uInt8* buffer, sal_Unicode* v, sal_uInt32 maxSiz { sal_uInt32 len = UINT16StringLen(buffer) + 1; sal_uInt32 i; - sal_uInt8* buff = (sal_uInt8*)buffer; + sal_uInt8* buff = const_cast(buffer); if(len > maxSize / 2) { @@ -108,7 +108,7 @@ sal_uInt32 readString(const sal_uInt8* buffer, sal_Unicode* v, sal_uInt32 maxSiz v[len - 1] = L'\0'; - return (buff - ((sal_uInt8*)buffer)); + return (buff - buffer); } sal_uInt32 writeFloat(sal_uInt8* buffer, float v) @@ -364,7 +364,7 @@ FieldEntry::~FieldEntry() (m_constValue.aString != NULL_WSTRING) ) { - delete[] (sal_Unicode*)m_constValue.aString; + delete[] m_constValue.aString; } } @@ -394,7 +394,7 @@ void FieldEntry::setData(const OString& name, (m_constValue.aString != NULL_WSTRING) ) { - delete[] (sal_Unicode*)m_constValue.aString; + delete[] m_constValue.aString; } m_access = access; -- cgit