summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-06-30 12:13:35 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-07-04 06:51:06 +0000
commit3cc30343bef48c7f19a3b6774cfd500e00258f76 (patch)
tree60c7a4e741685717029adcfa7e53675193477b61
parent7855ea48309ee2ba06ee5f3d5dac27ecfc4ca4a6 (diff)
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>
-rw-r--r--connectivity/source/drivers/odbc/OTools.cxx2
-rw-r--r--connectivity/source/drivers/postgresql/pq_baseresultset.cxx2
-rw-r--r--connectivity/source/drivers/postgresql/pq_preparedstatement.cxx2
-rw-r--r--connectivity/source/drivers/postgresql/pq_statement.cxx2
4 files changed, 4 insertions, 4 deletions
diff --git a/connectivity/source/drivers/odbc/OTools.cxx b/connectivity/source/drivers/odbc/OTools.cxx
index 3b4d5f09bea1..228cc90f4c7e 100644
--- a/connectivity/source/drivers/odbc/OTools.cxx
+++ b/connectivity/source/drivers/odbc/OTools.cxx
@@ -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);
diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
index 88c2057499c5..71cb91b0b4be 100644
--- a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
@@ -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;
}
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
index 86a3a6741d9f..c5bbd045433b 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
@@ -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;
}
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx
index 113adb422c19..b1297ef1a7f6 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -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;
}