From f462f7b8a341c3252edfd7b4808e99c8e72244c4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 28 Mar 2015 19:04:22 +0100 Subject: Clean up C-style casts from pointers to void Change-Id: I59b111341fc8153088882ac24322f714dc69417a --- i18npool/source/breakiterator/breakiterator_ctl.cxx | 4 ++-- i18npool/source/breakiterator/breakiterator_th.cxx | 4 ++-- i18npool/source/indexentry/indexentrysupplier_default.cxx | 2 +- i18npool/source/textconversion/genconv_dict.cxx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'i18npool/source') diff --git a/i18npool/source/breakiterator/breakiterator_ctl.cxx b/i18npool/source/breakiterator/breakiterator_ctl.cxx index 2f8703c9d038..8a4593238dd8 100644 --- a/i18npool/source/breakiterator/breakiterator_ctl.cxx +++ b/i18npool/source/breakiterator/breakiterator_ctl.cxx @@ -37,8 +37,8 @@ BreakIterator_CTL::BreakIterator_CTL() : { cBreakIterator = "com.sun.star.i18n.BreakIterator_CTL"; // to improve performance, alloc big enough memory in construct. - nextCellIndex = (sal_Int32*) calloc(cellIndexSize, sizeof(sal_Int32)); - previousCellIndex = (sal_Int32*) calloc(cellIndexSize, sizeof(sal_Int32)); + nextCellIndex = static_cast(calloc(cellIndexSize, sizeof(sal_Int32))); + previousCellIndex = static_cast(calloc(cellIndexSize, sizeof(sal_Int32))); } /** diff --git a/i18npool/source/breakiterator/breakiterator_th.cxx b/i18npool/source/breakiterator/breakiterator_th.cxx index e350fdce1c4c..17a51ea61924 100644 --- a/i18npool/source/breakiterator/breakiterator_th.cxx +++ b/i18npool/source/breakiterator/breakiterator_th.cxx @@ -112,8 +112,8 @@ void SAL_CALL BreakIterator_th::makeIndex(const OUString& Text, sal_Int32 nStart cellIndexSize = cachedText.getLength(); free(nextCellIndex); free(previousCellIndex); - nextCellIndex = (sal_Int32*) calloc(cellIndexSize, sizeof(sal_Int32)); - previousCellIndex = (sal_Int32*) calloc(cellIndexSize, sizeof(sal_Int32)); + nextCellIndex = static_cast(calloc(cellIndexSize, sizeof(sal_Int32))); + previousCellIndex = static_cast(calloc(cellIndexSize, sizeof(sal_Int32))); } // reset nextCell for new Text memset(nextCellIndex, 0, cellIndexSize * sizeof(sal_Int32)); diff --git a/i18npool/source/indexentry/indexentrysupplier_default.cxx b/i18npool/source/indexentry/indexentrysupplier_default.cxx index 56da33bc5784..7fccfb4e1cfd 100644 --- a/i18npool/source/indexentry/indexentrysupplier_default.cxx +++ b/i18npool/source/indexentry/indexentrysupplier_default.cxx @@ -93,7 +93,7 @@ void IndexTable::init(sal_Unicode start_, sal_Unicode end_, IndexKey *keys, sal_ { start=start_; end=end_; - table = (sal_uInt8*) malloc((end-start+1)*sizeof(sal_uInt8)); + table = static_cast(malloc((end-start+1)*sizeof(sal_uInt8))); for (sal_Unicode i = start; i <= end; i++) { sal_Int16 j; for (j = 0; j < key_count; j++) { diff --git a/i18npool/source/textconversion/genconv_dict.cxx b/i18npool/source/textconversion/genconv_dict.cxx index 2cde35accbbf..c7538ee25004 100644 --- a/i18npool/source/textconversion/genconv_dict.cxx +++ b/i18npool/source/textconversion/genconv_dict.cxx @@ -332,7 +332,7 @@ typedef struct { extern "C" { int Index_comp(const void* s1, const void* s2) { - Index *p1 = (Index*)s1, *p2 = (Index*)s2; + Index const *p1 = static_cast(s1), *p2 = static_cast(s2); int result = p1->len - p2->len; for (int i = 0; result == 0 && i < p1->len; i++) result = *(p1->data+i) - *(p2->data+i); -- cgit v1.2.3