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

Clean up C-style casts from pointers to void

Change-Id: I59b111341fc8153088882ac24322f714dc69417a
üst 33815ec4
......@@ -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<sal_Int32*>(calloc(cellIndexSize, sizeof(sal_Int32)));
previousCellIndex = static_cast<sal_Int32*>(calloc(cellIndexSize, sizeof(sal_Int32)));
}
/**
......
......@@ -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<sal_Int32*>(calloc(cellIndexSize, sizeof(sal_Int32)));
previousCellIndex = static_cast<sal_Int32*>(calloc(cellIndexSize, sizeof(sal_Int32)));
}
// reset nextCell for new Text
memset(nextCellIndex, 0, cellIndexSize * sizeof(sal_Int32));
......
......@@ -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<sal_uInt8*>(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++) {
......
......@@ -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<Index const *>(s1), *p2 = static_cast<Index const *>(s2);
int result = p1->len - p2->len;
for (int i = 0; result == 0 && i < p1->len; i++)
result = *(p1->data+i) - *(p2->data+i);
......
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