summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-05 20:54:12 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-05 22:21:49 +0000
commit4d6a509efe6bd56613b5554556d3a4f7f4cfd0d5 (patch)
tree22fc10679131c72993615d0fa634460d14a15ec8
parent076b098ddf80fc78773d3ed97b7fd50dbcb4ebb6 (diff)
convert all remaining BOOST_STATIC_ASSERT to static_assert
and we can include a few less headers Change-Id: Id742849ff4c1c37a2b861aa3d6ab823f00ea87f8
-rw-r--r--bridges/source/cpp_uno/gcc3_ios_arm/except.cxx5
-rw-r--r--bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx1
-rw-r--r--bridges/source/jni_uno/jni_bridge.cxx25
-rw-r--r--codemaker/source/javamaker/classfile.cxx5
-rw-r--r--comphelper/inc/pch/precompiled_comphelper.hxx1
-rw-r--r--comphelper/source/xml/xmltools.cxx3
-rw-r--r--connectivity/source/drivers/odbc/OPreparedStatement.cxx7
-rw-r--r--connectivity/source/parse/sqlnode.cxx2
-rw-r--r--cppu/source/uno/data.cxx11
-rw-r--r--include/basebmp/packedpixeliterator.hxx9
-rw-r--r--include/oox/helper/helper.hxx4
-rw-r--r--sal/cppunittester/cppunittester.cxx3
-rw-r--r--sal/rtl/strtmpl.cxx5
-rw-r--r--sal/textenc/tables.cxx8
-rw-r--r--sc/inc/global.hxx5
-rw-r--r--sc/inc/pch/precompiled_sc.hxx1
-rw-r--r--sc/source/core/data/docpool.cxx5
-rw-r--r--stoc/source/javaloader/javaloader.cxx6
-rw-r--r--store/source/storbase.hxx3
-rw-r--r--store/source/storbios.cxx4
-rw-r--r--store/source/storcach.cxx5
-rw-r--r--store/source/stordata.hxx7
-rw-r--r--store/source/stortree.hxx3
-rw-r--r--svtools/inc/pch/precompiled_svt.hxx1
-rw-r--r--svtools/source/misc/langtab.cxx2
-rw-r--r--svx/source/dialog/langbox.cxx4
-rw-r--r--sw/inc/pch/precompiled_msword.hxx1
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx3
-rw-r--r--sw/source/filter/ww8/ww8struc.hxx11
-rw-r--r--tools/inc/pch/precompiled_tl.hxx1
-rw-r--r--tools/source/stream/stream.cxx2
-rw-r--r--unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx3
-rw-r--r--vcl/generic/glyphs/gcach_layout.cxx2
-rw-r--r--vcl/inc/pch/precompiled_vcl.hxx1
-rw-r--r--vcl/source/filter/sgvtext.cxx7
35 files changed, 58 insertions, 108 deletions
diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx
index 8085445856f3..9af0e321992c 100644
--- a/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx
@@ -21,7 +21,6 @@
#include <dlfcn.h>
-#include <boost/static_assert.hpp>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/mutex.hxx>
@@ -48,8 +47,8 @@ struct Fake_type_info {
char const * name;
};
-BOOST_STATIC_ASSERT(
- sizeof (Fake_type_info) == sizeof (std::type_info));
+static_assert(
+ sizeof (Fake_type_info) == sizeof (std::type_info), "must be the same size");
struct Fake_class_type_info: Fake_type_info {};
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
index 8055a8b8e754..7132c4673370 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
@@ -27,7 +27,6 @@
#include <dlfcn.h>
-#include "boost/static_assert.hpp"
#include "com/sun/star/uno/RuntimeException.hpp"
#include "com/sun/star/uno/genfunc.hxx"
#include <sal/log.hxx>
diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx
index 0d37b58d426a..03f0868d4b9b 100644
--- a/bridges/source/jni_uno/jni_bridge.cxx
+++ b/bridges/source/jni_uno/jni_bridge.cxx
@@ -25,7 +25,6 @@
#include "jni_bridge.h"
#include "jniunoenvironmentdata.hxx"
-#include <boost/static_assert.hpp>
#include "jvmaccess/unovirtualmachine.hxx"
#include "rtl/ref.hxx"
#include "rtl/strbuf.hxx"
@@ -64,7 +63,7 @@ void SAL_CALL Mapping_map_to_uno(
uno_Interface ** ppUnoI = (uno_Interface **)ppOut;
jobject javaI = (jobject) pIn;
- BOOST_STATIC_ASSERT( sizeof (void *) == sizeof (jobject) );
+ static_assert(sizeof (void *) == sizeof (jobject), "must be the same size");
assert(ppUnoI != 0);
assert(td != 0);
@@ -123,7 +122,7 @@ void SAL_CALL Mapping_map_to_java(
jobject * ppJavaI = (jobject *) ppOut;
uno_Interface * pUnoI = (uno_Interface *)pIn;
- BOOST_STATIC_ASSERT( sizeof (void *) == sizeof (jobject) );
+ static_assert(sizeof (void *) == sizeof (jobject), "must be the same size");
assert(ppJavaI != 0);
assert(td != 0);
@@ -524,16 +523,16 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping(
*ppMapping = 0;
}
- BOOST_STATIC_ASSERT( JNI_FALSE == sal_False );
- BOOST_STATIC_ASSERT( JNI_TRUE == sal_True );
- BOOST_STATIC_ASSERT( sizeof (jboolean) == sizeof (sal_Bool) );
- BOOST_STATIC_ASSERT( sizeof (jchar) == sizeof (sal_Unicode) );
- BOOST_STATIC_ASSERT( sizeof (jdouble) == sizeof (double) );
- BOOST_STATIC_ASSERT( sizeof (jfloat) == sizeof (float) );
- BOOST_STATIC_ASSERT( sizeof (jbyte) == sizeof (sal_Int8) );
- BOOST_STATIC_ASSERT( sizeof (jshort) == sizeof (sal_Int16) );
- BOOST_STATIC_ASSERT( sizeof (jint) == sizeof (sal_Int32) );
- BOOST_STATIC_ASSERT( sizeof (jlong) == sizeof (sal_Int64) );
+ static_assert(JNI_FALSE == sal_False, "must be equal");
+ static_assert(JNI_TRUE == sal_True, "must be equal");
+ static_assert(sizeof (jboolean) == sizeof (sal_Bool), "must be the same size");
+ static_assert(sizeof (jchar) == sizeof (sal_Unicode), "must be the same size");
+ static_assert(sizeof (jdouble) == sizeof (double), "must be the same size");
+ static_assert(sizeof (jfloat) == sizeof (float), "must be the same size");
+ static_assert(sizeof (jbyte) == sizeof (sal_Int8), "must be the same size");
+ static_assert(sizeof (jshort) == sizeof (sal_Int16), "must be the same size");
+ static_assert(sizeof (jint) == sizeof (sal_Int32), "must be the same size");
+ static_assert(sizeof (jlong) == sizeof (sal_Int64), "must be the same size");
OUString const & from_env_typename =
OUString::unacquired( &pFrom->pTypeName );
diff --git a/codemaker/source/javamaker/classfile.cxx b/codemaker/source/javamaker/classfile.cxx
index 6673b2fa07a6..2c9f35c12d59 100644
--- a/codemaker/source/javamaker/classfile.cxx
+++ b/codemaker/source/javamaker/classfile.cxx
@@ -24,7 +24,6 @@
#include "codemaker/options.hxx"
#include "codemaker/unotype.hxx"
-#include "boost/static_assert.hpp"
#include "osl/diagnose.h"
#include "rtl/string.h"
#include "rtl/string.hxx"
@@ -96,9 +95,9 @@ void writeU4(FileStream & file, sal_uInt32 data) {
void writeStream(FileStream & file, std::vector< unsigned char > const & stream)
{
std::vector< unsigned char >::size_type n = stream.size();
- BOOST_STATIC_ASSERT(
+ static_assert(
sizeof (std::vector< unsigned char >::size_type)
- <= sizeof (sal_uInt64));
+ <= sizeof (sal_uInt64), "must be at most equal in size");
// both unsigned integral, so sizeof is a practically sufficient
// approximation of std::numeric_limits<T1>::max() <=
// std::numeric_limits<T2>::max()
diff --git a/comphelper/inc/pch/precompiled_comphelper.hxx b/comphelper/inc/pch/precompiled_comphelper.hxx
index 5aacf0b62959..7b83f16bf8fb 100644
--- a/comphelper/inc/pch/precompiled_comphelper.hxx
+++ b/comphelper/inc/pch/precompiled_comphelper.hxx
@@ -22,7 +22,6 @@
#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
-#include <boost/static_assert.hpp>
#include <cassert>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
diff --git a/comphelper/source/xml/xmltools.cxx b/comphelper/source/xml/xmltools.cxx
index 83387d56c159..5473873625a8 100644
--- a/comphelper/source/xml/xmltools.cxx
+++ b/comphelper/source/xml/xmltools.cxx
@@ -9,7 +9,6 @@
#include <comphelper/xmltools.hxx>
#include <rtl/random.h>
-#include <boost/static_assert.hpp>
#include <vector>
using namespace com::sun::star;
@@ -60,7 +59,7 @@ namespace
void encodeChaff(std::vector<sal_uInt8> &rChaff)
{
- BOOST_STATIC_ASSERT(sizeof(aChaffEncoder) == 256);
+ static_assert(sizeof(aChaffEncoder) == 256, "this has to cover all chars");
for (std::vector<sal_uInt8>::iterator aI = rChaff.begin(), aEnd = rChaff.end();
aI != aEnd; ++aI)
diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
index 82f5c984b282..47ebd57033d7 100644
--- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
@@ -333,7 +333,7 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_
*
* Our internal OUString storage is always UTF-16, so no conversion to do here.
*/
- BOOST_STATIC_ASSERT(sizeof (SQLWCHAR) == 2 || sizeof (SQLWCHAR) == 4);
+ static_assert(sizeof (SQLWCHAR) == 2 || sizeof (SQLWCHAR) == 4, "must be 2 or 4");
if (sizeof (SQLWCHAR) == 2)
{
nCharLen = _sData.getLength();
@@ -414,17 +414,12 @@ void SAL_CALL OPreparedStatement::setByte( const sal_Int32 parameterIndex, const
setScalarParameter(parameterIndex, DataType::TINYINT, 3, x);
}
-// For older compilers (that do not support partial specialisation of class templates)
-// uncomment if necessary (safe also on compilers that *do* support partial specialisation)
-//BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(DATE_STRUCT);
-//BOOST_STATIC_ASSERT((boost::is_same<DATE_STRUCT, boost::remove_reference<DATE_STRUCT&>::type>::value));
void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const Date& aData ) throw(SQLException, RuntimeException, std::exception)
{
DATE_STRUCT x(OTools::DateToOdbcDate(aData));
setScalarParameter<DATE_STRUCT&>(parameterIndex, DataType::DATE, 10, x);
}
-
void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const css::util::Time& aVal ) throw(SQLException, RuntimeException, std::exception)
{
SQLULEN nColSize;
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index 6f674fc68c6d..2c005160fae4 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1456,7 +1456,7 @@ OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star:
const size_t nRuleMapCount = sizeof( aRuleDescriptions ) / sizeof( aRuleDescriptions[0] );
// added a new rule? Adjust this map!
// +1 for UNKNOWN_RULE
- BOOST_STATIC_ASSERT( nRuleMapCount + 1 == static_cast<size_t>(OSQLParseNode::rule_count) );
+ static_assert(nRuleMapCount + 1 == static_cast<size_t>(OSQLParseNode::rule_count), "must be equal");
for ( size_t mapEntry = 0; mapEntry < nRuleMapCount; ++mapEntry )
{
diff --git a/cppu/source/uno/data.cxx b/cppu/source/uno/data.cxx
index 6b831000a4b8..5a950444024a 100644
--- a/cppu/source/uno/data.cxx
+++ b/cppu/source/uno/data.cxx
@@ -31,9 +31,6 @@
#include "assign.hxx"
#include "eq.hxx"
-#include "boost/static_assert.hpp"
-
-
using namespace ::cppu;
using namespace ::osl;
@@ -488,10 +485,10 @@ public:
};
BinaryCompatible_Impl::BinaryCompatible_Impl()
{
- BOOST_STATIC_ASSERT( ((sal_Bool) true) == sal_True &&
- (1 != 0) == sal_True );
- BOOST_STATIC_ASSERT( ((sal_Bool) false) == sal_False &&
- (1 == 0) == sal_False );
+ static_assert( ((sal_Bool) true) == sal_True &&
+ (1 != 0) == sal_True, "must be binary compatible" );
+ static_assert( ((sal_Bool) false) == sal_False &&
+ (1 == 0) == sal_False, "must be binary compatible" );
#ifdef MAX_ALIGNMENT_4
// max alignment is 4
BINTEST_VERIFYOFFSET( AlignSize_Impl, dDouble, 4 );
diff --git a/include/basebmp/packedpixeliterator.hxx b/include/basebmp/packedpixeliterator.hxx
index 664206240b43..a536cec01012 100644
--- a/include/basebmp/packedpixeliterator.hxx
+++ b/include/basebmp/packedpixeliterator.hxx
@@ -25,7 +25,6 @@
#include <basebmp/nonstandarditerator.hxx>
#include <basebmp/accessortraits.hxx>
-#include <boost/static_assert.hpp>
#include <vigra/metaprogramming.hxx>
#include <vigra/diff2d.hxx>
@@ -39,10 +38,10 @@ template< typename value_type,
typename difference_type >
inline value_type get_mask( difference_type d )
{
- BOOST_STATIC_ASSERT(bits_per_pixel > 0);
- BOOST_STATIC_ASSERT(sizeof(value_type)*8 % bits_per_pixel == 0);
- BOOST_STATIC_ASSERT(sizeof(value_type)*8 / bits_per_pixel > 1);
- BOOST_STATIC_ASSERT(vigra::TypeTraits<value_type>::isPOD::asBool);
+ static_assert(bits_per_pixel > 0, "greater than 0");
+ static_assert(sizeof(value_type)*8 % bits_per_pixel == 0, "value_type");
+ static_assert(sizeof(value_type)*8 / bits_per_pixel > 1, "value_type");
+ static_assert(vigra::TypeTraits<value_type>::isPOD::asBool, "isPOD");
const unsigned int nIntraWordPositions( sizeof(value_type)*8 / bits_per_pixel );
diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx
index 1f5942b80cb1..b19337df8873 100644
--- a/include/oox/helper/helper.hxx
+++ b/include/oox/helper/helper.hxx
@@ -22,7 +22,6 @@
#include <algorithm>
#include <limits>
-#include <boost/static_assert.hpp>
#include <sal/macros.h>
#include <osl/endian.h>
#include <rtl/math.hxx>
@@ -113,8 +112,7 @@ inline ReturnType getLimitedValue( Type nValue, Type nMin, Type nMax )
template< typename ReturnType, typename Type >
inline ReturnType getIntervalValue( Type nValue, Type nBegin, Type nEnd )
{
-// this BOOST_STATIC_ASSERT fails with suncc
-// BOOST_STATIC_ASSERT( ::std::numeric_limits< Type >::is_integer );
+ static_assert(::std::numeric_limits< Type >::is_integer, "is integer");
Type nInterval = nEnd - nBegin;
Type nCount = (nValue < nBegin) ? -((nBegin - nValue - 1) / nInterval + 1) : ((nValue - nBegin) / nInterval);
return static_cast< ReturnType >( nValue - nCount * nInterval );
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index 59aee5ac053f..2e791f240d7a 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -49,7 +49,6 @@
#include "boost/noncopyable.hpp"
#include <boost/scoped_array.hpp>
-#include "boost/static_assert.hpp"
namespace {
@@ -69,7 +68,7 @@ rtl::OUString getArgument(sal_Int32 index) {
std::string convertLazy(rtl::OUString const & s16) {
rtl::OString s8(rtl::OUStringToOString(s16, osl_getThreadTextEncoding()));
- BOOST_STATIC_ASSERT(sizeof (sal_Int32) <= sizeof (std::string::size_type));
+ static_assert(sizeof (sal_Int32) <= sizeof (std::string::size_type), "must be at least the same size");
// ensure following cast is legitimate
return std::string(
s8.getStr(), static_cast< std::string::size_type >(s8.getLength()));
diff --git a/sal/rtl/strtmpl.cxx b/sal/rtl/strtmpl.cxx
index 6b9265895064..a50c3641949d 100644
--- a/sal/rtl/strtmpl.cxx
+++ b/sal/rtl/strtmpl.cxx
@@ -30,7 +30,6 @@
#include <wchar.h>
#include <sal/log.hxx>
#include <rtl/character.hxx>
-#include <boost/static_assert.hpp>
/*
inline void rtl_str_ImplCopy( IMPL_RTL_STRCODE* pDest,
@@ -957,7 +956,7 @@ namespace {
template<typename T, typename U> static inline T IMPL_RTL_STRNAME( toInt )( const IMPL_RTL_STRCODE* pStr,
sal_Int16 nRadix )
{
- BOOST_STATIC_ASSERT(std::numeric_limits<T>::is_signed);
+ static_assert(std::numeric_limits<T>::is_signed, "is signed");
bool bNeg;
sal_Int16 nDigit;
U n = 0;
@@ -1045,7 +1044,7 @@ namespace {
template <typename T> static inline T IMPL_RTL_STRNAME( toUInt )( const IMPL_RTL_STRCODE* pStr,
sal_Int16 nRadix )
{
- BOOST_STATIC_ASSERT(!std::numeric_limits<T>::is_signed);
+ static_assert(!std::numeric_limits<T>::is_signed, "is not signed");
sal_Int16 nDigit;
T n = 0;
diff --git a/sal/textenc/tables.cxx b/sal/textenc/tables.cxx
index 1c8462c53523..4468bbb900eb 100644
--- a/sal/textenc/tables.cxx
+++ b/sal/textenc/tables.cxx
@@ -24,8 +24,6 @@
#include <cassert>
#include <cstddef>
-#include <boost/static_assert.hpp>
-
#include "rtl/textenc.h"
#include "sal/types.h"
@@ -261,9 +259,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT ImplTextEncodingData const *
&aImplPT154TextEncodingData, /* PT154 */
&adobeDingbatsEncodingData }; /* ADOBE_DINGBATS */
- //update table above if a new encoding is added
- BOOST_STATIC_ASSERT(
- SAL_N_ELEMENTS(aData) == RTL_TEXTENCODING_ADOBE_DINGBATS + 1);
+ static_assert(
+ SAL_N_ELEMENTS(aData) == RTL_TEXTENCODING_ADOBE_DINGBATS + 1,
+ "update table above if a new encoding is added");
return
nEncoding < SAL_N_ELEMENTS(aData) ? aData[nEncoding] : NULL;
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 70bc85f59d9d..85bb412130ec 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -28,7 +28,6 @@
#include "scdllapi.h"
#include <rtl/ustring.hxx>
-#include <boost/static_assert.hpp>
#include <vector>
class ImageList;
@@ -211,8 +210,8 @@ inline InsertDeleteFlags operator~ (const InsertDeleteFlags& rhs)
return IDF_ALL_USED_BITS & InsertDeleteFlags::fromInt(~rhs.val());
}
-// boost can't cope with this at the moment, perhaps when we have constexpr we can modify InsertDeleteFlags to make it work.
-//BOOST_STATIC_ASSERT((IDF_ATTRIB & IDF_CONTENTS) == IDF_NONE);
+// This doesnt work at the moment, perhaps when we have constexpr we can modify InsertDeleteFlags to make it work.
+//static_assert((IDF_ATTRIB & IDF_CONTENTS) == IDF_NONE, "these must match");
/// Copy flags for auto/series fill functions: do not touch notes and drawing objects.
const InsertDeleteFlags IDF_AUTOFILL = IDF_ALL & ~(IDF_NOTE | IDF_OBJECTS);
diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx
index 249cd6d8e964..f0f609dfe85d 100644
--- a/sc/inc/pch/precompiled_sc.hxx
+++ b/sc/inc/pch/precompiled_sc.hxx
@@ -45,7 +45,6 @@
#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
-#include <boost/static_assert.hpp>
#include <cassert>
#include <climits>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 14e009bed239..7f7c8b77b1b3 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -19,7 +19,6 @@
#include "scitems.hxx"
-#include <boost/static_assert.hpp>
#include <comphelper/string.hxx>
#include <i18nutil/unicode.hxx>
#include <vcl/outdev.hxx>
@@ -186,8 +185,8 @@ static SfxItemInfo const aItemInfos[] =
{ SID_SCATTR_PAGE_SCALETO, SFX_ITEM_POOLABLE }, // ATTR_PAGE_SCALETO
{ 0, SFX_ITEM_POOLABLE } // ATTR_HIDDEN
};
-BOOST_STATIC_ASSERT(
- SAL_N_ELEMENTS(aItemInfos) == ATTR_ENDINDEX - ATTR_STARTINDEX + 1);
+static_assert(
+ SAL_N_ELEMENTS(aItemInfos) == ATTR_ENDINDEX - ATTR_STARTINDEX + 1, "these must match");
ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool)
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 519cd2ac9c07..c4d78d023d6f 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -19,8 +19,6 @@
#include <cstdarg>
-#include <boost/static_assert.hpp>
-
#include <osl/diagnose.h>
#include <osl/process.h>
@@ -157,8 +155,8 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL
// as long as our reference to the XJavaVM service lasts), and
// convert the non-refcounted pointer into a refcounted one
// immediately:
- BOOST_STATIC_ASSERT(sizeof (sal_Int64)
- >= sizeof (jvmaccess::UnoVirtualMachine *));
+ static_assert(sizeof (sal_Int64)
+ >= sizeof (jvmaccess::UnoVirtualMachine *), "must be at least the same size");
sal_Int64 nPointer = reinterpret_cast< sal_Int64 >(
static_cast< jvmaccess::UnoVirtualMachine * >(0));
javaVM_xJavaVM->getJavaVM(processID) >>= nPointer;
diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx
index d168ab1fc624..2cc68bd2864f 100644
--- a/store/source/storbase.hxx
+++ b/store/source/storbase.hxx
@@ -23,7 +23,6 @@
#include "sal/config.h"
#include "salhelper/simplereferenceobject.hxx"
-#include "boost/static_assert.hpp"
#include "sal/types.h"
#include "rtl/alloc.h"
@@ -425,7 +424,7 @@ struct PageData
*/
static const size_t theSize = sizeof(G) + sizeof(D) + 2 * sizeof(L);
static const sal_uInt16 thePageSize = theSize;
- BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
+ static_assert(STORE_MINIMUM_PAGESIZE >= thePageSize, "must be at least thePageSize");
/** location.
*/
diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx
index 1342abbce0a2..bea35d22c023 100644
--- a/store/source/storbios.cxx
+++ b/store/source/storbios.cxx
@@ -19,8 +19,6 @@
#include "sal/config.h"
-#include "boost/static_assert.hpp"
-
#include "storbios.hxx"
#include "sal/types.h"
@@ -166,7 +164,7 @@ struct SuperBlockPage
*/
static const size_t theSize = 2 * SuperBlock::theSize;
static const sal_uInt16 thePageSize = theSize;
- BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= thePageSize);
+ static_assert(STORE_MINIMUM_PAGESIZE >= thePageSize, "must be at least thePageSize");
/** Allocation.
*/
diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx
index 6ddb2db389dc..ed86b3e31d3a 100644
--- a/store/source/storcach.cxx
+++ b/store/source/storcach.cxx
@@ -20,7 +20,6 @@
#include "sal/config.h"
#include "boost/noncopyable.hpp"
-#include "boost/static_assert.hpp"
#include "storcach.hxx"
@@ -230,7 +229,7 @@ class PageCache_Impl :
{
// Representation
static size_t const theTableSize = 32;
- BOOST_STATIC_ASSERT(STORE_IMPL_ISP2(theTableSize));
+ static_assert(STORE_IMPL_ISP2(theTableSize), "must be the case");
Entry ** m_hash_table;
Entry * m_hash_table_0[theTableSize];
@@ -291,7 +290,7 @@ PageCache_Impl::PageCache_Impl (sal_uInt16 nPageSize)
m_nMissed (0)
{
static size_t const theSize = SAL_N_ELEMENTS(m_hash_table_0);
- BOOST_STATIC_ASSERT(theSize == theTableSize);
+ static_assert(theSize == theTableSize, "must be equal");
memset(m_hash_table_0, 0, sizeof(m_hash_table_0));
}
diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx
index d558f6c69b76..ae9e916c4bd8 100644
--- a/store/source/stordata.hxx
+++ b/store/source/stordata.hxx
@@ -22,7 +22,6 @@
#include "sal/config.h"
-#include "boost/static_assert.hpp"
#include "sal/types.h"
#include "sal/macros.h"
@@ -58,7 +57,7 @@ struct OStoreDataPageData : public store::OStorePageData
*/
static const size_t theSize = 0;
static const sal_uInt16 thePageSize = base::theSize + self::theSize;
- BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+ static_assert(STORE_MINIMUM_PAGESIZE >= self::thePageSize, "got to be at least equal in size");
/** capacity.
*/
@@ -148,7 +147,7 @@ struct OStoreIndirectionPageData : public store::OStorePageData
*/
static const size_t theSize = sizeof(G);
static const sal_uInt16 thePageSize = base::theSize + self::theSize;
- BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+ static_assert(STORE_MINIMUM_PAGESIZE >= self::thePageSize, "got to be at least equal in size");
/** capacity.
*/
@@ -573,7 +572,7 @@ struct OStoreDirectoryPageData : public store::OStorePageData
*/
static const size_t theSize = NameBlock::theSize + DataBlock::theSize;
static const sal_uInt16 thePageSize = base::theSize + self::theSize;
- BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+ static_assert(STORE_MINIMUM_PAGESIZE >= self::thePageSize, "got to be at least equal in size");
/** capacity.
*/
diff --git a/store/source/stortree.hxx b/store/source/stortree.hxx
index eca43bae5877..f91d94bd98e3 100644
--- a/store/source/stortree.hxx
+++ b/store/source/stortree.hxx
@@ -22,7 +22,6 @@
#include "sal/config.h"
-#include "boost/static_assert.hpp"
#include "sal/types.h"
#include "store/types.h"
@@ -123,7 +122,7 @@ struct OStoreBTreeNodeData : public store::OStorePageData
*/
static const size_t theSize = sizeof(G);
static const sal_uInt16 thePageSize = base::theSize + self::theSize;
- BOOST_STATIC_ASSERT(STORE_MINIMUM_PAGESIZE >= self::thePageSize);
+ static_assert(STORE_MINIMUM_PAGESIZE >= self::thePageSize, "got to be at least equal in size");
/** capacity.
*/
diff --git a/svtools/inc/pch/precompiled_svt.hxx b/svtools/inc/pch/precompiled_svt.hxx
index 7e86e0980080..34843886b2e6 100644
--- a/svtools/inc/pch/precompiled_svt.hxx
+++ b/svtools/inc/pch/precompiled_svt.hxx
@@ -27,7 +27,6 @@
#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
-#include <boost/static_assert.hpp>
#include <cassert>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 70e835f5b774..8a6b76712828 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <boost/static_assert.hpp>
-
#include <com/sun/star/i18n/DirectionProperty.hpp>
#include <i18nlangtag/lang.h>
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 9ada26bb61ac..1f46a8683172 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -39,9 +39,7 @@ using namespace ::com::sun::star::linguistic2;
using namespace ::com::sun::star::uno;
-// If these ever dispersed we'd need a solution.
-BOOST_STATIC_ASSERT((LISTBOX_APPEND == COMBOBOX_APPEND) && (LISTBOX_ENTRY_NOTFOUND == COMBOBOX_ENTRY_NOTFOUND));
-
+static_assert((LISTBOX_APPEND == COMBOBOX_APPEND) && (LISTBOX_ENTRY_NOTFOUND == COMBOBOX_ENTRY_NOTFOUND), "If these ever dispersed we'd need a solution");
OUString GetDicInfoStr( const OUString& rName, const sal_uInt16 nLang, bool bNeg )
{
diff --git a/sw/inc/pch/precompiled_msword.hxx b/sw/inc/pch/precompiled_msword.hxx
index 0ddc79224fc8..390d4493be1f 100644
--- a/sw/inc/pch/precompiled_msword.hxx
+++ b/sw/inc/pch/precompiled_msword.hxx
@@ -21,7 +21,6 @@
#include <boost/noncopyable.hpp>
#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
-#include <boost/static_assert.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertyContainer.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 2fe6c6a72b3b..c9f965c74e8a 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -21,7 +21,6 @@
#include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
-#include <boost/static_assert.hpp>
#include <comphelper/string.hxx>
#include <tools/solar.h>
#include <vcl/vclenum.hxx>
@@ -1278,7 +1277,7 @@ void WW8TabBandDesc::ProcessSprmTTableBorders(int nBrcVer, const sal_uInt8* pPar
}
else if ( nBrcVer == 8 )
{
- BOOST_STATIC_ASSERT(sizeof (WW8_BRC) == 4);
+ static_assert(sizeof (WW8_BRC) == 4, "this has to match the msword size");
for( int i = 0; i < 6; ++i )
aDefBrcs[i] = reinterpret_cast<WW8_BRC const *>(pParams)[i];
}
diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx
index b37530feec13..79d96b2be441 100644
--- a/sw/source/filter/ww8/ww8struc.hxx
+++ b/sw/source/filter/ww8/ww8struc.hxx
@@ -22,7 +22,6 @@
#include <sal/config.h>
-#include <boost/static_assert.hpp>
#include <osl/endian.h>
#include <rtl/ustring.hxx>
@@ -190,7 +189,7 @@ struct WW8_STD
// char grupe[];
};
-BOOST_STATIC_ASSERT(sizeof (WW8_STD) == 10);
+static_assert(sizeof (WW8_STD) == 10, "this has to match the msword size");
/** Basis zum Einlesen UND zum Arbeiten (wird jeweils unter schiedlich beerbt)
*/
@@ -210,7 +209,7 @@ struct WW8_FFN_BASE // Font Descriptor
sal_uInt8 ibszAlt; // 0x5 index into ffn.szFfn to the name of the alternate font
};
-BOOST_STATIC_ASSERT(sizeof (WW8_FFN_BASE) == 6);
+static_assert(sizeof (WW8_FFN_BASE) == 6, "this has to match the msword size");
/** Hiermit arbeiten wir im Parser (und Dumper)
*/
@@ -449,7 +448,7 @@ struct WW8_DOGRID
// margins and ignore xaGrid and yaGrid.
};
-BOOST_STATIC_ASSERT(sizeof (WW8_DOGRID) == 10);
+static_assert(sizeof (WW8_DOGRID) == 10, "this has to match the msword size");
struct WW8_PIC
{
@@ -521,7 +520,7 @@ struct WW8_PIC_SHADOW
// sal_uInt8 rgb[]; // 0x3a variable array of bytes containing Window's metafile, bitmap or TIFF file filename.
};
-BOOST_STATIC_ASSERT(sizeof (WW8_PIC_SHADOW) == 0x2E);
+static_assert(sizeof (WW8_PIC_SHADOW) == 0x2E, "this has to match the msword size");
// "0x2E": cf. SwWW8ImplReader::PicRead pDataStream->Read call
struct WW8_TBD
@@ -958,7 +957,7 @@ struct WW8_FSPA_SHADOW // alle Member an gleicher Position und Groesse,
SVBT32 nTxbx;
};
-BOOST_STATIC_ASSERT(sizeof (WW8_FSPA_SHADOW) == 26);
+static_assert(sizeof (WW8_FSPA_SHADOW) == 26, "this has to match the msword size");
// "26": cf. WW8ScannerBase ctor case 8 creation of pMainFdoa and pHdFtFdoa
struct WW8_TXBXS
diff --git a/tools/inc/pch/precompiled_tl.hxx b/tools/inc/pch/precompiled_tl.hxx
index ffdf9ea0f0f3..3b682c0c26f1 100644
--- a/tools/inc/pch/precompiled_tl.hxx
+++ b/tools/inc/pch/precompiled_tl.hxx
@@ -26,7 +26,6 @@
#include <boost/checked_delete.hpp>
#include <boost/noncopyable.hpp>
#include <boost/rational.hpp>
-#include <boost/static_assert.hpp>
#include <cassert>
#include <cmath>
#include <com/sun/star/task/ErrorCodeIOException.hpp>
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 47f0dae26943..9f6e15f28eff 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -26,8 +26,6 @@
#include <ctype.h>
#include <stdlib.h>
-#include <boost/static_assert.hpp>
-
#include <osl/endian.h>
#include <osl/diagnose.h>
diff --git a/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx b/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
index 7806e4fd3a6c..10fe7b6e1e2f 100644
--- a/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
+++ b/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx
@@ -21,7 +21,6 @@
#include <iostream>
#include "boost/noncopyable.hpp"
-#include "boost/static_assert.hpp"
#include "com/sun/star/uno/Any.hxx"
#include "com/sun/star/uno/Exception.hpp"
#include "cppuhelper/exc_hlp.hxx"
@@ -39,7 +38,7 @@ namespace {
// Best effort conversion:
std::string convert(OUString const & s16) {
OString s8(OUStringToOString(s16, osl_getThreadTextEncoding()));
- BOOST_STATIC_ASSERT(sizeof (sal_Int32) <= sizeof (std::string::size_type));
+ static_assert(sizeof (sal_Int32) <= sizeof (std::string::size_type), "got to be at least equal");
// ensure following cast is legitimate
return std::string(
s8.getStr(), static_cast< std::string::size_type >(s8.getLength()));
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 49f4608d0969..c6dfd48303c7 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -22,8 +22,6 @@
#include <salgdi.hxx>
#include <scrptrun.h>
-#include <boost/static_assert.hpp>
-
#include <i18nlangtag/mslangid.hxx>
#include <vcl/svapp.hxx>
diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx
index a89183c68648..715615e73846 100644
--- a/vcl/inc/pch/precompiled_vcl.hxx
+++ b/vcl/inc/pch/precompiled_vcl.hxx
@@ -144,7 +144,6 @@
#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
-#include <boost/static_assert.hpp>
#include <cassert>
#include <cmath>
#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx
index e73dd09cf033..be5112315818 100644
--- a/vcl/source/filter/sgvtext.cxx
+++ b/vcl/source/filter/sgvtext.cxx
@@ -19,7 +19,6 @@
#include "sal/config.h"
-#include <boost/static_assert.hpp>
#include <osl/thread.h>
#include <rtl/math.h>
#include <comphelper/string.hxx>
@@ -606,10 +605,8 @@ sal_uInt16 GetCharWidth(OutputDevice& rOut, UCHAR c)
}
else
{
- // with MaxChar == 255 c cannot be greater than MaxChar
- // assert if MaxChar is ever changed
- BOOST_STATIC_ASSERT( MaxChar == 255 );
- BOOST_STATIC_ASSERT(sizeof(UCHAR) == 1);
+ static_assert(MaxChar == 255, "with MaxChar == 255 c cannot be greater than MaxChar");
+ static_assert(sizeof(UCHAR) == 1, "assert if MaxChar type is ever changed");
if (c>=MinChar /*&& c<=MaxChar*/)
{
ChrWidth=(sal_uInt16)rOut.GetTextWidth(OUString(reinterpret_cast<sal_Char*>(&c), 1, RTL_TEXTENCODING_IBM_437));