Kaydet (Commit) 0e9f7614 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

const_cast: convert some C-style casts and remove some redundant ones

Change-Id: I32d7a1d4fed6ef5c56f485cd92464f2d0960e5fd
üst 9bd2b842
...@@ -171,7 +171,7 @@ BlopObject::~BlopObject() ...@@ -171,7 +171,7 @@ BlopObject::~BlopObject()
{ {
if (m_isCopied) if (m_isCopied)
{ {
delete[] const_cast<sal_uInt8*>(m_pBuffer); delete[] m_pBuffer;
} }
} }
......
...@@ -90,7 +90,7 @@ sal_uInt32 readString(const sal_uInt8* buffer, sal_Unicode* v, sal_uInt32 maxSiz ...@@ -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 len = UINT16StringLen(buffer) + 1;
sal_uInt32 i; sal_uInt32 i;
sal_uInt8* buff = (sal_uInt8*)buffer; sal_uInt8* buff = const_cast<sal_uInt8*>(buffer);
if(len > maxSize / 2) if(len > maxSize / 2)
{ {
...@@ -108,7 +108,7 @@ sal_uInt32 readString(const sal_uInt8* buffer, sal_Unicode* v, sal_uInt32 maxSiz ...@@ -108,7 +108,7 @@ sal_uInt32 readString(const sal_uInt8* buffer, sal_Unicode* v, sal_uInt32 maxSiz
v[len - 1] = L'\0'; v[len - 1] = L'\0';
return (buff - ((sal_uInt8*)buffer)); return (buff - buffer);
} }
sal_uInt32 writeFloat(sal_uInt8* buffer, float v) sal_uInt32 writeFloat(sal_uInt8* buffer, float v)
...@@ -364,7 +364,7 @@ FieldEntry::~FieldEntry() ...@@ -364,7 +364,7 @@ FieldEntry::~FieldEntry()
(m_constValue.aString != NULL_WSTRING) (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, ...@@ -394,7 +394,7 @@ void FieldEntry::setData(const OString& name,
(m_constValue.aString != NULL_WSTRING) (m_constValue.aString != NULL_WSTRING)
) )
{ {
delete[] (sal_Unicode*)m_constValue.aString; delete[] m_constValue.aString;
} }
m_access = access; m_access = access;
......
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