diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-03-29 12:06:33 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-03-29 12:07:36 +0200 |
commit | 66a88dc17e91d03a130b21a511ce298dd5a52e12 (patch) | |
tree | 51d837b95391d760f815e576a1a9cc8888674a4b /registry | |
parent | 633cbb4954a2469f3c8911fbdffcaa4340ca6ac9 (diff) |
UNO BYTE is signed
This is hopefully a better fix for c589fa17b8f3e6ded0d1e04120781eb5d6735bc7
"Dalvik enforces byte constants being in range (-128..127)."
Diffstat (limited to 'registry')
-rw-r--r-- | registry/inc/registry/types.h | 2 | ||||
-rw-r--r-- | registry/source/reflread.cxx | 9 | ||||
-rw-r--r-- | registry/source/reflwrit.cxx | 3 | ||||
-rw-r--r-- | registry/source/regimpl.cxx | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/registry/inc/registry/types.h b/registry/inc/registry/types.h index cee37bb24001..77ae249925fd 100644 --- a/registry/inc/registry/types.h +++ b/registry/inc/registry/types.h @@ -218,7 +218,7 @@ enum RTValueType { */ union RTConstValueUnion { sal_Bool aBool; - sal_uInt8 aByte; + sal_Int8 aByte; sal_Int16 aShort; sal_uInt16 aUShort; sal_Int32 aLong; diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx index cac943f58e46..e8ddab00b093 100644 --- a/registry/source/reflread.cxx +++ b/registry/source/reflread.cxx @@ -259,7 +259,7 @@ public: const sal_Char* readUTF8NameConstant(sal_uInt16 index); sal_Bool readBOOLConstant(sal_uInt16 index); - sal_uInt8 readBYTEConstant(sal_uInt16 index); + sal_Int8 readBYTEConstant(sal_uInt16 index); sal_Int16 readINT16Constant(sal_uInt16 index); sal_uInt16 readUINT16Constant(sal_uInt16 index); sal_Int32 readINT32Constant(sal_uInt16 index); @@ -367,15 +367,16 @@ sal_Bool ConstantPool::readBOOLConstant(sal_uInt16 index) return aBool; } -sal_uInt8 ConstantPool::readBYTEConstant(sal_uInt16 index) +sal_Int8 ConstantPool::readBYTEConstant(sal_uInt16 index) { - sal_uInt8 aByte = sal_False; + sal_Int8 aByte = 0; if (m_pIndex && (index> 0) && (index <= m_numOfEntries)) { if (readUINT16(m_pIndex[index - 1] + CP_OFFSET_ENTRY_TAG) == CP_TAG_CONST_BYTE) { - aByte = readBYTE(m_pIndex[index - 1] + CP_OFFSET_ENTRY_DATA); + aByte = static_cast< sal_Int8 >( + readBYTE(m_pIndex[index - 1] + CP_OFFSET_ENTRY_DATA)); } } diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index 9fb415aa2277..791a6e4b68c1 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -302,7 +302,8 @@ sal_uInt32 CPInfo::toBlop(sal_uInt8* buffer) buff += writeBYTE(buff, (sal_uInt8) m_value.aConst.aBool); break; case CP_TAG_CONST_BYTE: - buff += writeBYTE(buff, m_value.aConst.aByte); + buff += writeBYTE( + buff, static_cast< sal_uInt8 >(m_value.aConst.aByte)); break; case CP_TAG_CONST_INT16: buff += writeINT16(buff, m_value.aConst.aShort); diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index e82789b43cc4..401fb988ecec 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -242,9 +242,7 @@ void dumpType(typereg::Reader const & reader, rtl::OString const & indent) { break; case RT_TYPE_BYTE: - printf( - "byte 0x%02X", - static_cast< unsigned int >(value.m_value.aByte)); + printf("byte %d", static_cast< int >(value.m_value.aByte)); break; case RT_TYPE_INT16: |