summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--store/source/lockbyte.cxx4
-rw-r--r--store/source/storbase.hxx8
-rw-r--r--store/source/storbios.cxx8
-rw-r--r--store/source/storcach.cxx2
-rw-r--r--store/source/stordata.hxx22
-rw-r--r--store/source/stordir.cxx2
-rw-r--r--store/source/stortree.hxx4
7 files changed, 25 insertions, 25 deletions
diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx
index 09925400d0a5..552199366781 100644
--- a/store/source/lockbyte.cxx
+++ b/store/source/lockbyte.cxx
@@ -95,7 +95,7 @@ storeError ILockBytes::readAt (sal_uInt32 nOffset, void * pBuffer, sal_uInt32 nB
if (src_size > SAL_MAX_UINT32)
return store_E_CantSeek;
- return readAt_Impl (nOffset, dst_lo, (dst_hi - dst_lo));
+ return readAt_Impl (nOffset, dst_lo, nBytes);
}
storeError ILockBytes::writeAt (sal_uInt32 nOffset, void const * pBuffer, sal_uInt32 nBytes)
@@ -117,7 +117,7 @@ storeError ILockBytes::writeAt (sal_uInt32 nOffset, void const * pBuffer, sal_uI
if (dst_size > SAL_MAX_UINT32)
return store_E_CantSeek;
- return writeAt_Impl (nOffset, src_lo, (src_hi - src_lo));
+ return writeAt_Impl (nOffset, src_lo, nBytes);
}
storeError ILockBytes::getSize (sal_uInt32 & rnSize)
diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx
index 395870f9fcf9..78a51a1c53d1 100644
--- a/store/source/storbase.hxx
+++ b/store/source/storbase.hxx
@@ -512,9 +512,9 @@ struct PageData
void guard (sal_uInt32 nAddr)
{
sal_uInt32 nCRC32 = 0;
- nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32)));
m_aDescr.m_nAddr = store::htonl(nAddr);
- nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, theSize - sizeof(G));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G)));
m_aGuard.m_nCRC32 = store::htonl(nCRC32);
}
@@ -523,8 +523,8 @@ struct PageData
storeError verify (sal_uInt32 nAddr) const
{
sal_uInt32 nCRC32 = 0;
- nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
- nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, theSize - sizeof(G));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32)));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G)));
if (m_aGuard.m_nCRC32 != store::htonl(nCRC32))
return store_E_InvalidChecksum;
if (m_aDescr.m_nAddr != store::htonl(nAddr))
diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx
index 9f494f1c1619..0b06795668a8 100644
--- a/store/source/storbios.cxx
+++ b/store/source/storbios.cxx
@@ -120,8 +120,8 @@ struct OStoreSuperBlock
void guard()
{
sal_uInt32 nCRC32 = 0;
- nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
- nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, theSize - sizeof(G));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32)));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G)));
m_aGuard.m_nCRC32 = store::htonl(nCRC32);
}
@@ -134,8 +134,8 @@ struct OStoreSuperBlock
return store_E_WrongFormat;
sal_uInt32 nCRC32 = 0;
- nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
- nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, theSize - sizeof(G));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32)));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G)));
if (m_aGuard.m_nCRC32 != store::htonl(nCRC32))
return store_E_InvalidChecksum;
else
diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx
index 072679cd0e0f..1b7243d56bd4 100644
--- a/store/source/storcach.cxx
+++ b/store/source/storcach.cxx
@@ -244,7 +244,7 @@ class PageCache_Impl :
static inline int hash_Impl(sal_uInt32 a, size_t s, size_t q, size_t m)
{
- return ((((a) + ((a) >> (s)) + ((a) >> ((s) << 1))) >> (q)) & (m));
+ return static_cast<int>((((a) + ((a) >> (s)) + ((a) >> ((s) << 1))) >> (q)) & (m));
}
inline int hash_index_Impl (sal_uInt32 nOffset)
{
diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx
index fa1666471f13..17de3c35f25e 100644
--- a/store/source/stordata.hxx
+++ b/store/source/stordata.hxx
@@ -63,7 +63,7 @@ struct OStoreDataPageData : public store::OStorePageData
*/
static sal_uInt16 capacity (const D& rDescr) // @see inode::ChunkDescriptor
{
- return (store::ntohs(rDescr.m_nSize) - self::thePageSize);
+ return static_cast<sal_uInt16>(store::ntohs(rDescr.m_nSize) - self::thePageSize);
}
sal_uInt16 capacity() const
{
@@ -149,7 +149,7 @@ struct OStoreIndirectionPageData : public store::OStorePageData
*/
static sal_uInt16 capacity (const D& rDescr)
{
- return (store::ntohs(rDescr.m_nSize) - self::thePageSize);
+ return static_cast<sal_uInt16>(store::ntohs(rDescr.m_nSize) - self::thePageSize);
}
sal_uInt16 capacity() const
{
@@ -320,8 +320,8 @@ struct OStorePageNameBlock
void guard()
{
sal_uInt32 nCRC32 = 0;
- nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
- nCRC32 = rtl_crc32 (nCRC32, &m_aKey, theSize - sizeof(G));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32)));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aKey, static_cast<sal_uInt32>(theSize - sizeof(G)));
m_aGuard.m_nCRC32 = store::htonl(nCRC32);
}
@@ -330,8 +330,8 @@ struct OStorePageNameBlock
storeError verify() const
{
sal_uInt32 nCRC32 = 0;
- nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
- nCRC32 = rtl_crc32 (nCRC32, &m_aKey, theSize - sizeof(G));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32)));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aKey, static_cast<sal_uInt32>(theSize - sizeof(G)));
if (m_aGuard.m_nCRC32 != store::htonl(nCRC32))
return store_E_InvalidChecksum;
else
@@ -424,8 +424,8 @@ struct OStoreDirectoryDataBlock
void guard()
{
sal_uInt32 nCRC32 = 0;
- nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
- nCRC32 = rtl_crc32 (nCRC32, &m_aTable, theSize - sizeof(G));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32)));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aTable, static_cast<sal_uInt32>(theSize - sizeof(G)));
m_aGuard.m_nCRC32 = store::htonl(nCRC32);
}
@@ -434,8 +434,8 @@ struct OStoreDirectoryDataBlock
storeError verify() const
{
sal_uInt32 nCRC32 = 0;
- nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32));
- nCRC32 = rtl_crc32 (nCRC32, &m_aTable, theSize - sizeof(G));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, static_cast<sal_uInt32>(sizeof(sal_uInt32)));
+ nCRC32 = rtl_crc32 (nCRC32, &m_aTable, static_cast<sal_uInt32>(theSize - sizeof(G)));
if (m_aGuard.m_nCRC32 != store::htonl(nCRC32))
return store_E_InvalidChecksum;
else
@@ -547,7 +547,7 @@ struct OStoreDirectoryPageData : public store::OStorePageData
*/
sal_uInt16 capacity() const
{
- return (store::ntohs(base::m_aDescr.m_nSize) - self::thePageSize);
+ return static_cast<sal_uInt16>(store::ntohs(base::m_aDescr.m_nSize) - self::thePageSize);
}
/** Construction.
diff --git a/store/source/stordir.cxx b/store/source/stordir.cxx
index 77ea3f0afd47..08233d092fc5 100644
--- a/store/source/stordir.cxx
+++ b/store/source/stordir.cxx
@@ -191,7 +191,7 @@ storeError OStoreDirectory_Impl::iterate (storeFindData &rFindData)
memset (&rFindData.m_pszName[n], 0, k);
}
- rFindData.m_nLength = n;
+ rFindData.m_nLength = static_cast<sal_Int32>(n);
rFindData.m_nAttrib |= aPage.attrib();
rFindData.m_nSize = aPage.dataLength();
diff --git a/store/source/stortree.hxx b/store/source/stortree.hxx
index c3c5b6f8f2db..7c865637068d 100644
--- a/store/source/stortree.hxx
+++ b/store/source/stortree.hxx
@@ -128,7 +128,7 @@ struct OStoreBTreeNodeData : public store::OStorePageData
*/
sal_uInt16 capacity() const
{
- return (store::ntohs(base::m_aDescr.m_nSize) - self::thePageSize);
+ return static_cast<sal_uInt16>(store::ntohs(base::m_aDescr.m_nSize) - self::thePageSize);
}
/** capacityCount (must be even).
@@ -142,7 +142,7 @@ struct OStoreBTreeNodeData : public store::OStorePageData
*/
sal_uInt16 usage() const
{
- return (store::ntohs(base::m_aDescr.m_nUsed) - self::thePageSize);
+ return static_cast<sal_uInt16>(store::ntohs(base::m_aDescr.m_nUsed) - self::thePageSize);
}
/** usageCount.