diff options
Diffstat (limited to 'connectivity/source/drivers')
8 files changed, 66 insertions, 64 deletions
diff --git a/connectivity/source/drivers/adabas/makefile.mk b/connectivity/source/drivers/adabas/makefile.mk index 09b2936e1c7d..5b3483ed57bb 100644 --- a/connectivity/source/drivers/adabas/makefile.mk +++ b/connectivity/source/drivers/adabas/makefile.mk @@ -107,4 +107,4 @@ DEF1EXPORTFILE= exports.dxp # --- Targets ---------------------------------- -.INCLUDE : $(PRJ)$/target.pmk
\ No newline at end of file +.INCLUDE : $(PRJ)$/target.pmk diff --git a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx index bd4201ee3729..2a6f79f5acd7 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx @@ -53,16 +53,16 @@ void MTypeConverter::ouStringToNsString(::rtl::OUString const &ous, nsString &ns // ------------------------------------------------------------------------- ::rtl::OUString MTypeConverter::nsACStringToOUString( const nsACString& _source ) { - const char* buffer = _source.BeginReading();
- const char* bufferEnd = _source.EndReading();
- return ::rtl::OUString( buffer, bufferEnd - buffer, RTL_TEXTENCODING_ASCII_US );
+ const char* buffer = _source.BeginReading(); + const char* bufferEnd = _source.EndReading(); + return ::rtl::OUString( buffer, static_cast<sal_Int32>(bufferEnd - buffer), RTL_TEXTENCODING_ASCII_US ); } // ------------------------------------------------------------------------- ::rtl::OString MTypeConverter::nsACStringToOString( const nsACString& _source ) { - const char* buffer = _source.BeginReading();
- const char* bufferEnd = _source.EndReading();
- return ::rtl::OString( buffer, bufferEnd - buffer );
+ const char* buffer = _source.BeginReading(); + const char* bufferEnd = _source.EndReading(); + return ::rtl::OString( buffer, static_cast<sal_Int32>(bufferEnd - buffer) ); } // ------------------------------------------------------------------------- void MTypeConverter::asciiOUStringToNsACString( const ::rtl::OUString& _asciiString, nsACString& _dest ) @@ -73,8 +73,8 @@ void MTypeConverter::asciiOUStringToNsACString( const ::rtl::OUString& _asciiStr // ------------------------------------------------------------------------- void MTypeConverter::asciiToNsACString( const sal_Char* _asciiString, nsACString& _dest ) { - _dest.Truncate();
- _dest.AppendASCII( _asciiString );
+ _dest.Truncate(); + _dest.AppendASCII( _asciiString ); } // ------------------------------------------------------------------------- void MTypeConverter::nsStringToOUString(nsString const &nss, ::rtl::OUString &ous) diff --git a/connectivity/source/drivers/odbcbase/OConnection.cxx b/connectivity/source/drivers/odbcbase/OConnection.cxx index 0a86ed7b9f18..8a27940f44b0 100644 --- a/connectivity/source/drivers/odbcbase/OConnection.cxx +++ b/connectivity/source/drivers/odbcbase/OConnection.cxx @@ -108,7 +108,7 @@ SQLRETURN OConnection::OpenConnection(const ::rtl::OUString& aConnectStr,sal_Int SQLRETURN nSQLRETURN = 0; SDB_ODBC_CHAR szConnStrOut[4096]; SDB_ODBC_CHAR szConnStrIn[2048]; - SWORD cbConnStrOut; + SQLSMALLINT cbConnStrOut; memset(szConnStrOut,'\0',4096); memset(szConnStrIn,'\0',2048); ::rtl::OString aConStr(::rtl::OUStringToOString(aConnectStr,getTextEncoding())); diff --git a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx index 655006d1f8e4..8d72c3271b82 100644 --- a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx +++ b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx @@ -444,11 +444,11 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s checkParameterIndex(parameterIndex); sal_Int8* lenBuf = getLengthBuf (parameterIndex); - *(SDWORD*)lenBuf = SQL_NULL_DATA; + *(SQLLEN*)lenBuf = SQL_NULL_DATA; - SQLINTEGER prec = 0; - SQLUINTEGER nColumnSize = 0; + SQLLEN prec = 0; + SQLULEN nColumnSize = 0; if (sqlType == SQL_CHAR || sqlType == SQL_VARCHAR || sqlType == SQL_LONGVARCHAR) { prec = 1; @@ -474,7 +474,7 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s nDecimalDigits, NULL, prec, - (SDWORD*)lenBuf + (SQLLEN*)lenBuf ); OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this); } @@ -865,7 +865,7 @@ void OPreparedStatement::setStream ( // Bind the parameter with SQL_LEN_DATA_AT_EXEC SQLSMALLINT Ctype = SQL_C_CHAR; - SDWORD atExec = SQL_LEN_DATA_AT_EXEC (length); + SQLLEN atExec = SQL_LEN_DATA_AT_EXEC (length); memcpy (dataBuf, &ParameterIndex, sizeof(ParameterIndex)); memcpy (lenBuf, &atExec, sizeof (atExec)); @@ -876,14 +876,14 @@ void OPreparedStatement::setStream ( OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); N3SQLBindParameter(m_aStatementHandle, (SQLUSMALLINT)ParameterIndex, - (SQLSMALLINT)SQL_PARAM_INPUT, + (SQLUSMALLINT)SQL_PARAM_INPUT, Ctype, (SQLSMALLINT)SQLtype, - (SQLUINTEGER)length, + (SQLULEN)length, 0, dataBuf, sizeof(ParameterIndex), - (SDWORD*)lenBuf); + (SQLLEN*)lenBuf); // Save the input stream boundParams[ParameterIndex - 1].setInputStream (x, length); diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx index 1825b94051e7..8c885f0924ad 100644 --- a/connectivity/source/drivers/odbcbase/OResultSet.cxx +++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx @@ -843,8 +843,8 @@ void SAL_CALL OResultSet::insertRow( ) throw(SQLException, RuntimeException) checkDisposed(OResultSet_BASE::rBHelper.bDisposed); - SQLSMALLINT nMaxLen = 20; - SQLINTEGER nRealLen = 0; + SQLLEN nMaxLen = 20; + SQLLEN nRealLen = 0; Sequence<sal_Int8> aBookmark(nMaxLen); SQLRETURN nRet = N3SQLBindCol(m_aStatementHandle, @@ -925,7 +925,7 @@ void SAL_CALL OResultSet::updateRow( ) throw(SQLException, RuntimeException) sal_Bool bPositionByBookmark = ( NULL != getOdbcFunction( ODBC3SQLBulkOperations ) ); if ( bPositionByBookmark ) { - SQLINTEGER nRealLen = 0; + SQLLEN nRealLen = 0; nRet = N3SQLBindCol(m_aStatementHandle, 0, SQL_C_VARBOOKMARK, diff --git a/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx b/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx index adf77eca238c..349d5425eb04 100644 --- a/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx +++ b/connectivity/source/drivers/odbcbase/OResultSetMetaData.cxx @@ -86,13 +86,13 @@ OResultSetMetaData::~OResultSetMetaData() return sValue; } // ------------------------------------------------------------------------- -SWORD OResultSetMetaData::getNumColAttrib(OConnection* _pConnection +SQLLEN OResultSetMetaData::getNumColAttrib(OConnection* _pConnection ,SQLHANDLE _aStatementHandle ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface ,sal_Int32 _column ,sal_Int32 _ident) throw(SQLException, RuntimeException) { - SWORD nValue=0; + SQLLEN nValue=0; OTools::ThrowException(_pConnection,(*(T3SQLColAttribute)_pConnection->getOdbcFunction(ODBC3SQLColAttribute))(_aStatementHandle, (SQLUSMALLINT)_column, (SQLUSMALLINT)_ident, @@ -117,13 +117,13 @@ sal_Int32 SAL_CALL OResultSetMetaData::getColumnDisplaySize( sal_Int32 column ) return getNumColAttrib(column,SQL_DESC_DISPLAY_SIZE); } // ------------------------------------------------------------------------- -SWORD OResultSetMetaData::getColumnODBCType(OConnection* _pConnection +SQLSMALLINT OResultSetMetaData::getColumnODBCType(OConnection* _pConnection ,SQLHANDLE _aStatementHandle ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface ,sal_Int32 column) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { - SWORD nType = 0; + SQLSMALLINT nType = 0; try { nType = getNumColAttrib(_pConnection,_aStatementHandle,_xInterface,column,SQL_DESC_CONCISE_TYPE); diff --git a/connectivity/source/drivers/odbcbase/OStatement.cxx b/connectivity/source/drivers/odbcbase/OStatement.cxx index 3e0fdbd79c3f..79fbef9db50e 100644 --- a/connectivity/source/drivers/odbcbase/OStatement.cxx +++ b/connectivity/source/drivers/odbcbase/OStatement.cxx @@ -260,13 +260,13 @@ void OStatement_Base::clearMyResultSet () throw (SQLException) m_xResultSet = Reference< XResultSet >(); } //-------------------------------------------------------------------- -sal_Int32 OStatement_Base::getRowCount () throw( SQLException) +SQLLEN OStatement_Base::getRowCount () throw( SQLException) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); - sal_Int32 numRows = 0; + SQLLEN numRows = 0; try { THROW_SQL(N3SQLRowCount(m_aStatementHandle,&numRows)); @@ -533,7 +533,9 @@ Sequence< sal_Int32 > SAL_CALL OStatement::executeBatch( ) throw(SQLException, SQLRETURN nError = N3SQLMoreResults(m_aStatementHandle); if(nError == SQL_SUCCESS) { - N3SQLRowCount(m_aStatementHandle,&pArray[j]); + SQLLEN nRowCount=0; + N3SQLRowCount(m_aStatementHandle,&nRowCount); + pArray[j] = nRowCount; } } return aRet; diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx index a7ac4ebf4d78..39c848f34eaf 100644 --- a/connectivity/source/drivers/odbcbase/OTools.cxx +++ b/connectivity/source/drivers/odbcbase/OTools.cxx @@ -56,16 +56,16 @@ void OTools::getValue( OConnection* _pConnection, sal_Bool &_bWasNull, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, void* _pValue, - SQLINTEGER _rSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) + SQLLEN _nSize) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::getValue" ); - SQLINTEGER pcbValue = SQL_NULL_DATA; + SQLLEN pcbValue = SQL_NULL_DATA; OTools::ThrowException(_pConnection, (*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, (SQLUSMALLINT)columnIndex, _nType, _pValue, - (SQLINTEGER)_rSize, + _nSize, &pcbValue), _aStatementHandle,SQL_HANDLE_STMT,_xInterface,sal_False); _bWasNull = pcbValue == SQL_NULL_DATA; @@ -86,12 +86,12 @@ void OTools::bindParameter( OConnection* _pConnection, { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindParameter" ); SQLRETURN nRetcode; - SWORD fSqlType; - SWORD fCType; - SDWORD nMaxLen = 0; + SQLSMALLINT fSqlType; + SQLSMALLINT fCType; + SQLLEN nMaxLen = 0; // void*& pData = pDataBuffer; - SQLINTEGER* pLen = (SQLINTEGER*)pLenBuffer; - SQLUINTEGER nColumnSize=0; + SQLLEN* pLen = (SQLLEN*)pLenBuffer; + SQLULEN nColumnSize=0; SQLSMALLINT nDecimalDigits=0; OTools::getBindTypes(_bUseWChar,_bUseOldTimeDate,_nODBCtype,fCType,fSqlType); @@ -123,10 +123,10 @@ void OTools::bindParameter( OConnection* _pConnection, void OTools::bindData( SQLSMALLINT _nOdbcType, sal_Bool _bUseWChar, sal_Int8 *&_pData, - SQLINTEGER*& pLen, + SQLLEN*& pLen, const void* _pValue, rtl_TextEncoding _nTextEncoding, - SQLUINTEGER& _nColumnSize) + SQLULEN& _nColumnSize) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::bindData" ); _nColumnSize = 0; @@ -222,7 +222,7 @@ void OTools::bindData( SQLSMALLINT _nOdbcType, { sal_Int32 nLen = 0; nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength(); - *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); + *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); } break; case SQL_LONGVARCHAR: @@ -235,21 +235,21 @@ void OTools::bindData( SQLSMALLINT _nOdbcType, ::rtl::OString aString(::rtl::OUStringToOString(*(::rtl::OUString*)_pValue,_nTextEncoding)); nLen = aString.getLength(); } - *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); + *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); } break; case SQL_DATE: *(DATE_STRUCT*)_pData = *(DATE_STRUCT*)_pValue; - *pLen = (SDWORD)sizeof(DATE_STRUCT); + *pLen = (SQLLEN)sizeof(DATE_STRUCT); _nColumnSize = 10; break; case SQL_TIME: *(TIME_STRUCT*)_pData = *(TIME_STRUCT*)_pValue; - *pLen = (SDWORD)sizeof(TIME_STRUCT); + *pLen = (SQLLEN)sizeof(TIME_STRUCT); _nColumnSize = 8; break; case SQL_TIMESTAMP: *(TIMESTAMP_STRUCT*)_pData = *(TIMESTAMP_STRUCT*)_pValue; - *pLen = (SDWORD)sizeof(TIMESTAMP_STRUCT); + *pLen = (SQLLEN)sizeof(TIMESTAMP_STRUCT); _nColumnSize = 19; break; } @@ -262,7 +262,7 @@ void OTools::bindValue( OConnection* _pConnection, SQLSMALLINT _nMaxLen, const void* _pValue, void* _pData, - SQLINTEGER *pLen, + SQLLEN *pLen, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xInterface, rtl_TextEncoding _nTextEncoding, sal_Bool _bUseOldTimeDate) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) @@ -271,7 +271,7 @@ void OTools::bindValue( OConnection* _pConnection, SQLRETURN nRetcode; SQLSMALLINT fSqlType; SQLSMALLINT fCType; - SQLSMALLINT nMaxLen = _nMaxLen; + SQLLEN nMaxLen = _nMaxLen; OTools::getBindTypes( sal_False, _bUseOldTimeDate, @@ -375,7 +375,7 @@ void OTools::bindValue( OConnection* _pConnection, _pData = (void*)(columnIndex); sal_Int32 nLen = 0; nLen = ((const ::com::sun::star::uno::Sequence< sal_Int8 > *)_pValue)->getLength(); - *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); + *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); } break; case SQL_LONGVARCHAR: @@ -383,7 +383,7 @@ void OTools::bindValue( OConnection* _pConnection, _pData = (void*)(columnIndex); sal_Int32 nLen = 0; nLen = ((::rtl::OUString*)_pValue)->getLength(); - *pLen = (SDWORD)SQL_LEN_DATA_AT_EXEC(nLen); + *pLen = (SQLLEN)SQL_LEN_DATA_AT_EXEC(nLen); } break; case SQL_DATE: *pLen = sizeof(DATE_STRUCT); @@ -446,10 +446,10 @@ void OTools::ThrowException(OConnection* _pConnection, RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "odbc", "Ocke.Janssen@sun.com", "OTools::ThrowException" ); SDB_ODBC_CHAR szSqlState[5]; - SDWORD pfNativeError; + SQLINTEGER pfNativeError; SDB_ODBC_CHAR szErrorMessage[SQL_MAX_MESSAGE_LENGTH]; szErrorMessage[0] = '\0'; - SWORD pcbErrorMsg = 0; + SQLSMALLINT pcbErrorMsg = 0; // Informationen zur letzten Operation: // wenn hstmt != SQL_NULL_HSTMT ist (Benutzung von SetStatus in SdbCursor, SdbTable, ...), @@ -478,7 +478,7 @@ void OTools::ThrowException(OConnection* _pConnection, Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection, SQLHANDLE _aStatementHandle, sal_Int32 columnIndex, - SWORD _fSqlType, + SQLSMALLINT _fSqlType, sal_Bool &_bWasNull, const Reference< XInterface >& _xInterface) throw(SQLException, RuntimeException) { @@ -486,14 +486,14 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection, char aCharArray[2048]; // Erstmal versuchen, die Daten mit dem kleinen Puffer // abzuholen: - SQLINTEGER nMaxLen = sizeof aCharArray - 1; + SQLLEN nMaxLen = sizeof aCharArray - 1; // GETDATA(SQL_C_CHAR,aCharArray,nMaxLen); - SQLINTEGER pcbValue = 0; + SQLLEN pcbValue = 0; OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, (SQLUSMALLINT)columnIndex, _fSqlType, (SQLPOINTER)aCharArray, - (SQLINTEGER)nMaxLen, + nMaxLen, &pcbValue), _aStatementHandle,SQL_HANDLE_STMT,_xInterface); @@ -540,7 +540,7 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection, ::rtl::OUString OTools::getStringValue(OConnection* _pConnection, SQLHANDLE _aStatementHandle, sal_Int32 columnIndex, - SWORD _fSqlType, + SQLSMALLINT _fSqlType, sal_Bool &_bWasNull, const Reference< XInterface >& _xInterface, rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException) @@ -555,15 +555,15 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection, { sal_Unicode waCharArray[2048]; // read the unicode data - sal_Int32 nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1; + SQLLEN nMaxLen = (sizeof(waCharArray) / sizeof(sal_Unicode)) - 1; // GETDATA(SQL_C_WCHAR, waCharArray, nMaxLen + sizeof(sal_Unicode)); - SQLINTEGER pcbValue=0; + SQLLEN pcbValue=0; OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, (SQLUSMALLINT)columnIndex, SQL_C_WCHAR, &waCharArray, - (SQLINTEGER)nMaxLen*sizeof(sal_Unicode), + (SQLLEN)nMaxLen*sizeof(sal_Unicode), &pcbValue), _aStatementHandle,SQL_HANDLE_STMT,_xInterface); _bWasNull = pcbValue == SQL_NULL_DATA; @@ -571,10 +571,10 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection, return ::rtl::OUString(); // Bei Fehler bricht der GETDATA-Makro mit return ab, // bei NULL mit break! - SQLINTEGER nRealSize = 0; + SQLLEN nRealSize = 0; if ( pcbValue > -1 ) nRealSize = pcbValue / sizeof(sal_Unicode); - SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1); + SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(nRealSize, nMaxLen) : (nMaxLen-1); waCharArray[nLen] = 0; aData.append(waCharArray,nLen); @@ -598,7 +598,7 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection, (SQLUSMALLINT)columnIndex, SQL_C_WCHAR, &waCharArray, - (SQLINTEGER)nLen+1, + (SQLLEN)nLen+1, &pcbValue), _aStatementHandle,SQL_HANDLE_STMT,_xInterface); nRealSize = 0; @@ -616,21 +616,21 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection, char aCharArray[2048]; // Erstmal versuchen, die Daten mit dem kleinen Puffer // abzuholen: - SDWORD nMaxLen = sizeof aCharArray - 1; + SQLLEN nMaxLen = sizeof aCharArray - 1; // GETDATA(SQL_C_CHAR,aCharArray,nMaxLen); - SQLINTEGER pcbValue = 0; + SQLLEN pcbValue = 0; OTools::ThrowException(_pConnection,(*(T3SQLGetData)_pConnection->getOdbcFunction(ODBC3SQLGetData))(_aStatementHandle, (SQLUSMALLINT)columnIndex, SQL_C_CHAR, &aCharArray, - (SQLINTEGER)nMaxLen, + nMaxLen, &pcbValue), _aStatementHandle,SQL_HANDLE_STMT,_xInterface); _bWasNull = pcbValue == SQL_NULL_DATA; if(_bWasNull) return ::rtl::OUString(); - SQLINTEGER nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1); + SQLLEN nLen = pcbValue != SQL_NO_TOTAL ? std::min(pcbValue, nMaxLen) : (nMaxLen-1); aCharArray[nLen] = 0; if ( ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen) && aCharArray[nLen-1] == 0 && nLen > 0 ) --nLen; |