Kaydet (Commit) eb4cbea6 authored tarafından Matteo Casalin's avatar Matteo Casalin

Silence some conversion warnings

Change-Id: I676ed010576f3a24b193ffc6c28a319bcc5ac968
üst 4215bca9
...@@ -95,7 +95,7 @@ storeError ILockBytes::readAt (sal_uInt32 nOffset, void * pBuffer, sal_uInt32 nB ...@@ -95,7 +95,7 @@ storeError ILockBytes::readAt (sal_uInt32 nOffset, void * pBuffer, sal_uInt32 nB
if (src_size > SAL_MAX_UINT32) if (src_size > SAL_MAX_UINT32)
return store_E_CantSeek; 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) 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 ...@@ -117,7 +117,7 @@ storeError ILockBytes::writeAt (sal_uInt32 nOffset, void const * pBuffer, sal_uI
if (dst_size > SAL_MAX_UINT32) if (dst_size > SAL_MAX_UINT32)
return store_E_CantSeek; 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) storeError ILockBytes::getSize (sal_uInt32 & rnSize)
......
...@@ -512,9 +512,9 @@ struct PageData ...@@ -512,9 +512,9 @@ struct PageData
void guard (sal_uInt32 nAddr) void guard (sal_uInt32 nAddr)
{ {
sal_uInt32 nCRC32 = 0; 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); 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); m_aGuard.m_nCRC32 = store::htonl(nCRC32);
} }
...@@ -523,8 +523,8 @@ struct PageData ...@@ -523,8 +523,8 @@ struct PageData
storeError verify (sal_uInt32 nAddr) const storeError verify (sal_uInt32 nAddr) const
{ {
sal_uInt32 nCRC32 = 0; 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)));
nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, theSize - sizeof(G)); nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G)));
if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) if (m_aGuard.m_nCRC32 != store::htonl(nCRC32))
return store_E_InvalidChecksum; return store_E_InvalidChecksum;
if (m_aDescr.m_nAddr != store::htonl(nAddr)) if (m_aDescr.m_nAddr != store::htonl(nAddr))
......
...@@ -120,8 +120,8 @@ struct OStoreSuperBlock ...@@ -120,8 +120,8 @@ struct OStoreSuperBlock
void guard() void guard()
{ {
sal_uInt32 nCRC32 = 0; 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)));
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); m_aGuard.m_nCRC32 = store::htonl(nCRC32);
} }
...@@ -134,8 +134,8 @@ struct OStoreSuperBlock ...@@ -134,8 +134,8 @@ struct OStoreSuperBlock
return store_E_WrongFormat; return store_E_WrongFormat;
sal_uInt32 nCRC32 = 0; 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)));
nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, theSize - sizeof(G)); nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G)));
if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) if (m_aGuard.m_nCRC32 != store::htonl(nCRC32))
return store_E_InvalidChecksum; return store_E_InvalidChecksum;
else else
......
...@@ -244,7 +244,7 @@ class PageCache_Impl : ...@@ -244,7 +244,7 @@ class PageCache_Impl :
static inline int hash_Impl(sal_uInt32 a, size_t s, size_t q, size_t m) 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) inline int hash_index_Impl (sal_uInt32 nOffset)
{ {
......
...@@ -63,7 +63,7 @@ struct OStoreDataPageData : public store::OStorePageData ...@@ -63,7 +63,7 @@ struct OStoreDataPageData : public store::OStorePageData
*/ */
static sal_uInt16 capacity (const D& rDescr) // @see inode::ChunkDescriptor 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 sal_uInt16 capacity() const
{ {
...@@ -149,7 +149,7 @@ struct OStoreIndirectionPageData : public store::OStorePageData ...@@ -149,7 +149,7 @@ struct OStoreIndirectionPageData : public store::OStorePageData
*/ */
static sal_uInt16 capacity (const D& rDescr) 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 sal_uInt16 capacity() const
{ {
...@@ -320,8 +320,8 @@ struct OStorePageNameBlock ...@@ -320,8 +320,8 @@ struct OStorePageNameBlock
void guard() void guard()
{ {
sal_uInt32 nCRC32 = 0; 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)));
nCRC32 = rtl_crc32 (nCRC32, &m_aKey, theSize - sizeof(G)); nCRC32 = rtl_crc32 (nCRC32, &m_aKey, static_cast<sal_uInt32>(theSize - sizeof(G)));
m_aGuard.m_nCRC32 = store::htonl(nCRC32); m_aGuard.m_nCRC32 = store::htonl(nCRC32);
} }
...@@ -330,8 +330,8 @@ struct OStorePageNameBlock ...@@ -330,8 +330,8 @@ struct OStorePageNameBlock
storeError verify() const storeError verify() const
{ {
sal_uInt32 nCRC32 = 0; 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)));
nCRC32 = rtl_crc32 (nCRC32, &m_aKey, theSize - sizeof(G)); nCRC32 = rtl_crc32 (nCRC32, &m_aKey, static_cast<sal_uInt32>(theSize - sizeof(G)));
if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) if (m_aGuard.m_nCRC32 != store::htonl(nCRC32))
return store_E_InvalidChecksum; return store_E_InvalidChecksum;
else else
...@@ -424,8 +424,8 @@ struct OStoreDirectoryDataBlock ...@@ -424,8 +424,8 @@ struct OStoreDirectoryDataBlock
void guard() void guard()
{ {
sal_uInt32 nCRC32 = 0; 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)));
nCRC32 = rtl_crc32 (nCRC32, &m_aTable, theSize - sizeof(G)); nCRC32 = rtl_crc32 (nCRC32, &m_aTable, static_cast<sal_uInt32>(theSize - sizeof(G)));
m_aGuard.m_nCRC32 = store::htonl(nCRC32); m_aGuard.m_nCRC32 = store::htonl(nCRC32);
} }
...@@ -434,8 +434,8 @@ struct OStoreDirectoryDataBlock ...@@ -434,8 +434,8 @@ struct OStoreDirectoryDataBlock
storeError verify() const storeError verify() const
{ {
sal_uInt32 nCRC32 = 0; 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)));
nCRC32 = rtl_crc32 (nCRC32, &m_aTable, theSize - sizeof(G)); nCRC32 = rtl_crc32 (nCRC32, &m_aTable, static_cast<sal_uInt32>(theSize - sizeof(G)));
if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) if (m_aGuard.m_nCRC32 != store::htonl(nCRC32))
return store_E_InvalidChecksum; return store_E_InvalidChecksum;
else else
...@@ -547,7 +547,7 @@ struct OStoreDirectoryPageData : public store::OStorePageData ...@@ -547,7 +547,7 @@ struct OStoreDirectoryPageData : public store::OStorePageData
*/ */
sal_uInt16 capacity() const 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. /** Construction.
......
...@@ -191,7 +191,7 @@ storeError OStoreDirectory_Impl::iterate (storeFindData &rFindData) ...@@ -191,7 +191,7 @@ storeError OStoreDirectory_Impl::iterate (storeFindData &rFindData)
memset (&rFindData.m_pszName[n], 0, k); 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_nAttrib |= aPage.attrib();
rFindData.m_nSize = aPage.dataLength(); rFindData.m_nSize = aPage.dataLength();
......
...@@ -128,7 +128,7 @@ struct OStoreBTreeNodeData : public store::OStorePageData ...@@ -128,7 +128,7 @@ struct OStoreBTreeNodeData : public store::OStorePageData
*/ */
sal_uInt16 capacity() const 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). /** capacityCount (must be even).
...@@ -142,7 +142,7 @@ struct OStoreBTreeNodeData : public store::OStorePageData ...@@ -142,7 +142,7 @@ struct OStoreBTreeNodeData : public store::OStorePageData
*/ */
sal_uInt16 usage() const 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. /** usageCount.
......
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