Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e4b99f5d
Kaydet (Commit)
e4b99f5d
authored
Mar 09, 2013
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use BOOST_STATIC_ASSERT
Change-Id: Ib9dc2541c3bf72ddd6094331297a91352138e5af
üst
de69091d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
25 deletions
+29
-25
Library_store.mk
store/Library_store.mk
+2
-0
storbase.hxx
store/source/storbase.hxx
+4
-17
storbios.cxx
store/source/storbios.cxx
+4
-1
storcach.cxx
store/source/storcach.cxx
+5
-2
stordata.hxx
store/source/stordata.hxx
+6
-3
stortree.hxx
store/source/stortree.hxx
+4
-1
t_page.cxx
store/workben/t_page.cxx
+4
-1
No files found.
store/Library_store.mk
Dosyayı görüntüle @
e4b99f5d
...
...
@@ -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_odk_headers \
))
...
...
store/source/storbase.hxx
Dosyayı görüntüle @
e4b99f5d
...
...
@@ -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.
*/
...
...
store/source/storbios.cxx
Dosyayı görüntüle @
e4b99f5d
...
...
@@ -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.
*/
...
...
store/source/storcach.cxx
Dosyayı görüntüle @
e4b99f5d
...
...
@@ -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
));
}
...
...
store/source/stordata.hxx
Dosyayı görüntüle @
e4b99f5d
...
...
@@ -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.
*/
...
...
store/source/stortree.hxx
Dosyayı görüntüle @
e4b99f5d
...
...
@@ -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.
*/
...
...
store/workben/t_page.cxx
Dosyayı görüntüle @
e4b99f5d
...
...
@@ -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.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment