tdf#43157 clean up OSL_ASSERT in connectivity
replace with compile time checks Change-Id: I9f3dd3b44fe0aa953feaa34a1bc0ccbdc3600899 Reviewed-on: https://gerrit.libreoffice.org/26801 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
parent
7855ea4830
commit
3cc30343be
@ -51,7 +51,7 @@ size_t sqlTypeLen ( SQLSMALLINT _nType )
|
||||
case SQL_C_FLOAT:
|
||||
return sizeof(SQLREAL);
|
||||
case SQL_C_DOUBLE:
|
||||
OSL_ENSURE(sizeof(SQLDOUBLE) == sizeof(SQLFLOAT), "SQLDOUBLE/SQLFLOAT confusion");
|
||||
static_assert(sizeof(SQLDOUBLE) == sizeof(SQLFLOAT), "SQLDOUBLE/SQLFLOAT confusion");
|
||||
return sizeof(SQLDOUBLE);
|
||||
case SQL_C_BIT:
|
||||
return sizeof(SQLCHAR);
|
||||
|
@ -116,7 +116,7 @@ static ::cppu::IPropertyArrayHelper & getResultSetPropertyArrayHelper()
|
||||
OUString("ResultSetType"), 6,
|
||||
::cppu::UnoType<sal_Int32>::get() , 0 )
|
||||
};
|
||||
OSL_ASSERT( sizeof(aTable) / sizeof(Property) == BASERESULTSET_SIZE );
|
||||
static_assert( SAL_N_ELEMENTS(aTable) == BASERESULTSET_SIZE, "wrong number of elements" );
|
||||
static ::cppu::OPropertyArrayHelper arrayHelper( aTable, BASERESULTSET_SIZE, true );
|
||||
pArrayHelper = &arrayHelper;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ static ::cppu::IPropertyArrayHelper & getPreparedStatementPropertyArrayHelper()
|
||||
OUString("ResultSetType"), 8,
|
||||
::cppu::UnoType<sal_Int32>::get() , 0 )
|
||||
};
|
||||
OSL_ASSERT( sizeof(aTable)/ sizeof(Property) == PREPARED_STATEMENT_SIZE );
|
||||
static_assert( SAL_N_ELEMENTS(aTable) == PREPARED_STATEMENT_SIZE, "wrong number of elements" );
|
||||
static ::cppu::OPropertyArrayHelper arrayHelper( aTable, PREPARED_STATEMENT_SIZE, true );
|
||||
pArrayHelper = &arrayHelper;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ static ::cppu::IPropertyArrayHelper & getStatementPropertyArrayHelper()
|
||||
OUString("ResultSetType"), 8,
|
||||
::cppu::UnoType<sal_Int32>::get() , 0 )
|
||||
};
|
||||
OSL_ASSERT( sizeof(aTable)/ sizeof(Property) == STATEMENT_SIZE );
|
||||
static_assert( SAL_N_ELEMENTS(aTable) == STATEMENT_SIZE, "wrong number of elements" );
|
||||
static ::cppu::OPropertyArrayHelper arrayHelper( aTable, STATEMENT_SIZE, true );
|
||||
pArrayHelper = &arrayHelper;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user