diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-03 08:47:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-03 08:47:47 +0200 |
commit | 8de24d16520b8ae95d793f3c804f1fc7294afbe7 (patch) | |
tree | ae8181f4dcb58b3b1fd872b0786e358adce6090c /svl | |
parent | 164d8e3b1aa660d65c1af9570e67b66520bd953a (diff) |
Revert "remove unnecessary casts"
This reverts commit fa80dae9a79a7414af8adcb91bc04dfff13bbb63.
because current Clang master complains with
/home/noel/libo3/svl/source/items/itemset.cxx:189:26: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]
va_start( pArgs, nNull );
^
/home/noel/libo3/svl/source/items/itemset.cxx:176:89: note: parameter of type 'sal_uInt16' (aka 'unsigned short') is declared here
SfxItemSet::SfxItemSet(SfxItemPool& rPool, sal_uInt16 nWh1, sal_uInt16 nWh2, sal_uInt16 nNull, ...)
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/itemset.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index e47f3bef0a5f..d2388c3d40d9 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -173,7 +173,7 @@ void SfxItemSet::InitRanges_Impl(va_list pArgs, sal_uInt16 nWh1, sal_uInt16 nWh2 memset(static_cast<void*>(m_pItems), 0, sizeof(SfxPoolItem*) * nSize); } -SfxItemSet::SfxItemSet(SfxItemPool& rPool, sal_uInt16 nWh1, sal_uInt16 nWh2, sal_uInt16 nNull, ...) +SfxItemSet::SfxItemSet(SfxItemPool& rPool, int nWh1, int nWh2, int nNull, ...) : m_pPool( &rPool ) , m_pParent(nullptr) , m_pWhichRanges(nullptr) @@ -181,13 +181,17 @@ SfxItemSet::SfxItemSet(SfxItemPool& rPool, sal_uInt16 nWh1, sal_uInt16 nWh2, sal { assert(nWh1 <= nWh2); - if (nNull == 0) // delimiter - InitRanges_Impl(nWh1, nWh2); - else - { + if(!nNull) + InitRanges_Impl( + sal::static_int_cast< sal_uInt16 >(nWh1), + sal::static_int_cast< sal_uInt16 >(nWh2)); + else { va_list pArgs; va_start( pArgs, nNull ); - InitRanges_Impl(pArgs, nWh1, nWh2, nNull); + InitRanges_Impl( + pArgs, sal::static_int_cast< sal_uInt16 >(nWh1), + sal::static_int_cast< sal_uInt16 >(nWh2), + sal::static_int_cast< sal_uInt16 >(nNull)); va_end(pArgs); } } |