[Libreoffice-commits] core.git: connectivity/source

Stephan Bergmann sbergman at redhat.com
Sun Mar 29 12:29:01 PDT 2015


 connectivity/source/drivers/macab/MacabAddressBook.cxx       |    2 
 connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx  |    2 
 connectivity/source/drivers/macab/MacabDriver.cxx            |    2 
 connectivity/source/drivers/macab/MacabGroup.cxx             |    6 -
 connectivity/source/drivers/macab/MacabHeader.cxx            |    6 -
 connectivity/source/drivers/macab/MacabPreparedStatement.cxx |    2 
 connectivity/source/drivers/macab/MacabRecord.cxx            |   24 ++--
 connectivity/source/drivers/macab/MacabRecords.cxx           |   58 +++++------
 connectivity/source/drivers/macab/MacabResultSet.cxx         |   24 ++--
 9 files changed, 63 insertions(+), 63 deletions(-)

New commits:
commit b9446cd44397ef09db75eb2f2425421d2baaf9b3
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sun Mar 29 21:28:27 2015 +0200

    loplugin:cstylecast
    
    Change-Id: I20b7936d2bb11363a701ca649deba31d53c76868

diff --git a/connectivity/source/drivers/macab/MacabAddressBook.cxx b/connectivity/source/drivers/macab/MacabAddressBook.cxx
index 47b35b1..9a34dd1 100644
--- a/connectivity/source/drivers/macab/MacabAddressBook.cxx
+++ b/connectivity/source/drivers/macab/MacabAddressBook.cxx
@@ -140,7 +140,7 @@ MacabRecords *MacabAddressBook::getMacabRecordsMatch(const OUString& _tableName)
         /* Go through each group and create a MacabGroup out of it. */
         for(i = 0; i < nGroups; i++)
         {
-            xGroup = (ABGroupRef) CFArrayGetValueAtIndex(allGroups, i);
+            xGroup = static_cast<ABGroupRef>(const_cast<void *>(CFArrayGetValueAtIndex(allGroups, i)));
             m_xMacabGroups[i] = new MacabGroup(m_aAddressBook, m_xMacabRecords, xGroup);
         }
 
