Commit Graph

7 Commits

Author SHA1 Message Date
Juan Carlos Arevalo Baeza (JCAB)
18f29c6eda Fix all instances of MSVC warning C4146 (unsigned negation)
Unsigned negation is a well-defined operation in C and C++ and it is commonly used when doing bit manipulation of unsigned integers, because it builds a high-pass bitmask.

For instance, if `X` is known to be a power of two, `-X` is precisely the mask needed to align a value down to a multiple of `X` by means of a bit-wise `&` operation.

However, it can occasionally be flagging a bug, when the original intent was mathematical negation. For this reason, an explicit fix is preferred to suppressing this warning.

This change fixes all the instances of unsigned negation of the form `-X` to `0 - X`.

It also includes a drive-by spot-fix for the macro `left_bits(x)` whose parameter was missing the usual parenthesis. This was benign in all the uses of the macro.
2025-07-30 15:35:34 -07:00
Ion Gaztañaga
74dfab45fc Fix warning "incompatible pointer types passing 'int *' to parameter of type 'volatile long *' [-Wincompatible-pointer-types]", in clang-win 2024-08-22 00:46:40 +02:00
Ion Gaztañaga
52013a99ef Fixes #225 ("variable set but not used in dlmalloc_ext_2_8_6.c") 2023-04-18 23:12:33 +02:00
Ion Gaztañaga
3e09b67f76 Fixes #169 ("flood of warnings building dlmalloc_ext_2_8_6.c on clang11") 2020-10-31 18:55:09 +01:00
Edward Diener
5d526092fb Addition needed for Embarcarder clang-based compilers. 2020-04-23 13:45:23 -04:00
luz.paz
a6ac16d0c4 container: misc-typos
Found via `codespell -q 3 -L iff,nd`
2018-09-23 15:54:39 -04:00
Ion Gaztañaga
41c2056ec6 - Modified relational operators to be friend inline definitions. This allows compilation checking when instantiating classes, avoids predeclarations and results in less verbose code.
- First to make associative containers' tree implementation configurable.
2013-12-23 23:34:28 +01:00