[Libreoffice-commits] core.git: connectivity/inc connectivity/source

Caolán McNamara caolanm at redhat.com
Thu Feb 5 12:42:25 PST 2015


 connectivity/inc/pch/precompiled_dbtools.hxx         |    1 -
 connectivity/inc/pch/precompiled_odbc.hxx            |    1 -
 connectivity/source/commontools/FValue.cxx           |    1 -
 connectivity/source/drivers/odbc/OResultSet.cxx      |   11 +++++------
 connectivity/source/drivers/odbc/OTools.cxx          |    7 +++----
 connectivity/source/drivers/odbc/appendsqlwchars.cxx |    3 +--
 connectivity/source/parse/sqlnode.cxx                |    3 +--
 7 files changed, 10 insertions(+), 17 deletions(-)

New commits:
commit 37ebeabd4d0cfa33c76060781ffc5f1db427461f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 5 20:40:42 2015 +0000

    BOOST_STATIC_ASSERT->static_assert and drop some includes
    
    Change-Id: I74955a05bf13f7b33650d11c5cf4b1388382da2a

diff --git a/connectivity/inc/pch/precompiled_dbtools.hxx b/connectivity/inc/pch/precompiled_dbtools.hxx
index e3c4c6d..99c4bd5 100644
--- a/connectivity/inc/pch/precompiled_dbtools.hxx
+++ b/connectivity/inc/pch/precompiled_dbtools.hxx
@@ -21,7 +21,6 @@
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/spirit/include/classic_core.hpp>
-#include <boost/static_assert.hpp>
 #include <boost/type_traits.hpp>
 #include <com/sun/star/awt/XWindow.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
diff --git a/connectivity/inc/pch/precompiled_odbc.hxx b/connectivity/inc/pch/precompiled_odbc.hxx
index fe7c404..218805b 100644
--- a/connectivity/inc/pch/precompiled_odbc.hxx
+++ b/connectivity/inc/pch/precompiled_odbc.hxx
@@ -17,7 +17,6 @@
 #include "stdio.h"
 #include <algorithm>
 #include <boost/scoped_ptr.hpp>
-#include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_reference.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index 8e63f87..b16078d 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -27,7 +27,6 @@
 #include <com/sun/star/io/XInputStream.hpp>
 #include <rtl/ustrbuf.hxx>
 #include <boost/type_traits.hpp>
-#include <boost/static_assert.hpp>
 
 using namespace ::dbtools;
 using namespace ::com::sun::star::sdbc;
diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx b/connectivity/source/drivers/odbc/OResultSet.cxx
index 79e6afc..211aa33 100644
--- a/connectivity/source/drivers/odbc/OResultSet.cxx
+++ b/connectivity/source/drivers/odbc/OResultSet.cxx
@@ -36,7 +36,6 @@
 #include <connectivity/dbtools.hxx>
 #include <connectivity/dbexception.hxx>
 #include "diagnose_ex.h"
-#include <boost/static_assert.hpp>
 
 #include <o3tl/compat_functional.hxx>
 
@@ -54,10 +53,10 @@ using namespace com::sun::star::io;
 using namespace com::sun::star::util;
 
 #define ODBC_SQL_NOT_DEFINED    99UL
