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
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)
......
......@@ -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))
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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.
......
......@@ -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();
......
......@@ -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.
......
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