Skip to content

Commit 69893fe

Browse files
committed
Next try to stick to C++-11
1 parent 5c04017 commit 69893fe

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

gecode/kernel/memory/config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ namespace Gecode { namespace Kernel {
122122
* value is used.
123123
*/
124124
#ifndef GECODE_MEMORY_ALIGNMENT
125-
#define GECODE_MEMORY_ALIGNMENT 8U
125+
#define GECODE_MEMORY_ALIGNMENT static_cast<size_t>(8U);
126126
#endif
127127
/**
128128
* \brief Size of region area

gecode/kernel/memory/region.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
*/
3333

3434
#include <cstddef>
35-
#include <algorithm>
3635

3736
namespace Gecode {
3837

@@ -61,8 +60,8 @@ namespace Gecode {
6160
/// Amount of free memory
6261
size_t free;
6362
/// The actual memory area (allocated from top to bottom)
64-
alignas(std::max(alignof(std::max_align_t),
65-
GECODE_MEMORY_ALIGNMENT))
63+
alignas((alignof(std::max_align_t) > GECODE_MEMORY_ALIGNMENT) ?
64+
alignof(std::max_align_t) : GECODE_MEMORY_ALIGNMENT)
6665
double area[Kernel::MemoryConfig::region_area_size / sizeof(double)];
6766
/// A pointer to another chunk
6867
Chunk* next;
@@ -334,8 +333,8 @@ namespace Gecode {
334333
forceinline bool
335334
Region::Chunk::alloc(size_t s, void*& p) {
336335
Kernel::MemoryConfig::align
337-
(s,std::max(alignof(std::max_align_t),
338-
GECODE_MEMORY_ALIGNMENT));
336+
(s,((alignof(std::max_align_t) > GECODE_MEMORY_ALIGNMENT) ?
337+
alignof(std::max_align_t) : GECODE_MEMORY_ALIGNMENT));
339338
if (s > free)
340339
return false;
341340
free -= s;

0 commit comments

Comments
 (0)