diff --git a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx
index 499626a..c079854 100644
--- a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx
@@ -910,7 +910,7 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getColumns(
                 ++aField, ++nPosition)
         {
 
-            sName = CFStringToOUString((CFStringRef) (*aField)->value);
+            sName = CFStringToOUString(static_cast<CFStringRef>((*aField)->value));
             if (match(columnNamePattern, sName, '\0'))
             {
                 aRow[4] = new ORowSetValueDecorator(sName);
diff --git a/connectivity/source/drivers/macab/MacabDriver.cxx b/connectivity/source/drivers/macab/MacabDriver.cxx
index 290e3e4..b601e75 100644
--- a/connectivity/source/drivers/macab/MacabDriver.cxx
+++ b/connectivity/source/drivers/macab/MacabDriver.cxx
@@ -66,7 +66,7 @@ namespace
         {
 
             const OUString sSymbolName = OUString::createFromAscii( _pAsciiSymbolName );
-            _rFunction = (FUNCTION)( osl_getSymbol( _rModule, sSymbolName.pData ) );
+            _rFunction = reinterpret_cast<FUNCTION>( osl_getSymbol( _rModule, sSymbolName.pData ) );
 
             if ( !_rFunction )
             {   // did not find the symbol
diff --git a/connectivity/source/drivers/macab/MacabGroup.cxx b/connectivity/source/drivers/macab/MacabGroup.cxx
index cfd9825..715896c 100644
--- a/connectivity/source/drivers/macab/MacabGroup.cxx
+++ b/connectivity/source/drivers/macab/MacabGroup.cxx
@@ -43,7 +43,7 @@ MacabGroup::MacabGroup(const ABAddressBookRef _addressBook, const MacabRecords *
 
     // Set the group's name (stored in MacabRecords as m_sName)
     CFStringRef sGroupName;
-    sGroupName = (CFStringRef) ABRecordCopyValue(_xGroup, kABGroupNameProperty);
+    sGroupName = static_cast<CFStringRef>(ABRecordCopyValue(_xGroup, kABGroupNameProperty));
     m_sName = CFStringToOUString(sGroupName);
     CFRelease(sGroupName);
 
@@ -60,10 +60,10 @@ MacabGroup::MacabGroup(const ABAddressBookRef _addressBook, const MacabRecords *
     nAllRecordsSize = _allRecords->size();
     for(i = 0; i < recordsSize; i++)
     {
-        xPerson = (ABPersonRef) CFArrayGetValueAtIndex(xGroupMembers,i);
+        xPerson = static_cast<ABPersonRef>(const_cast<void *>(CFArrayGetValueAtIndex(xGroupMembers,i)));
         if(xPerson != NULL)
         {
-            sGroupMemberUID = (CFStringRef) ABRecordCopyValue(xPerson, kABUIDProperty);
+            sGroupMemberUID = static_cast<CFStringRef>(ABRecordCopyValue(xPerson, kABUIDProperty));
             if(sGroupMemberUID != NULL)
             {
                 bFound = false;
diff --git a/connectivity/source/drivers/macab/MacabHeader.cxx b/connectivity/source/drivers/macab/MacabHeader.cxx
index e4c1d38..a639c4a 100644
--- a/connectivity/source/drivers/macab/MacabHeader.cxx
+++ b/connectivity/source/drivers/macab/MacabHeader.cxx
@@ -150,7 +150,7 @@ OUString MacabHeader::getString(const sal_Int32 i) const
             return OUString();
         try
         {
-            nRet = CFStringToOUString( (CFStringRef) fields[i]->value);
+            nRet = CFStringToOUString(static_cast<CFStringRef>(fields[i]->value));
         }
         catch(...){ }
     }
@@ -256,8 +256,8 @@ sal_Int32 MacabHeader::compareFields(const macabfield *_field1, const macabfield
         return -1;
 
     CFComparisonResult result = CFStringCompare(
-        (CFStringRef) _field1->value,
-        (CFStringRef) _field2->value,
+        static_cast<CFStringRef>(_field1->value),
+        static_cast<CFStringRef>(_field2->value),
         0); // 0 = no options (like ignore case)
 
     return (sal_Int32) result;
diff --git a/connectivity/source/drivers/macab/MacabPreparedStatement.cxx b/connectivity/source/drivers/macab/MacabPreparedStatement.cxx
index edeec20..2c6a96b 100644
--- a/connectivity/source/drivers/macab/MacabPreparedStatement.cxx
+++ b/connectivity/source/drivers/macab/MacabPreparedStatement.cxx
@@ -75,7 +75,7 @@ void MacabPreparedStatement::getNextParameter(OUString &rParameter) const throw(
         const OUString sError( aResources.getResourceString(
                 STR_INVALID_PARA_COUNT
              ) );
-        ::dbtools::throwGenericSQLException(sError,*(MacabPreparedStatement *) this);
+        ::dbtools::throwGenericSQLException(sError,*const_cast<MacabPreparedStatement *>(this));
     }
 
     rParameter = (m_aParameterRow->get())[m_nParameterIndex];
diff --git a/connectivity/source/drivers/macab/MacabRecord.cxx b/connectivity/source/drivers/macab/MacabRecord.cxx
index e67a66e..51b150b 100644
--- a/connectivity/source/drivers/macab/MacabRecord.cxx
+++ b/connectivity/source/drivers/macab/MacabRecord.cxx
@@ -190,23 +190,23 @@ sal_Int32 MacabRecord::compareFields(const macabfield *_field1, const macabfield
     {
         case kABStringProperty:
             result = CFStringCompare(
-                (CFStringRef) _field1->value,
-                (CFStringRef) _field2->value,
+                static_cast<CFStringRef>(_field1->value),
+                static_cast<CFStringRef>(_field2->value),
                 kCFCompareLocalized); // Specifies that the comparison should take into account differences related to locale, such as the thousands separator character.
             break;
 
         case kABDateProperty:
             result = CFDateCompare(
-                (CFDateRef) _field1->value,
-                (CFDateRef) _field2->value,
+                static_cast<CFDateRef>(_field1->value),
+                static_cast<CFDateRef>(_field2->value),
                 NULL); // NULL = unused variable
             break;
 
         case kABIntegerProperty:
         case kABRealProperty:
             result = CFNumberCompare(
-                (CFNumberRef) _field1->value,
-                (CFNumberRef) _field2->value,
+                static_cast<CFNumberRef>(_field1->value),
+                static_cast<CFNumberRef>(_field2->value),
                 NULL); // NULL = unused variable
         break;
 
@@ -301,30 +301,30 @@ OUString MacabRecord::fieldToString(const macabfield *_aField)
     switch(_aField->type)
     {
         case kABStringProperty:
-            fieldString = CFStringToOUString((CFStringRef) _aField->value);
+            fieldString = CFStringToOUString(static_cast<CFStringRef>(_aField->value));
             break;
         case kABDateProperty:
             {
-                DateTime aTime = CFDateToDateTime((CFDateRef) _aField->value);
+                DateTime aTime = CFDateToDateTime(static_cast<CFDateRef>(_aField->value));
                 fieldString = DBTypeConversion::toDateTimeString(aTime);
             }
             break;
         case kABIntegerProperty:
             {
-                CFNumberType numberType = CFNumberGetType( (CFNumberRef) _aField->value );
+                CFNumberType numberType = CFNumberGetType( static_cast<CFNumberRef>(_aField->value) );
                 sal_Int64 nVal;
                 // Should we check for the wrong type here, e.g., a float?
-                bool m_bSuccess = !CFNumberGetValue((CFNumberRef) _aField->value, numberType, &nVal);
+                bool m_bSuccess = !CFNumberGetValue(static_cast<CFNumberRef>(_aField->value), numberType, &nVal);
                 if(m_bSuccess)
                     fieldString = OUString::number(nVal);
             }
             break;
         case kABRealProperty:
             {
-                CFNumberType numberType = CFNumberGetType( (CFNumberRef) _aField->value );
+                CFNumberType numberType = CFNumberGetType( static_cast<CFNumberRef>(_aField->value) );
                 double nVal;
                 // Should we check for the wrong type here, e.g., an int?
-                bool m_bSuccess = !CFNumberGetValue((CFNumberRef) _aField->value, numberType, &nVal);
+                bool m_bSuccess = !CFNumberGetValue(static_cast<CFNumberRef>(_aField->value), numberType, &nVal);
                 if(m_bSuccess)
                     fieldString = OUString::number(nVal);
             }
diff --git a/connectivity/source/drivers/macab/MacabRecords.cxx b/connectivity/source/drivers/macab/MacabRecords.cxx
index 4e663ba..bd374a1 100644
--- a/connectivity/source/drivers/macab/MacabRecords.cxx
+++ b/connectivity/source/drivers/macab/MacabRecords.cxx
@@ -137,7 +137,7 @@ void MacabRecords::initialize()
     /* Then, we create each of the records... */
     for(i = 0; i < recordsSize; i++)
     {
-        record = (ABRecordRef) CFArrayGetValueAtIndex(allRecords, i);
+        record = const_cast<ABRecordRef>(CFArrayGetValueAtIndex(allRecords, i));
         records[i] = createMacabRecord(record, header, recordType);
     }
     currentRecord = recordsSize;
@@ -377,7 +377,7 @@ MacabHeader *MacabRecords::createHeaderForRecordType(const CFArrayRef _records,
     /* Determine the non-required properties... */
     for(i = 0; i < numProperties; i++)
     {
-        property = (CFStringRef) CFArrayGetValueAtIndex(allProperties, i);
+        property = static_cast<CFStringRef>(CFArrayGetValueAtIndex(allProperties, i));
         bFoundProperty = false;
         for(j = 0; j < numRequiredProperties; j++)
         {
@@ -425,7 +425,7 @@ MacabHeader *MacabRecords::createHeaderForRecordType(const CFArrayRef _records,
              */
             for(j = 0; j < numRecords; j++)
             {
-                record = (ABRecordRef) CFArrayGetValueAtIndex(_records, j);
+                record = const_cast<ABRecordRef>(CFArrayGetValueAtIndex(_records, j));
                 headerDataForProperty = createHeaderForProperty(record,requiredProperties[i],_recordType,true);
                 if(headerDataForProperty != NULL)
                 {
@@ -445,7 +445,7 @@ MacabHeader *MacabRecords::createHeaderForRecordType(const CFArrayRef _records,
     /* And now, non-required properties... */
     for(i = 0; i < numRecords; i++)
     {
-        record = (ABRecordRef) CFArrayGetValueAtIndex(_records, i);
+        record = const_cast<ABRecordRef>(CFArrayGetValueAtIndex(_records, i));
 
         for(j = 0; j < numNonRequiredProperties; j++)
         {
@@ -536,12 +536,12 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
             {
             sal_Int32 i;
 
-            sal_Int32 multiLength = ABMultiValueCount((ABMutableMultiValueRef) _propertyValue);
+            sal_Int32 multiLength = ABMultiValueCount(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue)));
             CFStringRef multiLabel, localizedMultiLabel;
             OUString multiLabelString;
             OUString multiPropertyString;
             OUString headerNameString;
-            ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType((ABMutableMultiValueRef) _propertyValue) - 0x100);
+            ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100);
 
             length = multiLength;
             headerNames = new macabfield *[multiLength];
@@ -552,7 +552,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
              */
             for(i = 0; i < multiLength; i++)
             {
-                multiLabel = ABMultiValueCopyLabelAtIndex((ABMutableMultiValueRef) _propertyValue, i);
+                multiLabel = ABMultiValueCopyLabelAtIndex(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue)), i);
                 localizedMultiLabel = ABCopyLocalizedPropertyOrLabel(multiLabel);
                 multiLabelString = CFStringToOUString(localizedMultiLabel);
                 CFRelease(multiLabel);
@@ -576,7 +576,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
                 sal_Int32 i,j,k;
 
                 // Total number of multi-array or multi-dictionary elements.
-                sal_Int32 multiLengthFirstLevel = ABMultiValueCount((ABMutableMultiValueRef) _propertyValue);
+                sal_Int32 multiLengthFirstLevel = ABMultiValueCount(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue)));
 
                 /* Total length, including the length of each element (e.g., if
                  * this multi-dictionary contains three dictionaries, and each
@@ -590,7 +590,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
                 OUString multiLabelString;
                 OUString multiPropertyString;
                 MacabHeader **multiHeaders = new MacabHeader *[multiLengthFirstLevel];
-                ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType((ABMutableMultiValueRef) _propertyValue) - 0x100);
+                ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100);
 
                 multiPropertyString = CFStringToOUString(_propertyName);
 
@@ -603,8 +603,8 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
                 for(i = 0; i < multiLengthFirstLevel; i++)
                 {
                     /* label */
-                    multiLabel = ABMultiValueCopyLabelAtIndex((ABMutableMultiValueRef) _propertyValue, i);
-                    multiValue = ABMultiValueCopyValueAtIndex((ABMutableMultiValueRef) _propertyValue, i);
+                    multiLabel = ABMultiValueCopyLabelAtIndex(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue)), i);
+                    multiValue = ABMultiValueCopyValueAtIndex(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue)), i);
                     if(multiValue && multiLabel)
                     {
                         localizedMultiLabel = ABCopyLocalizedPropertyOrLabel(multiLabel);
@@ -658,7 +658,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
             if(_propertyValue != NULL)
             {
             /* Assume all keys are strings */
-            sal_Int32 numRecords = (sal_Int32) CFDictionaryGetCount((CFDictionaryRef) _propertyValue);
+            sal_Int32 numRecords = (sal_Int32) CFDictionaryGetCount(static_cast<CFDictionaryRef>(_propertyValue));
 
             /* The only method for getting info out of a CFDictionary, of both
              * keys and values, is to all of them all at once, so these
@@ -675,9 +675,9 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
             CFStringRef dictLabel, localizedDictKey;
 
             /* Get the keys and values */
-            dictKeys = (CFStringRef *) malloc(sizeof(CFStringRef)*numRecords);
-            dictValues = (CFTypeRef *) malloc(sizeof(CFTypeRef)*numRecords);
-            CFDictionaryGetKeysAndValues((CFDictionaryRef) _propertyValue, reinterpret_cast<const void **>(dictKeys), (const void **) dictValues);
+            dictKeys = static_cast<CFStringRef *>(malloc(sizeof(CFStringRef)*numRecords));
+            dictValues = static_cast<CFTypeRef *>(malloc(sizeof(CFTypeRef)*numRecords));
+            CFDictionaryGetKeysAndValues(static_cast<CFDictionaryRef>(_propertyValue), reinterpret_cast<const void **>(dictKeys), (const void **) dictValues);
 
             propertyNameString = CFStringToOUString(_propertyName);
 
@@ -738,7 +738,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
              */
             if(_propertyValue != NULL)
             {
-                sal_Int32 arrLength = (sal_Int32) CFArrayGetCount( (CFArrayRef) _propertyValue);
+                sal_Int32 arrLength = (sal_Int32) CFArrayGetCount(static_cast<CFArrayRef>(_propertyValue));
                 sal_Int32 i,j,k;
                 CFTypeRef arrValue;
                 ABPropertyType arrType;
@@ -759,7 +759,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
                  */
                 for(i = 0; i < arrLength; i++)
                 {
-                    arrValue = (CFTypeRef) CFArrayGetValueAtIndex( (CFArrayRef) _propertyValue, i);
+                    arrValue = (CFTypeRef) CFArrayGetValueAtIndex(static_cast<CFArrayRef>(_propertyValue), i);
                     arrType = (ABPropertyType) getABTypeFromCFType( CFGetTypeID(arrValue) );
                     arrLabelString = propertyNameString + OUString::number(i);
                     arrLabel = OUStringToCFString(arrLabelString);
@@ -834,7 +834,7 @@ void MacabRecords::manageDuplicateHeaders(macabfield **_headerNames, const sal_I
         if(count != 1)
         {
             // There is probably a better way to do this...
-            OUString newName = CFStringToOUString((CFStringRef) _headerNames[i]->value);
+            OUString newName = CFStringToOUString(static_cast<CFStringRef>(_headerNames[i]->value));
             CFRelease(_headerNames[i]->value);
             newName += " (" + OUString::number(count) + ")";
             _headerNames[i]->value = OUStringToCFString(newName);
@@ -869,7 +869,7 @@ MacabRecord *MacabRecords::createMacabRecord(const ABRecordRef _abrecord, const
     OUString propertyNameString;
     for(i = 0; i < numProperties; i++)
     {
-        propertyName = (CFStringRef) CFArrayGetValueAtIndex(recordProperties, i);
+        propertyName = static_cast<CFStringRef>(CFArrayGetValueAtIndex(recordProperties, i));
         localizedPropertyName = ABCopyLocalizedPropertyOrLabel(propertyName);
         propertyNameString = CFStringToOUString(localizedPropertyName);
         CFRelease(localizedPropertyName);
@@ -977,14 +977,14 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT
                  * is go through the array, and rerun this method recursively
                  * on each element.
                  */
-                sal_Int32 arrLength = (sal_Int32) CFArrayGetCount( (CFArrayRef) _propertyValue);
+                sal_Int32 arrLength = (sal_Int32) CFArrayGetCount(static_cast<CFArrayRef>(_propertyValue));
                 sal_Int32 i;
                 OUString newPropertyName;
 
                 /* Going through each element... */
                 for(i = 0; i < arrLength; i++)
                 {
-                    const void *arrValue = CFArrayGetValueAtIndex( (CFArrayRef) _propertyValue, i);
+                    const void *arrValue = CFArrayGetValueAtIndex(static_cast<CFArrayRef>(_propertyValue), i);
                     newPropertyName = _propertyName + OUString::number(i);
                     insertPropertyIntoMacabRecord(_abrecord, _header, newPropertyName, arrValue);
                     CFRelease(arrValue);
@@ -1006,7 +1006,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT
                  * we hit a scalar value.
                  */
 
-                sal_Int32 numRecords = (sal_Int32) CFDictionaryGetCount((CFDictionaryRef) _propertyValue);
+                sal_Int32 numRecords = (sal_Int32) CFDictionaryGetCount(static_cast<CFDictionaryRef>(_propertyValue));
                 OUString dictKeyString;
                 sal_Int32 i;
                 OUString newPropertyName;
@@ -1018,9 +1018,9 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT
                 CFStringRef *dictKeys;
                 CFStringRef localizedDictKey;
                 CFTypeRef *dictValues;
-                dictKeys = (CFStringRef *) malloc(sizeof(CFStringRef)*numRecords);
-                dictValues = (CFTypeRef *) malloc(sizeof(CFTypeRef)*numRecords);
-                CFDictionaryGetKeysAndValues((CFDictionaryRef) _propertyValue, reinterpret_cast<const void **>(dictKeys), (const void **) dictValues);
+                dictKeys = static_cast<CFStringRef *>(malloc(sizeof(CFStringRef)*numRecords));
+                dictValues = static_cast<CFTypeRef *>(malloc(sizeof(CFTypeRef)*numRecords));
+                CFDictionaryGetKeysAndValues(static_cast<CFDictionaryRef>(_propertyValue), reinterpret_cast<const void **>(dictKeys), (const void **) dictValues);
 
                 /* Going through each element... */
                 for(i = 0; i < numRecords; i++)
@@ -1056,18 +1056,18 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT
                  */
 
                 sal_Int32 i;
-                sal_Int32 multiLength = ABMultiValueCount((ABMutableMultiValueRef) _propertyValue);
+                sal_Int32 multiLength = ABMultiValueCount(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue)));
                 CFStringRef multiLabel, localizedMultiLabel;
                 CFTypeRef multiValue;
                 OUString multiLabelString, newPropertyName;
-                ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType((ABMutableMultiValueRef) _propertyValue) - 0x100);
+                ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100);
 
                 /* Go through each element... */
                 for(i = 0; i < multiLength; i++)
                 {
                     /* Label and value */
-                    multiLabel = ABMultiValueCopyLabelAtIndex((ABMutableMultiValueRef) _propertyValue, i);
-                    multiValue = ABMultiValueCopyValueAtIndex((ABMutableMultiValueRef) _propertyValue, i);
+                    multiLabel = ABMultiValueCopyLabelAtIndex(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue)), i);
+                    multiValue = ABMultiValueCopyValueAtIndex(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue)), i);
 
                     localizedMultiLabel = ABCopyLocalizedPropertyOrLabel(multiLabel);
                     multiLabelString = CFStringToOUString(localizedMultiLabel);
diff --git a/connectivity/source/drivers/macab/MacabResultSet.cxx b/connectivity/source/drivers/macab/MacabResultSet.cxx
index 73dd60d..bf544e1 100644
--- a/connectivity/source/drivers/macab/MacabResultSet.cxx
+++ b/connectivity/source/drivers/macab/MacabResultSet.cxx
@@ -219,7 +219,7 @@ OUString SAL_CALL MacabResultSet::getString(sal_Int32 columnIndex) throw(SQLExce
         {
             if(aField->type == kABStringProperty)
             {
-                aRet = CFStringToOUString( (CFStringRef) aField->value);
+                aRet = CFStringToOUString(static_cast<CFStringRef>(aField->value));
                 m_bWasNull = false;
             }
         }
@@ -278,10 +278,10 @@ sal_Int32 SAL_CALL MacabResultSet::getInt(sal_Int32 columnIndex) throw(SQLExcept
         {
             if(aField->type == kABIntegerProperty)
             {
-                CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
+                CFNumberType numberType = CFNumberGetType( static_cast<CFNumberRef>(aField->value) );
                 // m_bWasNull now becomes whether getting the value was successful
                 // Should we check for the wrong type here, e.g., a float or a 64 bit int?
-                m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nRet);
+                m_bWasNull = !CFNumberGetValue(static_cast<CFNumberRef>(aField->value), numberType, &nRet);
             }
         }
     }
@@ -307,10 +307,10 @@ sal_Int64 SAL_CALL MacabResultSet::getLong(sal_Int32 columnIndex) throw(SQLExcep
         {
             if(aField->type == kABIntegerProperty)
             {
-                CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
+                CFNumberType numberType = CFNumberGetType( static_cast<CFNumberRef>(aField->value) );
                 // m_bWasNull now becomes whether getting the value was successful
                 // Should we check for the wrong type here, e.g., a float or a 32 bit int?
-                m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nRet);
+                m_bWasNull = !CFNumberGetValue(static_cast<CFNumberRef>(aField->value), numberType, &nRet);
             }
         }
     }
@@ -336,10 +336,10 @@ float SAL_CALL MacabResultSet::getFloat(sal_Int32 columnIndex) throw(SQLExceptio
         {
             if(aField->type == kABRealProperty)
             {
-                CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
+                CFNumberType numberType = CFNumberGetType( static_cast<CFNumberRef>(aField->value) );
                 // m_bWasNull now becomes whether getting the value was successful
                 // Should we check for the wrong type here, e.g., an int or a double?
-                m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nVal);
+                m_bWasNull = !CFNumberGetValue(static_cast<CFNumberRef>(aField->value), numberType, &nVal);
             }
         }
     }
@@ -365,10 +365,10 @@ double SAL_CALL MacabResultSet::getDouble(sal_Int32 columnIndex) throw(SQLExcept
         {
             if(aField->type == kABRealProperty)
             {
-                CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
+                CFNumberType numberType = CFNumberGetType( static_cast<CFNumberRef>(aField->value) );
                 // m_bWasNull now becomes whether getting the value was successful
                 // Should we check for the wrong type here, e.g., an int or a float?
-                m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nVal);
+                m_bWasNull = !CFNumberGetValue(static_cast<CFNumberRef>(aField->value), numberType, &nVal);
             }
         }
     }
@@ -426,7 +426,7 @@ DateTime SAL_CALL MacabResultSet::getTimestamp(sal_Int32 columnIndex) throw(SQLE
         {
             if(aField->type == kABDateProperty)
             {
-                nRet = CFDateToDateTime((CFDateRef) aField->value);
+                nRet = CFDateToDateTime(static_cast<CFDateRef>(aField->value));
                 m_bWasNull = false;
             }
         }
@@ -885,7 +885,7 @@ Any SAL_CALL MacabResultSet::getBookmark() throw( SQLException,  RuntimeExceptio
         {
             if(uidField->type == kABStringProperty)
             {
-                return makeAny(CFStringToOUString( (CFStringRef) uidField->value ));
+                return makeAny(CFStringToOUString( static_cast<CFStringRef>(uidField->value) ));
             }
         }
     }
@@ -907,7 +907,7 @@ sal_Bool SAL_CALL MacabResultSet::moveToBookmark(const  Any& bookmark) throw( SQ
         {
             if(uidField->type == kABStringProperty)
             {
-                OUString sUniqueIdentifier = CFStringToOUString( (CFStringRef) uidField->value );
+                OUString sUniqueIdentifier = CFStringToOUString( static_cast<CFStringRef>(uidField->value) );
                 if (sUniqueIdentifier == sBookmark)
                 {
                     m_nRowPos = nRow;


More information about the Libreoffice-commits mailing list