diff options
-rw-r--r-- | connectivity/source/commontools/FValue.cxx | 72 | ||||
-rw-r--r-- | connectivity/source/commontools/dbtools.cxx | 50 | ||||
-rw-r--r-- | connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/evoab2/NResultSet.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/PreparedStatement.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/StatementCommonBase.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Util.cxx | 26 | ||||
-rw-r--r-- | connectivity/source/drivers/odbc/OPreparedStatement.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/odbc/OTools.cxx | 36 | ||||
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_tools.cxx | 24 | ||||
-rw-r--r-- | include/connectivity/FValue.hxx | 2 |
11 files changed, 115 insertions, 115 deletions
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index f6ce644f65ac..6c2ee2fa82ae 100644 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -286,31 +286,31 @@ void ORowSetValue::free() m_aValue.m_pString = NULL; break; case DataType::DATE: - delete (::com::sun::star::util::Date*)m_aValue.m_pValue; + delete static_cast<css::util::Date*>(m_aValue.m_pValue); TRACE_FREE( Date ) m_aValue.m_pValue = NULL; break; case DataType::TIME: - delete (::com::sun::star::util::Time*)m_aValue.m_pValue; + delete static_cast<css::util::Time*>(m_aValue.m_pValue); TRACE_FREE( tools::Time ) m_aValue.m_pValue = NULL; break; case DataType::TIMESTAMP: - delete (::com::sun::star::util::DateTime*)m_aValue.m_pValue; + delete static_cast<css::util::DateTime*>(m_aValue.m_pValue); TRACE_FREE( DateTime ) m_aValue.m_pValue = NULL; break; case DataType::BINARY: case DataType::VARBINARY: case DataType::LONGVARBINARY: - delete (Sequence<sal_Int8>*)m_aValue.m_pValue; + delete static_cast<Sequence<sal_Int8>*>(m_aValue.m_pValue); TRACE_FREE( Sequence_sal_Int8 ) m_aValue.m_pValue = NULL; break; case DataType::BLOB: case DataType::CLOB: case DataType::OBJECT: - delete (Any*)m_aValue.m_pValue; + delete static_cast<Any*>(m_aValue.m_pValue); TRACE_FREE( Any ) m_aValue.m_pValue = NULL; break; @@ -327,7 +327,7 @@ void ORowSetValue::free() default: if ( m_aValue.m_pValue ) { - delete (Any*)m_aValue.m_pValue; + delete static_cast<Any*>(m_aValue.m_pValue); TRACE_FREE( Any ) m_aValue.m_pValue = NULL; } @@ -363,21 +363,21 @@ ORowSetValue& ORowSetValue::operator=(const ORowSetValue& _rRH) m_aValue.m_pString = _rRH.m_aValue.m_pString; break; case DataType::DATE: - m_aValue.m_pValue = new Date(*(Date*)_rRH.m_aValue.m_pValue); + m_aValue.m_pValue = new Date(*static_cast<Date*>(_rRH.m_aValue.m_pValue)); TRACE_ALLOC( Date ) break; case DataType::TIME: - m_aValue.m_pValue = new Time(*(Time*)_rRH.m_aValue.m_pValue); + m_aValue.m_pValue = new Time(*static_cast<Time*>(_rRH.m_aValue.m_pValue)); TRACE_ALLOC( tools::Time ) break; case DataType::TIMESTAMP: - m_aValue.m_pValue = new DateTime(*(DateTime*)_rRH.m_aValue.m_pValue); + m_aValue.m_pValue = new DateTime(*static_cast<DateTime*>(_rRH.m_aValue.m_pValue)); TRACE_ALLOC( DateTime ) break; case DataType::BINARY: case DataType::VARBINARY: case DataType::LONGVARBINARY: - m_aValue.m_pValue = new Sequence<sal_Int8>(*(Sequence<sal_Int8>*)_rRH.m_aValue.m_pValue); + m_aValue.m_pValue = new Sequence<sal_Int8>(*static_cast<Sequence<sal_Int8>*>(_rRH.m_aValue.m_pValue)); TRACE_ALLOC( Sequence_sal_Int8 ) break; case DataType::BIT: @@ -416,7 +416,7 @@ ORowSetValue& ORowSetValue::operator=(const ORowSetValue& _rRH) m_aValue.m_nDouble = _rRH.m_aValue.m_nDouble; break; default: - m_aValue.m_pValue = new Any(*(Any*)_rRH.m_aValue.m_pValue); + m_aValue.m_pValue = new Any(*static_cast<Any*>(_rRH.m_aValue.m_pValue)); TRACE_ALLOC( Any ) } } @@ -432,18 +432,18 @@ ORowSetValue& ORowSetValue::operator=(const ORowSetValue& _rRH) (*this) = OUString(_rRH.m_aValue.m_pString); break; case DataType::DATE: - (*this) = *(Date*)_rRH.m_aValue.m_pValue; + (*this) = *static_cast<Date*>(_rRH.m_aValue.m_pValue); break; case DataType::TIME: - (*this) = *(Time*)_rRH.m_aValue.m_pValue; + (*this) = *static_cast<Time*>(_rRH.m_aValue.m_pValue); break; case DataType::TIMESTAMP: - (*this) = *(DateTime*)_rRH.m_aValue.m_pValue; + (*this) = *static_cast<DateTime*>(_rRH.m_aValue.m_pValue); break; case DataType::BINARY: case DataType::VARBINARY: case DataType::LONGVARBINARY: - (*this) = *(Sequence<sal_Int8>*)_rRH.m_aValue.m_pValue; + (*this) = *static_cast<Sequence<sal_Int8>*>(_rRH.m_aValue.m_pValue); break; case DataType::BIT: case DataType::BOOLEAN: @@ -481,7 +481,7 @@ ORowSetValue& ORowSetValue::operator=(const ORowSetValue& _rRH) m_aValue.m_nDouble = _rRH.m_aValue.m_nDouble; break; default: - (*(Any*)m_aValue.m_pValue) = (*(Any*)_rRH.m_aValue.m_pValue); + *static_cast<Any*>(m_aValue.m_pValue) = *static_cast<Any*>(_rRH.m_aValue.m_pValue); } } @@ -506,7 +506,7 @@ ORowSetValue& ORowSetValue::operator=(const Date& _rRH) m_bNull = false; } else - *(Date*)m_aValue.m_pValue = _rRH; + *static_cast<Date*>(m_aValue.m_pValue) = _rRH; return *this; } @@ -524,7 +524,7 @@ ORowSetValue& ORowSetValue::operator=(const css::util::Time& _rRH) m_bNull = false; } else - *(Time*)m_aValue.m_pValue = _rRH; + *static_cast<Time*>(m_aValue.m_pValue) = _rRH; return *this; } @@ -541,7 +541,7 @@ ORowSetValue& ORowSetValue::operator=(const DateTime& _rRH) m_bNull = false; } else - *(DateTime*)m_aValue.m_pValue = _rRH; + *static_cast<DateTime*>(m_aValue.m_pValue) = _rRH; return *this; } @@ -851,13 +851,13 @@ bool ORowSetValue::operator==(const ORowSetValue& _rRH) const bRet = m_aValue.m_bBool == _rRH.m_aValue.m_bBool; break; case DataType::DATE: - bRet = *(Date*)m_aValue.m_pValue == *(Date*)_rRH.m_aValue.m_pValue; + bRet = *static_cast<Date*>(m_aValue.m_pValue) == *static_cast<Date*>(_rRH.m_aValue.m_pValue); break; case DataType::TIME: - bRet = *(Time*)m_aValue.m_pValue == *(Time*)_rRH.m_aValue.m_pValue; + bRet = *static_cast<Time*>(m_aValue.m_pValue) == *static_cast<Time*>(_rRH.m_aValue.m_pValue); break; case DataType::TIMESTAMP: - bRet = *(DateTime*)m_aValue.m_pValue == *(DateTime*)_rRH.m_aValue.m_pValue; + bRet = *static_cast<DateTime*>(m_aValue.m_pValue) == *static_cast<DateTime*>(_rRH.m_aValue.m_pValue); break; case DataType::BINARY: case DataType::VARBINARY: @@ -902,21 +902,21 @@ Any ORowSetValue::makeAny() const break; case DataType::DATE: OSL_ENSURE(m_aValue.m_pValue,"Value is null!"); - rValue <<= *(Date*)m_aValue.m_pValue; + rValue <<= *static_cast<Date*>(m_aValue.m_pValue); break; case DataType::TIME: OSL_ENSURE(m_aValue.m_pValue,"Value is null!"); - rValue <<= *(Time*)m_aValue.m_pValue; + rValue <<= *static_cast<Time*>(m_aValue.m_pValue); break; case DataType::TIMESTAMP: OSL_ENSURE(m_aValue.m_pValue,"Value is null!"); - rValue <<= *(DateTime*)m_aValue.m_pValue; + rValue <<= *static_cast<DateTime*>(m_aValue.m_pValue); break; case DataType::BINARY: case DataType::VARBINARY: case DataType::LONGVARBINARY: OSL_ENSURE(m_aValue.m_pValue,"Value is null!"); - rValue <<= *(Sequence<sal_Int8>*)m_aValue.m_pValue; + rValue <<= *static_cast<Sequence<sal_Int8>*>(m_aValue.m_pValue); break; case DataType::BLOB: case DataType::CLOB: @@ -1437,7 +1437,7 @@ sal_Int32 ORowSetValue::getInt32() const nRet = sal_Int32(m_aValue.m_nDouble); break; case DataType::DATE: - nRet = dbtools::DBTypeConversion::toDays(*(::com::sun::star::util::Date*)m_aValue.m_pValue); + nRet = dbtools::DBTypeConversion::toDays(*static_cast<css::util::Date*>(m_aValue.m_pValue)); break; case DataType::TIME: case DataType::TIMESTAMP: @@ -1510,7 +1510,7 @@ sal_uInt32 ORowSetValue::getUInt32() const nRet = sal_uInt32(m_aValue.m_nDouble); break; case DataType::DATE: - nRet = dbtools::DBTypeConversion::toDays(*(::com::sun::star::util::Date*)m_aValue.m_pValue); + nRet = dbtools::DBTypeConversion::toDays(*static_cast<css::util::Date*>(m_aValue.m_pValue)); break; case DataType::TIME: case DataType::TIMESTAMP: @@ -1583,7 +1583,7 @@ sal_Int64 ORowSetValue::getLong() const nRet = sal_Int64(m_aValue.m_nDouble); break; case DataType::DATE: - nRet = dbtools::DBTypeConversion::toDays(*(::com::sun::star::util::Date*)m_aValue.m_pValue); + nRet = dbtools::DBTypeConversion::toDays(*static_cast<css::util::Date*>(m_aValue.m_pValue)); break; case DataType::TIME: case DataType::TIMESTAMP: @@ -1656,7 +1656,7 @@ sal_uInt64 ORowSetValue::getULong() const nRet = sal_uInt64(m_aValue.m_nDouble); break; case DataType::DATE: - nRet = dbtools::DBTypeConversion::toDays(*(::com::sun::star::util::Date*)m_aValue.m_pValue); + nRet = dbtools::DBTypeConversion::toDays(*static_cast<css::util::Date*>(m_aValue.m_pValue)); break; case DataType::TIME: case DataType::TIMESTAMP: @@ -1729,13 +1729,13 @@ float ORowSetValue::getFloat() const nRet = (float)m_aValue.m_nDouble; break; case DataType::DATE: - nRet = (float)dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::Date*)m_aValue.m_pValue); + nRet = (float)dbtools::DBTypeConversion::toDouble(*static_cast<css::util::Date*>(m_aValue.m_pValue)); break; case DataType::TIME: - nRet = (float)dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::Time*)m_aValue.m_pValue); + nRet = (float)dbtools::DBTypeConversion::toDouble(*static_cast<css::util::Time*>(m_aValue.m_pValue)); break; case DataType::TIMESTAMP: - nRet = (float)dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::DateTime*)m_aValue.m_pValue); + nRet = (float)dbtools::DBTypeConversion::toDouble(*static_cast<css::util::DateTime*>(m_aValue.m_pValue)); break; case DataType::BINARY: case DataType::VARBINARY: @@ -1805,13 +1805,13 @@ double ORowSetValue::getDouble() const nRet = m_aValue.m_nDouble; break; case DataType::DATE: - nRet = dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::Date*)m_aValue.m_pValue); + nRet = dbtools::DBTypeConversion::toDouble(*static_cast<css::util::Date*>(m_aValue.m_pValue)); break; case DataType::TIME: - nRet = dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::Time*)m_aValue.m_pValue); + nRet = dbtools::DBTypeConversion::toDouble(*static_cast<css::util::Time*>(m_aValue.m_pValue)); break; case DataType::TIMESTAMP: - nRet = dbtools::DBTypeConversion::toDouble(*(::com::sun::star::util::DateTime*)m_aValue.m_pValue); + nRet = dbtools::DBTypeConversion::toDouble(*static_cast<css::util::DateTime*>(m_aValue.m_pValue)); break; case DataType::BINARY: case DataType::VARBINARY: diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index f5d564c21906..4815a5737e4d 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -1169,14 +1169,14 @@ try { Any aDate( xOldProps->getPropertyValue(sPropDefaultDate) ); if (aDate.hasValue()) - aNewDefault <<= DBTypeConversion::toDouble(*(Date*)aDate.getValue()); + aNewDefault <<= DBTypeConversion::toDouble(*static_cast<Date const *>(aDate.getValue())); } if (hasProperty(sPropDefaultTime, xOldProps)) { Any aTime( xOldProps->getPropertyValue(sPropDefaultTime) ); if (aTime.hasValue()) - aNewDefault <<= DBTypeConversion::toDouble(*(Time*)aTime.getValue()); + aNewDefault <<= DBTypeConversion::toDouble(*static_cast<Time const *>(aTime.getValue())); } // double or OUString will be copied directly @@ -1463,29 +1463,29 @@ bool implUpdateObject(const Reference< XRowUpdate >& _rxUpdatedObject, break; case TypeClass_STRING: - _rxUpdatedObject->updateString(_nColumnIndex, *(OUString*)_rValue.getValue()); + _rxUpdatedObject->updateString(_nColumnIndex, *static_cast<OUString const *>(_rValue.getValue())); break; case TypeClass_BOOLEAN: - _rxUpdatedObject->updateBoolean(_nColumnIndex, *(sal_Bool *)_rValue.getValue()); + _rxUpdatedObject->updateBoolean(_nColumnIndex, *static_cast<sal_Bool const *>(_rValue.getValue())); break; case TypeClass_BYTE: - _rxUpdatedObject->updateByte(_nColumnIndex, *(sal_Int8 *)_rValue.getValue()); + _rxUpdatedObject->updateByte(_nColumnIndex, *static_cast<sal_Int8 const *>(_rValue.getValue())); break; case TypeClass_UNSIGNED_SHORT: case TypeClass_SHORT: - _rxUpdatedObject->updateShort(_nColumnIndex, *(sal_Int16*)_rValue.getValue()); + _rxUpdatedObject->updateShort(_nColumnIndex, *static_cast<sal_Int16 const *>(_rValue.getValue())); break; case TypeClass_CHAR: - _rxUpdatedObject->updateString(_nColumnIndex,OUString((sal_Unicode *)_rValue.getValue(),1)); + _rxUpdatedObject->updateString(_nColumnIndex,OUString(static_cast<sal_Unicode const *>(_rValue.getValue()),1)); break; case TypeClass_UNSIGNED_LONG: case TypeClass_LONG: - _rxUpdatedObject->updateInt(_nColumnIndex, *(sal_Int32*)_rValue.getValue()); + _rxUpdatedObject->updateInt(_nColumnIndex, *static_cast<sal_Int32 const *>(_rValue.getValue())); break; case TypeClass_HYPER: @@ -1497,26 +1497,26 @@ bool implUpdateObject(const Reference< XRowUpdate >& _rxUpdatedObject, break; case TypeClass_FLOAT: - _rxUpdatedObject->updateFloat(_nColumnIndex, *(float*)_rValue.getValue()); + _rxUpdatedObject->updateFloat(_nColumnIndex, *static_cast<float const *>(_rValue.getValue())); break; case TypeClass_DOUBLE: - _rxUpdatedObject->updateDouble(_nColumnIndex, *(double*)_rValue.getValue()); + _rxUpdatedObject->updateDouble(_nColumnIndex, *static_cast<double const *>(_rValue.getValue())); break; case TypeClass_SEQUENCE: if (_rValue.getValueType() == cppu::UnoType< Sequence< sal_Int8 > >::get()) - _rxUpdatedObject->updateBytes(_nColumnIndex, *(Sequence<sal_Int8>*)_rValue.getValue()); + _rxUpdatedObject->updateBytes(_nColumnIndex, *static_cast<Sequence<sal_Int8> const *>(_rValue.getValue())); else bSuccessfullyReRouted = false; break; case TypeClass_STRUCT: if (_rValue.getValueType() == cppu::UnoType<DateTime>::get()) - _rxUpdatedObject->updateTimestamp(_nColumnIndex, *(DateTime*)_rValue.getValue()); + _rxUpdatedObject->updateTimestamp(_nColumnIndex, *static_cast<DateTime const *>(_rValue.getValue())); else if (_rValue.getValueType() == cppu::UnoType<Date>::get()) - _rxUpdatedObject->updateDate(_nColumnIndex, *(Date*)_rValue.getValue()); + _rxUpdatedObject->updateDate(_nColumnIndex, *static_cast<Date const *>(_rValue.getValue())); else if (_rValue.getValueType() == cppu::UnoType<Time>::get()) - _rxUpdatedObject->updateTime(_nColumnIndex, *(Time*)_rValue.getValue()); + _rxUpdatedObject->updateTime(_nColumnIndex, *static_cast<Time const *>(_rValue.getValue())); else bSuccessfullyReRouted = false; break; @@ -1573,23 +1573,23 @@ bool implSetObject( const Reference< XParameters >& _rxParameters, break; case TypeClass_STRING: - _rxParameters->setString(_nColumnIndex, *(OUString*)_rValue.getValue()); + _rxParameters->setString(_nColumnIndex, *static_cast<OUString const *>(_rValue.getValue())); break; case TypeClass_BOOLEAN: - _rxParameters->setBoolean(_nColumnIndex, *(sal_Bool *)_rValue.getValue()); + _rxParameters->setBoolean(_nColumnIndex, *static_cast<sal_Bool const *>(_rValue.getValue())); break; case TypeClass_BYTE: - _rxParameters->setByte(_nColumnIndex, *(sal_Int8 *)_rValue.getValue()); + _rxParameters->setByte(_nColumnIndex, *static_cast<sal_Int8 const *>(_rValue.getValue())); break; case TypeClass_SHORT: - _rxParameters->setShort(_nColumnIndex, *(sal_Int16*)_rValue.getValue()); + _rxParameters->setShort(_nColumnIndex, *static_cast<sal_Int16 const *>(_rValue.getValue())); break; case TypeClass_CHAR: - _rxParameters->setString(_nColumnIndex, OUString((sal_Unicode *)_rValue.getValue(),1)); + _rxParameters->setString(_nColumnIndex, OUString(static_cast<sal_Unicode const *>(_rValue.getValue()),1)); break; case TypeClass_UNSIGNED_SHORT: @@ -1602,28 +1602,28 @@ bool implSetObject( const Reference< XParameters >& _rxParameters, } case TypeClass_FLOAT: - _rxParameters->setFloat(_nColumnIndex, *(float*)_rValue.getValue()); + _rxParameters->setFloat(_nColumnIndex, *static_cast<float const *>(_rValue.getValue())); break; case TypeClass_DOUBLE: - _rxParameters->setDouble(_nColumnIndex, *(double*)_rValue.getValue()); + _rxParameters->setDouble(_nColumnIndex, *static_cast<double const *>(_rValue.getValue())); break; case TypeClass_SEQUENCE: if (_rValue.getValueType() == cppu::UnoType< Sequence< sal_Int8 > >::get()) { - _rxParameters->setBytes(_nColumnIndex, *(Sequence<sal_Int8>*)_rValue.getValue()); + _rxParameters->setBytes(_nColumnIndex, *static_cast<Sequence<sal_Int8> const *>(_rValue.getValue())); } else bSuccessfullyReRouted = false; break; case TypeClass_STRUCT: if (_rValue.getValueType() == cppu::UnoType<DateTime>::get()) - _rxParameters->setTimestamp(_nColumnIndex, *(DateTime*)_rValue.getValue()); + _rxParameters->setTimestamp(_nColumnIndex, *static_cast<DateTime const *>(_rValue.getValue())); else if (_rValue.getValueType() == cppu::UnoType<Date>::get()) - _rxParameters->setDate(_nColumnIndex, *(Date*)_rValue.getValue()); + _rxParameters->setDate(_nColumnIndex, *static_cast<Date const *>(_rValue.getValue())); else if (_rValue.getValueType() == cppu::UnoType<Time>::get()) - _rxParameters->setTime(_nColumnIndex, *(Time*)_rValue.getValue()); + _rxParameters->setTime(_nColumnIndex, *static_cast<Time const *>(_rValue.getValue())); else bSuccessfullyReRouted = false; break; diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx index 5ce6c5c603d3..35f84fec6bea 100644 --- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx +++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx @@ -105,7 +105,7 @@ namespace connectivity GParamSpec **pProps; nFields = 0; pProps = g_object_class_list_properties - ( (GObjectClass *) g_type_class_ref( E_TYPE_CONTACT ), + ( static_cast<GObjectClass *>(g_type_class_ref( E_TYPE_CONTACT )), &nProps ); pToBeFields = g_new0(ColumnProperty *, (nProps + OTHER_ZIP)/* new column(s)*/ ); for ( guint i = 0; i < nProps; i++ ) diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx index add296150c6b..62ebbfca0a09 100644 --- a/connectivity/source/drivers/evoab2/NResultSet.cxx +++ b/connectivity/source/drivers/evoab2/NResultSet.cxx @@ -156,7 +156,7 @@ whichAddress(int value) static EContactAddress * getDefaultContactAddress( EContact *pContact,int *value ) { - EContactAddress *ec = (EContactAddress *)e_contact_get(pContact,whichAddress(WORK_ADDR_LINE1)); + EContactAddress *ec = static_cast<EContactAddress *>(e_contact_get(pContact,whichAddress(WORK_ADDR_LINE1))); if ( ec && (strlen(ec->street)>0) ) { *value= *value +WORK_ADDR_LINE1 -1; @@ -164,7 +164,7 @@ getDefaultContactAddress( EContact *pContact,int *value ) } else { - ec = (EContactAddress *)e_contact_get(pContact,whichAddress(HOME_ADDR_LINE1)); + ec = static_cast<EContactAddress *>(e_contact_get(pContact,whichAddress(HOME_ADDR_LINE1))); if ( ec && (strlen(ec->street)>0) ) { *value=*value+HOME_ADDR_LINE1-1; @@ -173,7 +173,7 @@ getDefaultContactAddress( EContact *pContact,int *value ) } *value=*value+OTHER_ADDR_LINE1-1; - return (EContactAddress *)e_contact_get(pContact,whichAddress(OTHER_ADDR_LINE1)); + return static_cast<EContactAddress *>(e_contact_get(pContact,whichAddress(OTHER_ADDR_LINE1))); } static EContactAddress* @@ -190,7 +190,7 @@ getContactAddress( EContact *pContact, int * address_enum ) case DEFAULT_ZIP: ec = getDefaultContactAddress(pContact,address_enum);break; default: - ec = (EContactAddress *)e_contact_get(pContact,whichAddress(*address_enum)); + ec = static_cast<EContactAddress *>(e_contact_get(pContact,whichAddress(*address_enum))); } return ec; } diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index 21a9d900b9e5..3a783788f2ef 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -76,7 +76,7 @@ void OPreparedStatement::ensurePrepared() if (!m_pInSqlda) { - m_pInSqlda = (XSQLDA*) calloc(1, XSQLDA_LENGTH(10)); + m_pInSqlda = static_cast<XSQLDA*>(calloc(1, XSQLDA_LENGTH(10))); m_pInSqlda->version = SQLDA_VERSION1; m_pInSqlda->sqln = 10; } @@ -99,7 +99,7 @@ void OPreparedStatement::ensurePrepared() { short nItems = m_pInSqlda->sqld; free(m_pInSqlda); - m_pInSqlda = (XSQLDA*) calloc(1, XSQLDA_LENGTH(nItems)); + m_pInSqlda = static_cast<XSQLDA*>(calloc(1, XSQLDA_LENGTH(nItems))); m_pInSqlda->version = SQLDA_VERSION1; m_pInSqlda->sqln = nItems; isc_dsql_describe_bind(m_statusVector, diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.cxx b/connectivity/source/drivers/firebird/StatementCommonBase.cxx index 36780738b44a..9291b7bdf5b2 100644 --- a/connectivity/source/drivers/firebird/StatementCommonBase.cxx +++ b/connectivity/source/drivers/firebird/StatementCommonBase.cxx @@ -131,7 +131,7 @@ void OStatementCommonBase::prepareAndDescribeStatement(const OUString& sql, if (!pOutSqlda) { - pOutSqlda = (XSQLDA*) calloc(1, XSQLDA_LENGTH(10)); + pOutSqlda = static_cast<XSQLDA*>(calloc(1, XSQLDA_LENGTH(10))); pOutSqlda->version = SQLDA_VERSION1; pOutSqlda->sqln = 10; } @@ -185,7 +185,7 @@ void OStatementCommonBase::prepareAndDescribeStatement(const OUString& sql, { int n = pOutSqlda->sqld; free(pOutSqlda); - pOutSqlda = (XSQLDA*) calloc(1, XSQLDA_LENGTH(n)); + pOutSqlda = static_cast<XSQLDA*>(calloc(1, XSQLDA_LENGTH(n))); pOutSqlda->version = SQLDA_VERSION1; pOutSqlda->sqln = n; aErr = isc_dsql_describe(m_statusVector, diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx index 3e9e54356a04..c8f182d37924 100644 --- a/connectivity/source/drivers/firebird/Util.cxx +++ b/connectivity/source/drivers/firebird/Util.cxx @@ -205,43 +205,43 @@ void firebird::mallocSQLVAR(XSQLDA* pSqlda) int dtype = (pVar->sqltype & ~1); /* drop flag bit for now */ switch(dtype) { case SQL_TEXT: - pVar->sqldata = (char *)malloc(sizeof(char)*pVar->sqllen); + pVar->sqldata = static_cast<char *>(malloc(sizeof(char)*pVar->sqllen)); break; case SQL_VARYING: - pVar->sqldata = (char *)malloc(sizeof(char)*pVar->sqllen + 2); + pVar->sqldata = static_cast<char *>(malloc(sizeof(char)*pVar->sqllen + 2)); break; case SQL_SHORT: - pVar->sqldata = (char*) malloc(sizeof(sal_Int16)); + pVar->sqldata = static_cast<char*>(malloc(sizeof(sal_Int16))); break; case SQL_LONG: - pVar->sqldata = (char*) malloc(sizeof(sal_Int32)); + pVar->sqldata = static_cast<char*>(malloc(sizeof(sal_Int32))); break; case SQL_FLOAT: - pVar->sqldata = (char *)malloc(sizeof(float)); + pVar->sqldata = static_cast<char *>(malloc(sizeof(float))); break; case SQL_DOUBLE: - pVar->sqldata = (char *)malloc(sizeof(double)); + pVar->sqldata = static_cast<char *>(malloc(sizeof(double))); break; case SQL_D_FLOAT: - pVar->sqldata = (char *)malloc(sizeof(double)); + pVar->sqldata = static_cast<char *>(malloc(sizeof(double))); break; case SQL_TIMESTAMP: - pVar->sqldata = (char*) malloc(sizeof(ISC_TIMESTAMP)); + pVar->sqldata = static_cast<char*>(malloc(sizeof(ISC_TIMESTAMP))); break; case SQL_BLOB: - pVar->sqldata = (char*) malloc(sizeof(ISC_QUAD)); + pVar->sqldata = static_cast<char*>(malloc(sizeof(ISC_QUAD))); break; case SQL_ARRAY: assert(false); // TODO: implement break; case SQL_TYPE_TIME: - pVar->sqldata = (char*) malloc(sizeof(ISC_TIME)); + pVar->sqldata = static_cast<char*>(malloc(sizeof(ISC_TIME))); break; case SQL_TYPE_DATE: - pVar->sqldata = (char*) malloc(sizeof(ISC_DATE)); + pVar->sqldata = static_cast<char*>(malloc(sizeof(ISC_DATE))); break; case SQL_INT64: - pVar->sqldata = (char *)malloc(sizeof(sal_Int64)); + pVar->sqldata = static_cast<char *>(malloc(sizeof(sal_Int64))); break; case SQL_NULL: assert(false); // TODO: implement @@ -257,7 +257,7 @@ void firebird::mallocSQLVAR(XSQLDA* pSqlda) if (pVar->sqltype & 1) { /* allocate variable to hold NULL status */ - pVar->sqlind = (short *)malloc(sizeof(short)); + pVar->sqlind = static_cast<short *>(malloc(sizeof(short))); } } } diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx index 47ebd57033d7..e88a3aec9a96 100644 --- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx +++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx @@ -344,7 +344,7 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_ else { pData = allocBindBuf(parameterIndex, _sData.getLength() * 4); - sal_uInt32* pCursor = (sal_uInt32*)pData; + sal_uInt32* pCursor = static_cast<sal_uInt32*>(pData); nCharLen = 0; for (sal_Int32 i = 0; i != _sData.getLength();) { diff --git a/connectivity/source/drivers/odbc/OTools.cxx b/connectivity/source/drivers/odbc/OTools.cxx index 308bdfa3202c..d7ea63e939a1 100644 --- a/connectivity/source/drivers/odbc/OTools.cxx +++ b/connectivity/source/drivers/odbc/OTools.cxx @@ -192,62 +192,62 @@ void OTools::bindValue( OConnection* _pConnection, case SQL_CHAR: case SQL_VARCHAR: { - OString aString(OUStringToOString(*(OUString*)_pValue,_nTextEncoding)); + OString aString(OUStringToOString(*static_cast<OUString const *>(_pValue),_nTextEncoding)); *pLen = SQL_NTS; - *((OString*)_pData) = aString; + *static_cast<OString*>(_pData) = aString; _nMaxLen = (SQLSMALLINT)aString.getLength(); // Pointer on Char* _pData = (void*)aString.getStr(); } break; case SQL_BIGINT: - *((sal_Int64*)_pData) = *(sal_Int64*)_pValue; + *static_cast<sal_Int64*>(_pData) = *static_cast<sal_Int64 const *>(_pValue); *pLen = sizeof(sal_Int64); break; case SQL_DECIMAL: case SQL_NUMERIC: { - OString aString = OString::number(*(double*)_pValue); + OString aString = OString::number(*static_cast<double const *>(_pValue)); _nMaxLen = (SQLSMALLINT)aString.getLength(); *pLen = _nMaxLen; - *((OString*)_pData) = aString; + *static_cast<OString*>(_pData) = aString; // Pointer on Char* - _pData = (void*)((OString*)_pData)->getStr(); + _pData = (void*)static_cast<OString*>(_pData)->getStr(); } break; case SQL_BIT: case SQL_TINYINT: - *((sal_Int8*)_pData) = *(sal_Int8*)_pValue; + *static_cast<sal_Int8*>(_pData) = *static_cast<sal_Int8 const *>(_pValue); *pLen = sizeof(sal_Int8); break; case SQL_SMALLINT: - *((sal_Int16*)_pData) = *(sal_Int16*)_pValue; + *static_cast<sal_Int16*>(_pData) = *static_cast<sal_Int16 const *>(_pValue); *pLen = sizeof(sal_Int16); break; case SQL_INTEGER: - *((sal_Int32*)_pData) = *(sal_Int32*)_pValue; + *static_cast<sal_Int32*>(_pData) = *static_cast<sal_Int32 const *>(_pValue); *pLen = sizeof(sal_Int32); break; case SQL_FLOAT: - *((float*)_pData) = *(float*)_pValue; + *static_cast<float*>(_pData) = *static_cast<float const *>(_pValue); *pLen = sizeof(float); break; case SQL_REAL: case SQL_DOUBLE: - *((double*)_pData) = *(double*)_pValue; + *static_cast<double*>(_pData) = *static_cast<double const *>(_pValue); *pLen = sizeof(double); break; case SQL_BINARY: case SQL_VARBINARY: { - _pData = (void*)((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getConstArray(); - *pLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength(); + _pData = (void*)static_cast<const ::com::sun::star::uno::Sequence< sal_Int8 > *>(_pValue)->getConstArray(); + *pLen = static_cast<const ::com::sun::star::uno::Sequence< sal_Int8 > *>(_pValue)->getLength(); } break; case SQL_LONGVARBINARY: { _pData = reinterpret_cast<void*>(columnIndex); sal_Int32 nLen = 0; - nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength(); + nLen = static_cast<const ::com::sun::star::uno::Sequence< sal_Int8 > *>(_pValue)->getLength(); *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); } break; @@ -255,20 +255,20 @@ void OTools::bindValue( OConnection* _pConnection, { _pData = reinterpret_cast<void*>(columnIndex); sal_Int32 nLen = 0; - nLen = ((OUString*)_pValue)->getLength(); + nLen = static_cast<OUString const *>(_pValue)->getLength(); *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); } break; case SQL_DATE: *pLen = sizeof(DATE_STRUCT); - *((DATE_STRUCT*)_pData) = *(DATE_STRUCT*)_pValue; + *static_cast<DATE_STRUCT*>(_pData) = *static_cast<DATE_STRUCT const *>(_pValue); break; case SQL_TIME: *pLen = sizeof(TIME_STRUCT); - *((TIME_STRUCT*)_pData) = *(TIME_STRUCT*)_pValue; + *static_cast<TIME_STRUCT*>(_pData) = *static_cast<TIME_STRUCT const *>(_pValue); break; case SQL_TIMESTAMP: *pLen = sizeof(TIMESTAMP_STRUCT); - *((TIMESTAMP_STRUCT*)_pData) = *(TIMESTAMP_STRUCT*)_pValue; + *static_cast<TIMESTAMP_STRUCT*>(_pData) = *static_cast<TIMESTAMP_STRUCT const *>(_pValue); break; } } diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx b/connectivity/source/drivers/postgresql/pq_tools.cxx index 5f08e9d0afd8..bb9db8431df3 100644 --- a/connectivity/source/drivers/postgresql/pq_tools.cxx +++ b/connectivity/source/drivers/postgresql/pq_tools.cxx @@ -1168,54 +1168,54 @@ bool implSetObject( const Reference< XParameters >& _rxParameters, break; case typelib_TypeClass_STRING: - _rxParameters->setString(_nColumnIndex, *(OUString*)_rValue.getValue()); + _rxParameters->setString(_nColumnIndex, *static_cast<OUString const *>(_rValue.getValue())); break; case typelib_TypeClass_BOOLEAN: - _rxParameters->setBoolean(_nColumnIndex, *(sal_Bool *)_rValue.getValue()); + _rxParameters->setBoolean(_nColumnIndex, *static_cast<sal_Bool const *>(_rValue.getValue())); break; case typelib_TypeClass_BYTE: - _rxParameters->setByte(_nColumnIndex, *(sal_Int8 *)_rValue.getValue()); + _rxParameters->setByte(_nColumnIndex, *static_cast<sal_Int8 const *>(_rValue.getValue())); break; case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_SHORT: - _rxParameters->setShort(_nColumnIndex, *(sal_Int16*)_rValue.getValue()); + _rxParameters->setShort(_nColumnIndex, *static_cast<sal_Int16 const *>(_rValue.getValue())); break; case typelib_TypeClass_CHAR: - _rxParameters->setString(_nColumnIndex, OUString((sal_Unicode *)_rValue.getValue(),1)); + _rxParameters->setString(_nColumnIndex, OUString(static_cast<sal_Unicode const *>(_rValue.getValue()),1)); break; case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_LONG: - _rxParameters->setInt(_nColumnIndex, *(sal_Int32*)_rValue.getValue()); + _rxParameters->setInt(_nColumnIndex, *static_cast<sal_Int32 const *>(_rValue.getValue())); break; case typelib_TypeClass_FLOAT: - _rxParameters->setFloat(_nColumnIndex, *(float*)_rValue.getValue()); + _rxParameters->setFloat(_nColumnIndex, *static_cast<float const *>(_rValue.getValue())); break; case typelib_TypeClass_DOUBLE: - _rxParameters->setDouble(_nColumnIndex, *(double*)_rValue.getValue()); + _rxParameters->setDouble(_nColumnIndex, *static_cast<double const *>(_rValue.getValue())); break; case typelib_TypeClass_SEQUENCE: if (_rValue.getValueType() == ::getCppuType((const Sequence< sal_Int8 > *)0)) { - _rxParameters->setBytes(_nColumnIndex, *(Sequence<sal_Int8>*)_rValue.getValue()); + _rxParameters->setBytes(_nColumnIndex, *static_cast<Sequence<sal_Int8> const *>(_rValue.getValue())); } else bSuccessfullyReRouted = false; break; case typelib_TypeClass_STRUCT: if (_rValue.getValueType() == cppu::UnoType<com::sun::star::util::DateTime>::get()) - _rxParameters->setTimestamp(_nColumnIndex, *(com::sun::star::util::DateTime*)_rValue.getValue()); + _rxParameters->setTimestamp(_nColumnIndex, *static_cast<com::sun::star::util::DateTime const *>(_rValue.getValue())); else if (_rValue.getValueType() == cppu::UnoType<com::sun::star::util::Date>::get()) - _rxParameters->setDate(_nColumnIndex, *(com::sun::star::util::Date*)_rValue.getValue()); + _rxParameters->setDate(_nColumnIndex, *static_cast<com::sun::star::util::Date const *>(_rValue.getValue())); else if (_rValue.getValueType() == cppu::UnoType<com::sun::star::util::Time>::get()) - _rxParameters->setTime(_nColumnIndex, *(com::sun::star::util::Time*)_rValue.getValue()); + _rxParameters->setTime(_nColumnIndex, *static_cast<com::sun::star::util::Time const *>(_rValue.getValue())); else bSuccessfullyReRouted = false; break; diff --git a/include/connectivity/FValue.hxx b/include/connectivity/FValue.hxx index 2408eafeb319..4fc1d081df4f 100644 --- a/include/connectivity/FValue.hxx +++ b/include/connectivity/FValue.hxx @@ -411,7 +411,7 @@ namespace connectivity ::com::sun::star::util::DateTime getDateTime() const; ::com::sun::star::uno::Sequence<sal_Int8> getSequence() const; // only use for anys - ::com::sun::star::uno::Any getAny() const { return *(::com::sun::star::uno::Any*)m_aValue.m_pValue; } + ::com::sun::star::uno::Any getAny() const { return *static_cast<css::uno::Any*>(m_aValue.m_pValue); } ::com::sun::star::uno::Any makeAny() const; /** |