diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-12-12 09:42:47 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-12-12 11:49:03 +0000 |
commit | 2c2e80da68efcee5bffdb61d9c078f9360a639a4 (patch) | |
tree | ecd55cd5c97f1dbe2580d033c0fcda6568ff849f /package/inc | |
parent | c928840ef2a41ca373ad9070d8e9160c216260da (diff) |
callcatcher: remove newly unused code
and rework reads to just return the read value
Change-Id: I5d2f01064465c65859ec4ba031ec9dfa16403487
Diffstat (limited to 'package/inc')
-rw-r--r-- | package/inc/ByteChucker.hxx | 37 | ||||
-rw-r--r-- | package/inc/ByteGrabber.hxx | 16 |
2 files changed, 41 insertions, 12 deletions
diff --git a/package/inc/ByteChucker.hxx b/package/inc/ByteChucker.hxx index 7e3e60c0ce65..e317e8acd6c4 100644 --- a/package/inc/ByteChucker.hxx +++ b/package/inc/ByteChucker.hxx @@ -48,12 +48,37 @@ public: sal_Int64 GetPosition() throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - ByteChucker& WriteInt8(sal_Int8 nInt8); - ByteChucker& WriteInt16(sal_Int16 nInt16); - ByteChucker& WriteInt32(sal_Int32 nInt32); - ByteChucker& WriteUInt8(sal_uInt8 nuInt8); - ByteChucker& WriteUInt16(sal_uInt16 nuInt16); - ByteChucker& WriteUInt32(sal_uInt32 nuInt32); + void WriteInt16(sal_Int16 nInt16) + { + p2Sequence[0] = static_cast< sal_Int8 >((nInt16 >> 0 ) & 0xFF); + p2Sequence[1] = static_cast< sal_Int8 >((nInt16 >> 8 ) & 0xFF); + WriteBytes( a2Sequence ); + } + + void WriteInt32(sal_Int32 nInt32) + { + p4Sequence[0] = static_cast< sal_Int8 >((nInt32 >> 0 ) & 0xFF); + p4Sequence[1] = static_cast< sal_Int8 >((nInt32 >> 8 ) & 0xFF); + p4Sequence[2] = static_cast< sal_Int8 >((nInt32 >> 16 ) & 0xFF); + p4Sequence[3] = static_cast< sal_Int8 >((nInt32 >> 24 ) & 0xFF); + WriteBytes( a4Sequence ); + } + + void WriteUInt16(sal_uInt16 nuInt16) + { + p2Sequence[0] = static_cast< sal_Int8 >((nuInt16 >> 0 ) & 0xFF); + p2Sequence[1] = static_cast< sal_Int8 >((nuInt16 >> 8 ) & 0xFF); + WriteBytes( a2Sequence ); + } + + void WriteUInt32(sal_uInt32 nuInt32) + { + p4Sequence[0] = static_cast < sal_Int8 > ((nuInt32 >> 0 ) & 0xFF); + p4Sequence[1] = static_cast < sal_Int8 > ((nuInt32 >> 8 ) & 0xFF); + p4Sequence[2] = static_cast < sal_Int8 > ((nuInt32 >> 16 ) & 0xFF); + p4Sequence[3] = static_cast < sal_Int8 > ((nuInt32 >> 24 ) & 0xFF); + WriteBytes( a4Sequence ); + } }; #endif diff --git a/package/inc/ByteGrabber.hxx b/package/inc/ByteGrabber.hxx index 26df1b19a131..2791e0bfd6c7 100644 --- a/package/inc/ByteGrabber.hxx +++ b/package/inc/ByteGrabber.hxx @@ -58,12 +58,16 @@ public: sal_Int64 SAL_CALL getLength( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); - ByteGrabber& ReadInt8(sal_Int8& rInt8); - ByteGrabber& ReadInt16(sal_Int16& rInt16); - ByteGrabber& ReadInt32(sal_Int32& rInt32); - ByteGrabber& ReadUInt8(sal_uInt8& ruInt8); - ByteGrabber& ReadUInt16(sal_uInt16& ruInt16); - ByteGrabber& ReadUInt32(sal_uInt32& ruInt32); + sal_uInt16 ReadUInt16(); + sal_uInt32 ReadUInt32(); + sal_Int16 ReadInt16() + { + return static_cast<sal_Int16>(ReadUInt16()); + } + sal_Int32 ReadInt32() + { + return static_cast<sal_Int32>(ReadUInt32()); + } }; #endif |