connectivity/source/drivers/odbc/OTools.cxx                     |    2 +-
 connectivity/source/drivers/postgresql/pq_baseresultset.cxx     |    2 +-
 connectivity/source/drivers/postgresql/pq_preparedstatement.cxx |    2 +-
 connectivity/source/drivers/postgresql/pq_statement.cxx         |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 3cc30343bef48c7f19a3b6774cfd500e00258f76
Author: Jochen Nitschke <j.nitschke+loger...@ok.de>
Date:   Thu Jun 30 12:13:35 2016 +0200

    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 <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noelgran...@gmail.com>

diff --git a/connectivity/source/drivers/odbc/OTools.cxx 
b/connectivity/source/drivers/odbc/OTools.cxx
index 3b4d5f0..228cc90 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 88c2057..71cb91b 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 86a3a67..c5bbd04 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 113adb4..b1297ef 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;
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to