dbaccess/source/filter/hsqldb/rowinputbinary.cxx |   19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

New commits:
commit 2d21560b780060114c2e9ab95d6a4680a590ab0f
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Feb 7 11:21:37 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Feb 7 16:02:14 2022 +0100

    sal_uInt8 is typedefed as unsigned char so this casting isn't needed
    
    Change-Id: I190bbcb915664ed0cf803814c399b841ae41c519
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129594
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx 
b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
index 1a71ad9276e1..f7a927a487de 100644
--- a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
+++ b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
@@ -165,9 +165,8 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
     sal_Int32 nStrLen = 0;
     while (nCount < nUTFLen)
     {
-        unsigned char cIn = 0;
-        m_pStream->ReadUChar(cIn);
-        sal_uInt8 c = reinterpret_cast<sal_uInt8&>(cIn);
+        sal_uInt8 c = 0;
+        m_pStream->ReadUChar(c);
         sal_uInt8 char2, char3;
         switch (c >> 4)
         {
@@ -193,8 +192,7 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
                     throw WrongFormatException();
                 }
 
-                m_pStream->ReadUChar(cIn);
-                char2 = reinterpret_cast<sal_uInt8&>(cIn);
+                m_pStream->ReadUChar(char2);
                 if ((char2 & 0xC0) != 0x80)
                 {
                     throw WrongFormatException();
@@ -211,10 +209,8 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
                     throw WrongFormatException();
                 }
 
-                m_pStream->ReadUChar(cIn);
-                char2 = reinterpret_cast<sal_uInt8&>(cIn);
-                m_pStream->ReadUChar(cIn);
-                char3 = reinterpret_cast<sal_uInt8&>(cIn);
+                m_pStream->ReadUChar(char2);
+                m_pStream->ReadUChar(char3);
 
                 if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80))
                 {
@@ -234,9 +230,8 @@ OUString HsqlRowInputStream::readUTF(sal_Int32 nUTFLen)
 
 bool HsqlRowInputStream::checkNull()
 {
-    unsigned char cIn = 0;
-    m_pStream->ReadUChar(cIn);
-    sal_uInt8 nNull = reinterpret_cast<sal_uInt8&>(cIn);
+    sal_uInt8 nNull = 0;
+    m_pStream->ReadUChar(nNull);
     return nNull == 0;
 }
 

Reply via email to