Kaydet (Commit) 6a0fb0de authored tarafından Caolán McNamara's avatar Caolán McNamara

align types

Change-Id: I6080d92ec26f9ee9bf3eb4319a36c10ae38caca2
Reviewed-on: https://gerrit.libreoffice.org/48253Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst c18d183c
......@@ -67,8 +67,8 @@ class LwpSvStream
{
public:
LwpSvStream(SvStream* pStream, LwpSvStream * pCompressed = nullptr);
sal_Int32 Read( void* bytes, sal_Int32 nBytesToRead );
void SeekRel( sal_Int64 pos );
size_t Read(void* bytes, size_t nBytesToRead);
void SeekRel(sal_Int64 pos);
sal_Int64 Tell();
sal_Int64 Seek(sal_Int64 pos);
bool CheckSeek(sal_Int64 pos);
......
......@@ -170,8 +170,8 @@ LtcBenContainer::LtcBenContainer(LwpSvStream * pStream)
* @param number of bytes read
* @return BenError
*/
BenError LtcBenContainer::Read(void * pBuffer, unsigned long MaxSize,
unsigned long * pAmtRead)
BenError LtcBenContainer::Read(void * pBuffer, size_t MaxSize,
size_t* pAmtRead)
{
*pAmtRead = cpStream->Read(pBuffer, MaxSize);
return BenErr_OK;
......@@ -182,11 +182,10 @@ BenError LtcBenContainer::Read(void * pBuffer, unsigned long MaxSize,
* @param number of bytes to be read
* @return BenError
*/
BenError LtcBenContainer::ReadKnownSize(void * pBuffer, unsigned long Amt)
BenError LtcBenContainer::ReadKnownSize(void * pBuffer, size_t Amt)
{
sal_uLong ulLength;
ulLength = cpStream->Read(pBuffer, Amt);
if(ulLength == Amt)
size_t ulLength = cpStream->Read(pBuffer, Amt);
if (ulLength == Amt)
{
return BenErr_OK;
}
......
......@@ -128,13 +128,13 @@ class CBenValueSegment;
class CBenNamedObject;
class CBenPropertyName;
typedef unsigned char BenByte;
typedef unsigned short BenWord;
typedef unsigned long BenDWord;
typedef sal_uInt8 BenByte;
typedef sal_uInt16 BenWord;
typedef sal_uInt32 BenDWord;
typedef unsigned long BenContainerPos;
typedef unsigned long BenObjectID;
typedef unsigned long BenGeneration;
typedef sal_uInt32 BenContainerPos;
typedef sal_uInt32 BenObjectID;
typedef sal_uInt32 BenGeneration;
sal_uLong BenOpenContainer(LwpSvStream * pStream, LtcBenContainer ** ppContainer);
......@@ -187,10 +187,9 @@ protected: // Overridden methods
private: // Data
CBenValue * cpValue;
unsigned long cCurrentPosition;
size_t cCurrentPosition;
sal_uLong m_ulValueLength; // Added by , sum of length of all sub-valuesegments
// void GetAmountLeft(sal_uLong * pAmtLeft); useless in SODC
};
class LtcBenContainer
......@@ -210,9 +209,9 @@ public: // Internal methods
~LtcBenContainer();
sal_uLong remainingSize() const;
BenError Read(void * pBuffer, unsigned long MaxSize,
unsigned long * pAmtRead);
BenError ReadKnownSize(void * pBuffer, unsigned long Amt);
BenError Read(void * pBuffer, size_t MaxSize,
size_t* pAmtRead);
BenError ReadKnownSize(void * pBuffer, size_t Amt);
BenError SeekToPosition(BenContainerPos Pos);
BenError SeekFromEnd(long Offset);
......@@ -253,9 +252,9 @@ private: // Data
class CBenValue : public CBenIDListElmt
{
public:
unsigned long GetValueSize();
size_t GetValueSize();
void ReadValueData(void * pBuffer,
unsigned long Offset, unsigned long MaxSize, unsigned long * pAmtRead);
size_t Offset, size_t MaxSize, size_t* pAmtRead);
CBenProperty * BEN_EXPORT GetProperty() { return cpProperty; }
......@@ -309,7 +308,7 @@ class CBenValueSegment : public CUtListElmt
{
public: // Internal methods
CBenValueSegment(CBenValue * pValue, BenContainerPos Pos,
unsigned long Size) : CUtListElmt(&pValue->GetValueSegments())
size_t Size) : CUtListElmt(&pValue->GetValueSegments())
{ cpValue = pValue; cImmediate = false; cPos = Pos;
cSize = Size; }
CBenValueSegment(CBenValue * pValue, const void * pImmData,
......@@ -318,7 +317,7 @@ public: // Internal methods
std::memcpy(cImmData, pImmData, Size); cSize = Size; }
bool IsImmediate() { return cImmediate; }
BenContainerPos GetPosition() { return cPos; }
unsigned long GetSize() { return cSize; }
size_t GetSize() { return cSize; }
BenByte * GetImmediateData() { return cImmData; }
private: // Data
......@@ -329,7 +328,7 @@ private: // Data
BenContainerPos cPos;
BenByte cImmData[4];
};
unsigned long cSize;
size_t cSize;
};
inline CBenValueSegment * CBenValue::GetNextValueSegment(CBenValueSegment const *
......
......@@ -64,10 +64,10 @@
namespace OpenStormBento
{
unsigned long
size_t
CBenValue::GetValueSize()
{
unsigned long Size = 0;
size_t Size = 0;
CBenValueSegment * pCurr = nullptr;
while ((pCurr = GetNextValueSegment(pCurr)) != nullptr)
Size += pCurr->GetSize();
......@@ -75,11 +75,11 @@ CBenValue::GetValueSize()
}
void
CBenValue::ReadValueData(void * pReadBuffer, unsigned long Offset,
unsigned long Amt, unsigned long * pAmtRead)
CBenValue::ReadValueData(void * pReadBuffer, size_t Offset,
size_t Amt, size_t* pAmtRead)
{
BenError Err;
unsigned long SegOffset = 0;
size_t SegOffset = 0;
*pAmtRead = 0;
CBenValueSegment * pCurrSeg = nullptr;
LtcBenContainer * pContainer = GetProperty()->GetContainer();
......@@ -99,13 +99,13 @@ CBenValue::ReadValueData(void * pReadBuffer, unsigned long Offset,
if (SegOffset <= Offset && Offset < SegOffset + pCurrSeg->GetSize()) /// begin at current segment
{
unsigned long OffsetIntoSeg = Offset - SegOffset; /// relative value in this value segment stream
size_t OffsetIntoSeg = Offset - SegOffset; /// relative value in this value segment stream
unsigned long AmtThisSeg = std::min(Amt, pCurrSeg->GetSize() -
size_t AmtThisSeg = std::min(Amt, pCurrSeg->GetSize() -
OffsetIntoSeg); /// size read in this segment, it's minimal value between Amt &
/// remain part from OffsetIntoSeg to the end of this segment
unsigned long AmtReadThisSeg; /// actual read size in this segment
size_t AmtReadThisSeg; /// actual read size in this segment
if (pCurrSeg->IsImmediate())
{
std::memcpy(pBuffer, pCurrSeg->GetImmediateData() +
......
......@@ -66,7 +66,7 @@ LwpSvStream::LwpSvStream(SvStream* pStream, LwpSvStream * pCompressed)
/**
* @descr read nBytesToRead bytes to buf
*/
sal_Int32 LwpSvStream::Read(void* buf, sal_Int32 nBytesToRead)
size_t LwpSvStream::Read(void* buf, size_t nBytesToRead)
{
return m_pStream->ReadBytes(buf, nBytesToRead);
}
......
......@@ -256,7 +256,7 @@ CBenTOCReader::ReadTOC()
return BenErr_NamedObjectError;
BenContainerPos Pos;
unsigned long Length;
sal_uInt32 Length;
if ((Err = GetDWord(&Pos)) != BenErr_OK)
return Err;
......@@ -393,7 +393,7 @@ CBenTOCReader::ReadSegment(CBenValue * pValue, BenByte * pLookAhead)
bool Immediate = false;
bool EightByteOffset = false;
unsigned long Offset(0), Length(0);
sal_uInt32 Offset(0), Length(0);
switch (*pLookAhead)
{
......
......@@ -65,11 +65,8 @@ namespace OpenStormBento
*/
std::size_t LtcUtBenValueStream::GetData(void* pData, std::size_t nSize)
{
//unsigned long AmtLeft;
unsigned long AmtRead;
//GetAmountLeft(&AmtLeft);
size_t AmtRead;
//unsigned long AmtShouldRead = UtMin(nSize, AmtLeft);
/*BenError Err = */cpValue->ReadValueData(pData, cCurrentPosition, nSize,
&AmtRead);
cCurrentPosition += AmtRead;
......
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