-BOOST_STATIC_ASSERT( ODBC_SQL_NOT_DEFINED != SQL_UB_OFF );
-BOOST_STATIC_ASSERT( ODBC_SQL_NOT_DEFINED != SQL_UB_ON );
-BOOST_STATIC_ASSERT( ODBC_SQL_NOT_DEFINED != SQL_UB_FIXED );
-BOOST_STATIC_ASSERT( ODBC_SQL_NOT_DEFINED != SQL_UB_VARIABLE );
+static_assert(ODBC_SQL_NOT_DEFINED != SQL_UB_OFF, "ODBC_SQL_NOT_DEFINED must be unique");
+static_assert(ODBC_SQL_NOT_DEFINED != SQL_UB_ON, "ODBC_SQL_NOT_DEFINED must be unique");
+static_assert(ODBC_SQL_NOT_DEFINED != SQL_UB_FIXED, "ODBC_SQL_NOT_DEFINED must be unique");
+static_assert(ODBC_SQL_NOT_DEFINED != SQL_UB_VARIABLE, "ODBC_SQL_NOT_DEFINED must be unique");
 
 namespace
 {
@@ -838,7 +837,7 @@ void SAL_CALL OResultSet::insertRow(  ) throw(SQLException, RuntimeException, st
 
     SQLLEN nRealLen = 0;
     Sequence<sal_Int8> aBookmark(nMaxBookmarkLen);
-    BOOST_STATIC_ASSERT(static_cast<size_t>(nMaxBookmarkLen) >= sizeof(SQLLEN));
+    static_assert(static_cast<size_t>(nMaxBookmarkLen) >= sizeof(SQLLEN), "must be larger");
 
     SQLRETURN nRet = N3SQLBindCol(m_aStatementHandle,
                                 0,
diff --git a/connectivity/source/drivers/odbc/OTools.cxx b/connectivity/source/drivers/odbc/OTools.cxx
index d8533e4..308bdfa 100644
--- a/connectivity/source/drivers/odbc/OTools.cxx
+++ b/connectivity/source/drivers/odbc/OTools.cxx
@@ -24,7 +24,6 @@
 #include "odbc/OConnection.hxx"
 #include "diagnose_ex.h"
 #include <rtl/ustrbuf.hxx>
-#include <boost/static_assert.hpp>
 
 #include <appendsqlwchars.hxx>
 
@@ -416,12 +415,12 @@ OUString OTools::getStringValue(OConnection* _pConnection,
     case SQL_WLONGVARCHAR:
     {
         SQLWCHAR waCharArray[2048];
-        BOOST_STATIC_ASSERT(sizeof(waCharArray) % sizeof(SQLWCHAR) == 0);
-        BOOST_STATIC_ASSERT(sizeof(SQLWCHAR) == 2 || sizeof(SQLWCHAR) == 4);
+        static_assert(sizeof(waCharArray) % sizeof(SQLWCHAR) == 0, "must fit in evenly");
+        static_assert(sizeof(SQLWCHAR) == 2 || sizeof(SQLWCHAR) == 4, "must be 2 or 4");
         // Size == number of bytes, Len == number of UTF-16 or UCS4 code units
         const SQLLEN nMaxSize = sizeof(waCharArray);
         const SQLLEN nMaxLen  = sizeof(waCharArray) / sizeof(SQLWCHAR);
-        BOOST_STATIC_ASSERT(nMaxLen * sizeof(SQLWCHAR) == nMaxSize);
+        static_assert(nMaxLen * sizeof(SQLWCHAR) == nMaxSize, "sizes must match");
 
         // read the unicode data
         SQLLEN pcbValue = SQL_NO_TOTAL;
diff --git a/connectivity/source/drivers/odbc/appendsqlwchars.cxx b/connectivity/source/drivers/odbc/appendsqlwchars.cxx
index 8a62db3..5445738 100644
--- a/connectivity/source/drivers/odbc/appendsqlwchars.cxx
+++ b/connectivity/source/drivers/odbc/appendsqlwchars.cxx
@@ -9,7 +9,6 @@
 
 #include <sal/config.h>
 
-#include <boost/static_assert.hpp>
 #include <rtl/ustrbuf.hxx>
 #include <sal/types.h>
 
@@ -23,7 +22,7 @@ void appendSQLWCHARs(OUStringBuffer & s, const sal_Unicode* d, sal_Int32 n)
 }
 
 #if defined SAL_UNICODE_NOTEQUAL_WCHAR_T
-BOOST_STATIC_ASSERT(sizeof (wchar_t) == 4);
+static_assert(sizeof (wchar_t) == 4, "sizeof wchar_t must be 4 for this to work");
 void appendSQLWCHARs(OUStringBuffer & s, const wchar_t* d, sal_Int32 n)
 {
     const wchar_t * const end = d + n;
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 1c8c3e6..6f674fc 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -55,7 +55,6 @@
 #include <string.h>
 #include <boost/bind.hpp>
 #include <boost/scoped_ptr.hpp>
-#include <boost/static_assert.hpp>
 #include <algorithm>
 #include <functional>
 #include <rtl/ustrbuf.hxx>
@@ -1343,7 +1342,7 @@ OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star:
             s_xLocaleData = LocaleData::create(m_xContext);
 
         // reset to UNKNOWN_RULE
-        BOOST_STATIC_ASSERT(OSQLParseNode::UNKNOWN_RULE==0);
+        static_assert(OSQLParseNode::UNKNOWN_RULE==0, "UNKNOWN_RULE must be 0 for memset to 0 to work");
         memset(OSQLParser::s_nRuleIDs,0,sizeof(OSQLParser::s_nRuleIDs));
 
         struct


More information about the Libreoffice-commits mailing list