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:
Jochen Nitschke 2016-06-30 12:13:35 +02:00 committed by Noel Grandin
parent 7855ea4830
commit 3cc30343be
4 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}