summaryrefslogtreecommitdiffstats
path: root/connectivity/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-19 17:45:53 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-20 10:45:48 +0100
commitfc528a468061e165ee29f0ca450245331da3ef93 (patch)
tree150188c8939379c0134cc827ad94e2225cb8d4a8 /connectivity/source
parentRemove dubious test (diff)
downloadcore-fc528a468061e165ee29f0ca450245331da3ef93.tar.gz
core-fc528a468061e165ee29f0ca450245331da3ef93.zip
More loplugin:cstylecast on macOS
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More loplugin:cstylecast" Change-Id: Iff4877e8a42804c952c48c13332caf0a83c92870 Reviewed-on: https://gerrit.libreoffice.org/48216 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'connectivity/source')
-rw-r--r--connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx28
-rw-r--r--connectivity/source/drivers/macab/MacabGroup.cxx2
-rw-r--r--connectivity/source/drivers/macab/MacabHeader.cxx2
-rw-r--r--connectivity/source/drivers/macab/MacabPreparedStatement.cxx4
-rw-r--r--connectivity/source/drivers/macab/MacabRecord.cxx4
-rw-r--r--connectivity/source/drivers/macab/MacabRecords.cxx24
-rw-r--r--connectivity/source/drivers/macab/MacabResultSetMetaData.cxx2
-rw-r--r--connectivity/source/drivers/odbc/OConnection.cxx4
8 files changed, 35 insertions, 35 deletions
diff --git a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx
index 635b929c2106..cda96cdcbf4e 100644
--- a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx
@@ -770,13 +770,13 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTypeInfo( )
aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue();
aRow[1] = new ORowSetValueDecorator(OUString("CHAR"));
aRow[2] = new ORowSetValueDecorator(DataType::CHAR);
- aRow[3] = new ORowSetValueDecorator((sal_Int32) 254);
+ aRow[3] = new ORowSetValueDecorator(sal_Int32(254));
aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
aRow[6] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[7] = new ORowSetValueDecorator((sal_Int32) ColumnValue::NULLABLE);
+ aRow[7] = new ORowSetValueDecorator(sal_Int32(ColumnValue::NULLABLE));
aRow[8] = ODatabaseMetaDataResultSet::get1Value();
- aRow[9] = new ORowSetValueDecorator((sal_Int32) ColumnSearch::CHAR);
+ aRow[9] = new ORowSetValueDecorator(sal_Int32(ColumnSearch::CHAR));
aRow[10] = ODatabaseMetaDataResultSet::get1Value();
aRow[11] = ODatabaseMetaDataResultSet::get0Value();
aRow[12] = ODatabaseMetaDataResultSet::get0Value();
@@ -785,27 +785,27 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTypeInfo( )
aRow[15] = ODatabaseMetaDataResultSet::get0Value();
aRow[16] = ODatabaseMetaDataResultSet::getEmptyValue();
aRow[17] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[18] = new ORowSetValueDecorator((sal_Int32) 10);
+ aRow[18] = new ORowSetValueDecorator(sal_Int32(10));
aRows.push_back(aRow);
aRow[1] = new ORowSetValueDecorator(OUString("TIMESTAMP"));
aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)19);
+ aRow[3] = new ORowSetValueDecorator(sal_Int32(19));
aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
aRows.push_back(aRow);
aRow[1] = new ORowSetValueDecorator(OUString("INTEGER"));
aRow[2] = new ORowSetValueDecorator(DataType::INTEGER);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[15] = new ORowSetValueDecorator((sal_Int32)20);
+ aRow[3] = new ORowSetValueDecorator(sal_Int32(20));
+ aRow[15] = new ORowSetValueDecorator(sal_Int32(20));
aRows.push_back(aRow);
aRow[1] = new ORowSetValueDecorator(OUString("FLOAT"));
aRow[2] = new ORowSetValueDecorator(DataType::FLOAT);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[15] = new ORowSetValueDecorator((sal_Int32)15);
+ aRow[3] = new ORowSetValueDecorator(sal_Int32(20));
+ aRow[15] = new ORowSetValueDecorator(sal_Int32(15));
aRows.push_back(aRow);
}
pResult->setRows(aRows);
@@ -856,13 +856,13 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getColumns(
aRow[3] = new ORowSetValueDecorator(sTableName);
aRow[8] = ODatabaseMetaDataResultSet::getEmptyValue();
aRow[9] = ODatabaseMetaDataResultSet::get0Value();
- aRow[10] = new ORowSetValueDecorator((sal_Int32) 10);
+ aRow[10] = new ORowSetValueDecorator(sal_Int32(10));
aRow[11] = ODatabaseMetaDataResultSet::get1Value();
aRow[12] = ODatabaseMetaDataResultSet::getEmptyValue();
aRow[13] = ODatabaseMetaDataResultSet::getEmptyValue();
aRow[14] = ODatabaseMetaDataResultSet::getEmptyValue();
aRow[15] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[16] = new ORowSetValueDecorator((sal_Int32) 254);
+ aRow[16] = new ORowSetValueDecorator(sal_Int32(254));
aRow[18] = new ORowSetValueDecorator(OUString("YES"));
sal_Int32 nPosition = 1;
@@ -885,7 +885,7 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getColumns(
case kABStringProperty:
aRow[5] = new ORowSetValueDecorator(DataType::CHAR);
aRow[6] = new ORowSetValueDecorator(OUString("CHAR"));
- aRow[7] = new ORowSetValueDecorator((sal_Int32) 256);
+ aRow[7] = new ORowSetValueDecorator(sal_Int32(256));
aRows.push_back(aRow);
break;
case kABDateProperty:
@@ -896,13 +896,13 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getColumns(
case kABIntegerProperty:
aRow[5] = new ORowSetValueDecorator(DataType::INTEGER);
aRow[6] = new ORowSetValueDecorator(OUString("INTEGER"));
- aRow[7] = new ORowSetValueDecorator((sal_Int32) 20);
+ aRow[7] = new ORowSetValueDecorator(sal_Int32(20));
aRows.push_back(aRow);
break;
case kABRealProperty:
aRow[5] = new ORowSetValueDecorator(DataType::FLOAT);
aRow[6] = new ORowSetValueDecorator(OUString("FLOAT"));
- aRow[7] = new ORowSetValueDecorator((sal_Int32) 15);
+ aRow[7] = new ORowSetValueDecorator(sal_Int32(15));
aRows.push_back(aRow);
break;
default:
diff --git a/connectivity/source/drivers/macab/MacabGroup.cxx b/connectivity/source/drivers/macab/MacabGroup.cxx
index d963d64a7e2d..f4217b018aac 100644
--- a/connectivity/source/drivers/macab/MacabGroup.cxx
+++ b/connectivity/source/drivers/macab/MacabGroup.cxx
@@ -48,7 +48,7 @@ MacabGroup::MacabGroup(const ABAddressBookRef _addressBook, const MacabRecords *
CFRelease(sGroupName);
// The _group's_ records (remember MacabGroup inherits from MacabRecords)
- recordsSize = (sal_Int32) CFArrayGetCount(xGroupMembers);
+ recordsSize = static_cast<sal_Int32>(CFArrayGetCount(xGroupMembers));
records = new MacabRecord *[recordsSize];
setHeader(_allRecords->getHeader());
diff --git a/connectivity/source/drivers/macab/MacabHeader.cxx b/connectivity/source/drivers/macab/MacabHeader.cxx
index a674dad8f359..8c37dd7fa147 100644
--- a/connectivity/source/drivers/macab/MacabHeader.cxx
+++ b/connectivity/source/drivers/macab/MacabHeader.cxx
@@ -260,7 +260,7 @@ sal_Int32 MacabHeader::compareFields(const macabfield *_field1, const macabfield
static_cast<CFStringRef>(_field2->value),
0); // 0 = no options (like ignore case)
- return (sal_Int32) result;
+ return static_cast<sal_Int32>(result);
}
diff --git a/connectivity/source/drivers/macab/MacabPreparedStatement.cxx b/connectivity/source/drivers/macab/MacabPreparedStatement.cxx
index 549d94d3d863..102dcae458c9 100644
--- a/connectivity/source/drivers/macab/MacabPreparedStatement.cxx
+++ b/connectivity/source/drivers/macab/MacabPreparedStatement.cxx
@@ -42,7 +42,7 @@ void MacabPreparedStatement::checkAndResizeParameters(sal_Int32 nParams)
if (nParams < 1)
::dbtools::throwInvalidIndexException(*this);
- if (nParams >= (sal_Int32) m_aParameterRow->get().size())
+ if (nParams >= static_cast<sal_Int32>(m_aParameterRow->get().size()))
m_aParameterRow->get().resize(nParams);
}
@@ -69,7 +69,7 @@ void MacabPreparedStatement::resetParameters() const
void MacabPreparedStatement::getNextParameter(OUString &rParameter) const
{
- if (m_nParameterIndex >= (sal_Int32) m_aParameterRow->get().size())
+ if (m_nParameterIndex >= static_cast<sal_Int32>(m_aParameterRow->get().size()))
{
::connectivity::SharedResources aResources;
const OUString sError( aResources.getResourceString(
diff --git a/connectivity/source/drivers/macab/MacabRecord.cxx b/connectivity/source/drivers/macab/MacabRecord.cxx
index f4e9a8c65341..0df2588bf67d 100644
--- a/connectivity/source/drivers/macab/MacabRecord.cxx
+++ b/connectivity/source/drivers/macab/MacabRecord.cxx
@@ -214,7 +214,7 @@ sal_Int32 MacabRecord::compareFields(const macabfield *_field1, const macabfield
result = kCFCompareEqualTo; // can't compare
}
- return (sal_Int32) result;
+ return static_cast<sal_Int32>(result);
}
@@ -246,7 +246,7 @@ macabfield *MacabRecord::createMacabField(const OUString& _newFieldString, const
double nTime = DBTypeConversion::toDouble(aDateTime, DBTypeConversion::getStandardDate());
nTime -= kCFAbsoluteTimeIntervalSince1970;
newField = new macabfield;
- newField->value = CFDateCreate(nullptr, (CFAbsoluteTime) nTime);
+ newField->value = CFDateCreate(nullptr, static_cast<CFAbsoluteTime>(nTime));
newField->type = _abType;
}
}
diff --git a/connectivity/source/drivers/macab/MacabRecords.cxx b/connectivity/source/drivers/macab/MacabRecords.cxx
index 68ebe0780b0d..675757cf629c 100644
--- a/connectivity/source/drivers/macab/MacabRecords.cxx
+++ b/connectivity/source/drivers/macab/MacabRecords.cxx
@@ -168,7 +168,7 @@ void MacabRecords::initialize()
ABRecordRef record;
sal_Int32 i;
- recordsSize = (sal_Int32) CFArrayGetCount(allRecords);
+ recordsSize = static_cast<sal_Int32>(CFArrayGetCount(allRecords));
records = new MacabRecord *[recordsSize];
/* First, we create the header... */
@@ -361,8 +361,8 @@ MacabHeader *MacabRecords::createHeaderForRecordType(const CFArrayRef _records,
*/
CFArrayRef allProperties = ABCopyArrayOfPropertiesForRecordType(addressBook, _recordType);
CFStringRef *nonRequiredProperties;
- sal_Int32 numRecords = (sal_Int32) CFArrayGetCount(_records);
- sal_Int32 numProperties = (sal_Int32) CFArrayGetCount(allProperties);
+ sal_Int32 numRecords = static_cast<sal_Int32>(CFArrayGetCount(_records));
+ sal_Int32 numProperties = static_cast<sal_Int32>(CFArrayGetCount(allProperties));
sal_Int32 numNonRequiredProperties = numProperties - requiredProperties.size();
/* While searching through the properties for required properties, these
@@ -561,7 +561,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
OUString multiLabelString;
OUString multiPropertyString;
OUString headerNameString;
- ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100);
+ ABPropertyType multiType = static_cast<ABPropertyType>(ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100);
length = multiLength;
headerNames = new macabfield *[multiLength];
@@ -610,7 +610,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
OUString multiLabelString;
OUString multiPropertyString;
std::vector<std::unique_ptr<MacabHeader>> multiHeaders;
- ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100);
+ ABPropertyType multiType = static_cast<ABPropertyType>(ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100);
multiPropertyString = CFStringToOUString(_propertyName);
@@ -678,7 +678,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
if(_propertyValue != nullptr)
{
/* Assume all keys are strings */
- sal_Int32 numRecords = (sal_Int32) CFDictionaryGetCount(static_cast<CFDictionaryRef>(_propertyValue));
+ sal_Int32 numRecords = static_cast<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
@@ -758,7 +758,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert
*/
if(_propertyValue != nullptr)
{
- sal_Int32 arrLength = (sal_Int32) CFArrayGetCount(static_cast<CFArrayRef>(_propertyValue));
+ sal_Int32 arrLength = static_cast<sal_Int32>(CFArrayGetCount(static_cast<CFArrayRef>(_propertyValue)));
sal_Int32 i,j,k;
CFTypeRef arrValue;
ABPropertyType arrType;
@@ -845,7 +845,7 @@ MacabRecord *MacabRecords::createMacabRecord(const ABRecordRef _abrecord, const
MacabRecord *macabRecord = new MacabRecord(_header->getSize());
CFArrayRef recordProperties = ABCopyArrayOfPropertiesForRecordType(addressBook, _recordType);
- sal_Int32 numProperties = (sal_Int32) CFArrayGetCount(recordProperties);
+ sal_Int32 numProperties = static_cast<sal_Int32>(CFArrayGetCount(recordProperties));
sal_Int32 i;
@@ -964,7 +964,7 @@ 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(static_cast<CFArrayRef>(_propertyValue));
+ sal_Int32 arrLength = static_cast<sal_Int32>(CFArrayGetCount(static_cast<CFArrayRef>(_propertyValue)));
sal_Int32 i;
OUString newPropertyName;
@@ -993,7 +993,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT
* we hit a scalar value.
*/
- sal_Int32 numRecords = (sal_Int32) CFDictionaryGetCount(static_cast<CFDictionaryRef>(_propertyValue));
+ sal_Int32 numRecords = static_cast<sal_Int32>(CFDictionaryGetCount(static_cast<CFDictionaryRef>(_propertyValue)));
OUString dictKeyString;
sal_Int32 i;
OUString newPropertyName;
@@ -1047,7 +1047,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT
CFStringRef multiLabel, localizedMultiLabel;
CFTypeRef multiValue;
OUString multiLabelString, newPropertyName;
- ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100);
+ ABPropertyType multiType = static_cast<ABPropertyType>(ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100);
/* Go through each element... */
for(i = 0; i < multiLength; i++)
@@ -1099,7 +1099,7 @@ ABPropertyType MacabRecords::getABTypeFromCFType(const CFTypeID cf_type ) const
/* A match! */
if(i.cf == cf_type)
{
- return (ABPropertyType) i.ab;
+ return static_cast<ABPropertyType>(i.ab);
}
}
return kABErrorInProperty;
diff --git a/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx b/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx
index c424b1ea9302..f3f2d5483f4f 100644
--- a/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx
+++ b/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx
@@ -189,7 +189,7 @@ sal_Int32 SAL_CALL MacabResultSetMetaData::getScale(sal_Int32)
sal_Int32 SAL_CALL MacabResultSetMetaData::isNullable(sal_Int32)
{
- return (sal_Int32) true;
+ return sal_Int32(true);
}
sal_Bool SAL_CALL MacabResultSetMetaData::isSearchable(sal_Int32)
diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx
index 5cd342b93e30..1d71ab72d3fb 100644
--- a/connectivity/source/drivers/odbc/OConnection.cxx
+++ b/connectivity/source/drivers/odbc/OConnection.cxx
@@ -129,9 +129,9 @@ SQLRETURN OConnection::OpenConnection(const OUString& aConnectStr, sal_Int32 nTi
nSQLRETURN = N3SQLDriverConnect(m_aConnectionHandle,
nullptr,
szConnStrIn,
- (SQLSMALLINT) std::min<sal_Int32>((sal_Int32)2048,aConStr.getLength()),
+ static_cast<SQLSMALLINT>(std::min<sal_Int32>(sal_Int32(2048),aConStr.getLength())),
szConnStrOut,
- (SQLSMALLINT) sizeof szConnStrOut,
+ SQLSMALLINT(sizeof szConnStrOut),
&cbConnStrOut,
nSilent);
if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA)