Kaydet (Commit) 0b0a6e9b authored tarafından Stephan Bergmann's avatar Stephan Bergmann

More loplugin:cstylecast: store

auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: Ie71dbe8077e1467a93fda3c92cce178e53ecb2f4
üst dd68ebad
......@@ -114,7 +114,7 @@ struct OStorePageGuard
}
};
#define STORE_PAGE_NULL ((sal_uInt32)(~0))
#define STORE_PAGE_NULL (sal_uInt32(~0))
struct OStorePageDescriptor
{
......
......@@ -601,7 +601,7 @@ OStoreDirectoryPageObject::scope (
index0 = nPage;
// Setup LinkDescriptor indices.
rDescr.m_nIndex0 = (sal_uInt16)(index0 & 0xffff);
rDescr.m_nIndex0 = static_cast<sal_uInt16>(index0 & 0xffff);
// Done.
return page::SCOPE_DIRECT;
......@@ -630,8 +630,8 @@ OStoreDirectoryPageObject::scope (
}
// Setup LinkDescriptor indices.
rDescr.m_nIndex0 = (sal_uInt16)(index0 & 0xffff);
rDescr.m_nIndex1 = (sal_uInt16)(index1 & 0xffff);
rDescr.m_nIndex0 = static_cast<sal_uInt16>(index0 & 0xffff);
rDescr.m_nIndex1 = static_cast<sal_uInt16>(index1 & 0xffff);
// Done.
return page::SCOPE_SINGLE;
......@@ -664,9 +664,9 @@ OStoreDirectoryPageObject::scope (
}
// Setup LinkDescriptor indices.
rDescr.m_nIndex0 = (sal_uInt16)(index0 & 0xffff);
rDescr.m_nIndex1 = (sal_uInt16)(index1 & 0xffff);
rDescr.m_nIndex2 = (sal_uInt16)(index2 & 0xffff);
rDescr.m_nIndex0 = static_cast<sal_uInt16>(index0 & 0xffff);
rDescr.m_nIndex1 = static_cast<sal_uInt16>(index1 & 0xffff);
rDescr.m_nIndex2 = static_cast<sal_uInt16>(index2 & 0xffff);
// Done.
return page::SCOPE_DOUBLE;
......@@ -704,10 +704,10 @@ OStoreDirectoryPageObject::scope (
}
// Setup LinkDescriptor indices.
rDescr.m_nIndex0 = (sal_uInt16)(index0 & 0xffff);
rDescr.m_nIndex1 = (sal_uInt16)(index1 & 0xffff);
rDescr.m_nIndex2 = (sal_uInt16)(index2 & 0xffff);
rDescr.m_nIndex3 = (sal_uInt16)(index3 & 0xffff);
rDescr.m_nIndex0 = static_cast<sal_uInt16>(index0 & 0xffff);
rDescr.m_nIndex1 = static_cast<sal_uInt16>(index1 & 0xffff);
rDescr.m_nIndex2 = static_cast<sal_uInt16>(index2 & 0xffff);
rDescr.m_nIndex3 = static_cast<sal_uInt16>(index3 & 0xffff);
// Done.
return page::SCOPE_TRIPLE;
......
......@@ -340,10 +340,10 @@ struct OStoreDirectoryDataBlock
/** Construction.
*/
LinkDescriptor()
: m_nIndex0 ((sal_uInt16)(~0)),
m_nIndex1 ((sal_uInt16)(~0)),
m_nIndex2 ((sal_uInt16)(~0)),
m_nIndex3 ((sal_uInt16)(~0))
: m_nIndex0 (sal_uInt16(~0)),
m_nIndex1 (sal_uInt16(~0)),
m_nIndex2 (sal_uInt16(~0)),
m_nIndex3 (sal_uInt16(~0))
{}
};
......@@ -417,7 +417,7 @@ struct OStoreDirectoryDataBlock
/** direct.
*/
static const sal_uInt16 directCount = (sal_uInt16)(STORE_LIMIT_DATAPAGE_DIRECT);
static const sal_uInt16 directCount = sal_uInt16(STORE_LIMIT_DATAPAGE_DIRECT);
sal_uInt32 directLink (sal_uInt16 nIndex) const
{
......@@ -434,7 +434,7 @@ struct OStoreDirectoryDataBlock
/** single.
*/
static const sal_uInt16 singleCount = (sal_uInt16)(STORE_LIMIT_DATAPAGE_SINGLE);
static const sal_uInt16 singleCount = sal_uInt16(STORE_LIMIT_DATAPAGE_SINGLE);
sal_uInt32 singleLink (sal_uInt16 nIndex) const
{
......@@ -451,7 +451,7 @@ struct OStoreDirectoryDataBlock
/** double.
*/
static const sal_uInt16 doubleCount = (sal_uInt16)(STORE_LIMIT_DATAPAGE_DOUBLE);
static const sal_uInt16 doubleCount = sal_uInt16(STORE_LIMIT_DATAPAGE_DOUBLE);
sal_uInt32 doubleLink (sal_uInt16 nIndex) const
{
......@@ -468,7 +468,7 @@ struct OStoreDirectoryDataBlock
/** triple.
*/
static const sal_uInt16 tripleCount = (sal_uInt16)(STORE_LIMIT_DATAPAGE_TRIPLE);
static const sal_uInt16 tripleCount = sal_uInt16(STORE_LIMIT_DATAPAGE_TRIPLE);
sal_uInt32 tripleLink (sal_uInt16 nIndex) const
{
......@@ -561,7 +561,7 @@ struct OStoreDirectoryPageData : public store::PageData
ChunkDescriptor (sal_uInt32 nPosition, sal_uInt16 nCapacity)
{
m_nPage = nPosition / nCapacity;
m_nOffset = (sal_uInt16)((nPosition % nCapacity) & 0xffff);
m_nOffset = static_cast<sal_uInt16>((nPosition % nCapacity) & 0xffff);
m_nLength = nCapacity - m_nOffset;
}
};
......
......@@ -265,7 +265,7 @@ storeError store_findFirst (
memset (pFindData, 0, sizeof (storeFindData));
// Find first.
pFindData->m_nReserved = (sal_uInt32)(~0);
pFindData->m_nReserved = sal_uInt32(~0);
return xDirectory->iterate (*pFindData);
}
......
......@@ -72,14 +72,14 @@ sal_uInt16 OStoreBTreeNodeData::find (const T& t) const
sal_Int32 const m = ((l + r) >> 1);
if (t.m_aKey == m_pData[m].m_aKey)
return (sal_uInt16)m;
return static_cast<sal_uInt16>(m);
if (t.m_aKey < m_pData[m].m_aKey)
r = m - 1;
else
l = m + 1;
}
sal_uInt16 const k = (sal_uInt16)r;
sal_uInt16 const k = static_cast<sal_uInt16>(r);
if ((k < capacityCount()) && (t.m_aKey < m_pData[k].m_aKey))
return k - 1;
else
......
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