|
| 1 | +diff --git a/include/boost/container/detail/config_begin.hpp b/include/boost/container/detail/config_begin.hpp |
| 2 | +index d459a06..693bb14 100644 |
| 3 | +--- a/include/boost/container/detail/config_begin.hpp |
| 4 | ++++ b/include/boost/container/detail/config_begin.hpp |
| 5 | +@@ -19,7 +19,6 @@ |
| 6 | + #pragma warning (push) |
| 7 | + #pragma warning (disable : 4619) // there is no warning number 'XXXX' |
| 8 | + #pragma warning (disable : 4127) // conditional expression is constant |
| 9 | +- #pragma warning (disable : 4146) // unary minus operator applied to unsigned type, result still unsigned |
| 10 | + #pragma warning (disable : 4197) // top-level volatile in cast is ignored |
| 11 | + #pragma warning (disable : 4251) // "identifier" : class "type" needs to have dll-interface to be used by clients of class "type2" |
| 12 | + #pragma warning (disable : 4275) // non DLL-interface classkey "identifier" used as base for DLL-interface classkey "identifier" |
| 13 | +diff --git a/src/dlmalloc_2_8_6.c b/src/dlmalloc_2_8_6.c |
| 14 | +index 4a5c241..f530927 100644 |
| 15 | +--- a/src/dlmalloc_2_8_6.c |
| 16 | ++++ b/src/dlmalloc_2_8_6.c |
| 17 | +@@ -1429,9 +1429,6 @@ DLMALLOC_EXPORT int mspace_mallopt(int, int); |
| 18 | + |
| 19 | + /*------------------------------ internal #includes ---------------------- */ |
| 20 | + |
| 21 | +-#ifdef _MSC_VER |
| 22 | +-#pragma warning( disable : 4146 ) /* no "unsigned" warnings */ |
| 23 | +-#endif /* _MSC_VER */ |
| 24 | + #if !NO_MALLOC_STATS |
| 25 | + #include <stdio.h> /* for printing in malloc_stats */ |
| 26 | + #endif /* NO_MALLOC_STATS */ |
| 27 | +@@ -2219,7 +2216,7 @@ typedef unsigned int flag_t; /* The type of various bit flag sets */ |
| 28 | + #define align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A))) |
| 29 | + |
| 30 | + /* Bounds on request (not chunk) sizes. */ |
| 31 | +-#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) |
| 32 | ++#define MAX_REQUEST ((0 - MIN_CHUNK_SIZE) << 2) |
| 33 | + #define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) |
| 34 | + |
| 35 | + /* pad request bytes into a usable size */ |
| 36 | +@@ -2922,13 +2919,13 @@ static size_t traverse_and_check(mstate m); |
| 37 | + #define treemap_is_marked(M,i) ((M)->treemap & idx2bit(i)) |
| 38 | + |
| 39 | + /* isolate the least set bit of a bitmap */ |
| 40 | +-#define least_bit(x) ((x) & -(x)) |
| 41 | ++#define least_bit(x) ((x) & (0 - (x))) |
| 42 | + |
| 43 | + /* mask with all bits to left of least bit of x on */ |
| 44 | +-#define left_bits(x) ((x<<1) | -(x<<1)) |
| 45 | ++#define left_bits(x) (((x)<<1) | (0 - ((x)<<1))) |
| 46 | + |
| 47 | + /* mask with all bits to left of or equal to least bit of x on */ |
| 48 | +-#define same_or_left_bits(x) ((x) | -(x)) |
| 49 | ++#define same_or_left_bits(x) ((x) | (0 - (x))) |
| 50 | + |
| 51 | + /* index corresponding to given bit. Use x86 asm if possible */ |
| 52 | + |
| 53 | +@@ -4429,7 +4426,7 @@ static void dispose_chunk(mstate m, mchunkptr p, size_t psize) { |
| 54 | + /* allocate a large request from the best fitting chunk in a treebin */ |
| 55 | + static void* tmalloc_large(mstate m, size_t nb) { |
| 56 | + tchunkptr v = 0; |
| 57 | +- size_t rsize = -nb; /* Unsigned negation */ |
| 58 | ++ size_t rsize = 0 - nb; /* Unsigned negation */ |
| 59 | + tchunkptr t; |
| 60 | + bindex_t idx; |
| 61 | + compute_tree_index(nb, idx); |
| 62 | +@@ -4916,7 +4913,7 @@ static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { |
| 63 | + */ |
| 64 | + char* br = (char*)mem2chunk((size_t)(((size_t)((char*)mem + alignment - |
| 65 | + SIZE_T_ONE)) & |
| 66 | +- -alignment)); |
| 67 | ++ (0 - alignment))); |
| 68 | + char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)? |
| 69 | + br : br+alignment; |
| 70 | + mchunkptr newp = (mchunkptr)pos; |
| 71 | +@@ -5420,7 +5417,7 @@ mspace create_mspace(size_t capacity, int locked) { |
| 72 | + size_t msize; |
| 73 | + ensure_initialization(); |
| 74 | + msize = pad_request(sizeof(struct malloc_state)); |
| 75 | +- if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { |
| 76 | ++ if (capacity < (size_t) (0 - (msize + TOP_FOOT_SIZE + mparams.page_size))) { |
| 77 | + size_t rs = ((capacity == 0)? mparams.granularity : |
| 78 | + (capacity + TOP_FOOT_SIZE + msize)); |
| 79 | + size_t tsize = granularity_align(rs); |
| 80 | +@@ -5440,7 +5437,7 @@ mspace create_mspace_with_base(void* base, size_t capacity, int locked) { |
| 81 | + ensure_initialization(); |
| 82 | + msize = pad_request(sizeof(struct malloc_state)); |
| 83 | + if (capacity > msize + TOP_FOOT_SIZE && |
| 84 | +- capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { |
| 85 | ++ capacity < (size_t) (0 - (msize + TOP_FOOT_SIZE + mparams.page_size))) { |
| 86 | + m = init_user_mstate((char*)base, capacity); |
| 87 | + m->seg.sflags = EXTERN_BIT; |
| 88 | + set_lock(m, locked); |
| 89 | +diff --git a/test/expand_bwd_test_template.hpp b/test/expand_bwd_test_template.hpp |
| 90 | +index e86a413..8ad7e47 100644 |
| 91 | +--- a/test/expand_bwd_test_template.hpp |
| 92 | ++++ b/test/expand_bwd_test_template.hpp |
| 93 | +@@ -98,7 +98,7 @@ bool test_insert_with_expand_bwd() |
| 94 | + Vect data_to_insert; |
| 95 | + data_to_insert.resize(InsertSize[iteration]); |
| 96 | + for(unsigned int i = 0; i < InsertSize[iteration]; ++i){ |
| 97 | +- data_to_insert[i] = static_cast<value_type>((int)-i); |
| 98 | ++ data_to_insert[i] = static_cast<value_type>((int)(0-i)); |
| 99 | + } |
| 100 | + |
| 101 | + if(!life_count<value_type>::check(InitialSize[iteration]+InsertSize[iteration])) |
| 102 | +@@ -161,7 +161,7 @@ bool test_assign_with_expand_bwd() |
| 103 | + std::vector<value_type> data_to_insert; |
| 104 | + data_to_insert.resize(InsertSize[iteration]); |
| 105 | + for(unsigned int i = 0; i < InsertSize[iteration]; ++i){ |
| 106 | +- data_to_insert[i] = static_cast<value_type>((int)-i); |
| 107 | ++ data_to_insert[i] = static_cast<value_type>((int)(0-i)); |
| 108 | + } |
| 109 | + |
| 110 | + //Insert initial data to the vector to test |
0 commit comments