[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - store/Library_store.mk store/source store/workben

Stephan Bergmann sbergman at redhat.com
Mon Aug 12 23:08:05 PDT 2013


 store/Library_store.mk    |    2 ++
 store/source/storbase.hxx |   21 ++++-----------------
 store/source/storbios.cxx |    5 ++++-
 store/source/storcach.cxx |    7 +++++--
 store/source/stordata.hxx |    9 ++++++---
 store/source/stortree.hxx |    5 ++++-
 store/workben/t_page.cxx  |    5 ++++-
 7 files changed, 29 insertions(+), 25 deletions(-)

New commits:
commit 3a7a2012e16a3f5bcb9be42c4e3a78718216c862
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sat Mar 9 12:49:26 2013 +0100

    WaE: Use BOOST_STATIC_ASSERT
    
    (cherry picked from commit e4b99f5d445903e1309c301cc327d2dfb23d8d71)
    
    Change-Id: Ib9dc2541c3bf72ddd6094331297a91352138e5af
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/store/Library_store.mk b/store/Library_store.mk
index f66c1eb..11c822e 100644
--- a/store/Library_store.mk
+++ b/store/Library_store.mk
@@ -28,6 +28,8 @@ $(eval $(call gb_Library_Library,store))
 
 $(eval $(call gb_Library_set_soversion_script,store,3,$(SRCDIR)/store/util/store.map))
 
+$(eval $(call gb_Library_use_external,store,boost_headers))
+
 $(eval $(call gb_Library_use_packages,store,\
 	store_inc \
 ))
diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx
index 7c07dba..cbd4fc5 100644
--- a/store/source/storbase.hxx
+++ b/store/source/storbase.hxx
@@ -20,6 +20,9 @@
 #ifndef _STORE_STORBASE_HXX_
 #define _STORE_STORBASE_HXX_
 
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
 #include "sal/types.h"
 
 #include "rtl/alloc.h"
@@ -49,22 +52,6 @@
 #define STORE_IMPL_CONCAT2(x, y) x##y
 #endif
 
-#ifndef STORE_STATIC_ASSERT /* Compile time assertion */
-namespace store
-{
-    template< bool x > struct STATIC_ASSERTION_FAILURE;
-    template<> struct STATIC_ASSERTION_FAILURE< true > { enum { value = 1 }; };
-
-    template< int x > struct static_assert_test{};
-} // namespace store
-
-#define STORE_STATIC_ASSERT(pred) \
-typedef \
-store::static_assert_test< sizeof( store::STATIC_ASSERTION_FAILURE< (bool)(pred) > ) > \
-STORE_IMPL_CONCAT(static_assert_typedef_, __LINE__)
-
-#endif  /* !STORE_STATIC_ASSERT */
-
 namespace store
 {
 
@@ -437,7 +424,7 @@ struct PageData
      */
     static const size_t     theSize     = sizeof(G) + sizeof(D) + 2 * sizeof(L);
     static const sal_uInt16 thePageSize = theSize;
-    STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
+    BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
 
     /** location.
      */
diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx
index 2cdbece..b773c5d 100644
--- a/store/source/storbios.cxx
+++ b/store/source/storbios.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
 
 #include "storbios.hxx"
 
@@ -182,7 +185,7 @@ struct SuperBlockPage
      */
     static const size_t     theSize     = 2 * SuperBlock::theSize;
     static const sal_uInt16 thePageSize = theSize;
-    STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
+    BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
 
     /** Allocation.
      */
diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx
index e07aa7f..481177e 100644
--- a/store/source/storcach.cxx
+++ b/store/source/storcach.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
 
 #include "storcach.hxx"
 
@@ -256,7 +259,7 @@ class PageCache_Impl :
     /** Representation.
      */
     static size_t const theTableSize = 32;
-    STORE_STATIC_ASSERT(STORE_IMPL_ISP2(theTableSize));
+    BOOST_STATIC_ASSERT(STORE_IMPL_ISP2(theTableSize));
 
     Entry **     m_hash_table;
     Entry *      m_hash_table_0[theTableSize];
@@ -330,7 +333,7 @@ PageCache_Impl::PageCache_Impl (sal_uInt16 nPageSize)
       m_nMissed      (0)
 {
     static size_t const theSize = SAL_N_ELEMENTS(m_hash_table_0);
-    STORE_STATIC_ASSERT(theSize == theTableSize);
+    BOOST_STATIC_ASSERT(theSize == theTableSize);
     memset(m_hash_table_0, 0, sizeof(m_hash_table_0));
 }
 
diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx
index cbd0044..88f8f74 100644
--- a/store/source/stordata.hxx
+++ b/store/source/stordata.hxx
@@ -20,6 +20,9 @@
 #ifndef _STORE_STORDATA_HXX_
 #define _STORE_STORDATA_HXX_
 
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
 #include "sal/types.h"
 #include "sal/macros.h"
 
@@ -55,7 +58,7 @@ struct OStoreDataPageData : public store::OStorePageData
     */
     static const size_t     theSize     = 0;
     static const sal_uInt16 thePageSize = base::theSize + self::theSize;
-    STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+    BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
 
     /** capacity.
     */
@@ -145,7 +148,7 @@ struct OStoreIndirectionPageData : public store::OStorePageData
      */
     static const size_t     theSize     = sizeof(G);
     static const sal_uInt16 thePageSize = base::theSize + self::theSize;
-    STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+    BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
 
     /** capacity.
     */
@@ -570,7 +573,7 @@ struct OStoreDirectoryPageData : public store::OStorePageData
      */
     static const size_t     theSize     = NameBlock::theSize + DataBlock::theSize;
     static const sal_uInt16 thePageSize = base::theSize + self::theSize;
-    STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+    BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
 
     /** capacity.
     */
diff --git a/store/source/stortree.hxx b/store/source/stortree.hxx
index f057bac..54768a1 100644
--- a/store/source/stortree.hxx
+++ b/store/source/stortree.hxx
@@ -20,6 +20,9 @@
 #ifndef _STORE_STORTREE_HXX
 #define _STORE_STORTREE_HXX
 
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
 #include "sal/types.h"
 
 #include "store/types.h"
@@ -120,7 +123,7 @@ struct OStoreBTreeNodeData : public store::OStorePageData
      */
     static const size_t     theSize     = sizeof(G);
     static const sal_uInt16 thePageSize = base::theSize + self::theSize;
-    STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+    BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
 
     /** capacity.
     */
diff --git a/store/workben/t_page.cxx b/store/workben/t_page.cxx
index 83be150..9aa5fd7 100644
--- a/store/workben/t_page.cxx
+++ b/store/workben/t_page.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include "sal/config.h"
+
+#include "boost/static_assert.hpp"
 #include "osl/diagnose.h"
 #include "rtl/alloc.h"
 #include "rtl/ref.hxx"
@@ -156,7 +159,7 @@ struct PageData
      */
     static const size_t     theSize     = sizeof(G) + sizeof(D) + 2 * sizeof(L);
     static const sal_uInt16 thePageSize = theSize;
-    STORE_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
+    BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
 
     /** type.
      */


More information about the Libreoffice-commits mailing list