Merge branch 'develop' into wip-isildur-g-cppcheck-47-48-58

This commit is contained in:
g. economou
2024-05-01 10:59:59 +03:00
committed by GitHub
89 changed files with 1608 additions and 588 deletions

View File

@@ -68,7 +68,7 @@ namespace ue2 {
#endif
void *aligned_malloc_internal(size_t size, size_t align) {
void *mem;
void *mem= nullptr;;
int rv = posix_memalign(&mem, align, size);
if (rv != 0) {
DEBUG_PRINTF("posix_memalign returned %d when asked for %zu bytes\n",

View File

@@ -155,13 +155,13 @@ u32 compress32_impl_c(u32 x, u32 m) {
return 0;
}
u32 mk, mp, mv, t;
u32 mk, mv;
x &= m; // clear irrelevant bits
mk = ~m << 1; // we will count 0's to right
for (u32 i = 0; i < 5; i++) {
mp = mk ^ (mk << 1);
u32 mp = mk ^ (mk << 1);
mp ^= mp << 2;
mp ^= mp << 4;
mp ^= mp << 8;
@@ -169,7 +169,7 @@ u32 compress32_impl_c(u32 x, u32 m) {
mv = mp & m; // bits to move
m = (m ^ mv) | (mv >> (1 << i)); // compress m
t = x & mv;
u32 t = x & mv;
x = (x ^ t) | (t >> (1 << i)); // compress x
mk = mk & ~mp;
}
@@ -239,14 +239,14 @@ u32 expand32_impl_c(u32 x, u32 m) {
return 0;
}
u32 m0, mk, mp, mv, t;
u32 m0, mk, mv;
u32 array[5];
m0 = m; // save original mask
mk = ~m << 1; // we will count 0's to right
for (int i = 0; i < 5; i++) {
mp = mk ^ (mk << 1); // parallel suffix
u32 mp = mk ^ (mk << 1); // parallel suffix
mp = mp ^ (mp << 2);
mp = mp ^ (mp << 4);
mp = mp ^ (mp << 8);
@@ -259,7 +259,7 @@ u32 expand32_impl_c(u32 x, u32 m) {
for (int i = 4; i >= 0; i--) {
mv = array[i];
t = x << (1 << i);
u32 t = x << (1 << i);
x = (x & ~mv) | (t & mv);
}
@@ -409,7 +409,7 @@ u64a pdep64_impl_c(u64a x, u64a _m) {
u64a result = 0x0UL;
const u64a mask = 0x8000000000000000UL;
u64a m = _m;
u64a c, t;
u64a p;
/* The pop-count of the mask gives the number of the bits from
@@ -421,8 +421,8 @@ u64a pdep64_impl_c(u64a x, u64a _m) {
each mask bit as it is processed. */
while (m != 0)
{
c = __builtin_clzl (m);
t = x << (p - c);
u64a c = __builtin_clzl (m);
u64a t = x << (p - c);
m ^= (mask >> c);
result |= (t & (mask >> c));
p++;

View File

@@ -178,9 +178,9 @@ size_t describeClassInt(ostream &os, const CharReach &incr, size_t maxLength,
// Render charclass as a series of ranges
size_t c_start = cr.find_first();
size_t c = c_start, c_last = 0;
size_t c = c_start;
while (c != CharReach::npos) {
c_last = c;
size_t c_last = c;
c = cr.find_next(c);
if (c != c_last + 1 || c_last == 0xff) {
describeRange(os, c_start, c_last, out_type);

View File

@@ -102,10 +102,10 @@ public:
using category = boost::read_write_property_map_tag;
small_color_map(size_t n_in, const IndexMap &index_map_in)
: n(n_in), index_map(index_map_in) {
size_t num_bytes = (n + entries_per_byte - 1) / entries_per_byte;
data = std::make_shared<std::vector<unsigned char>>(num_bytes);
fill(small_color::white);
: n(n_in),
index_map(index_map_in),
data(std::make_shared<std::vector<unsigned char>>((n_in + entries_per_byte - 1) / entries_per_byte)) {
fill(small_color::white);
}
void fill(small_color color) {

View File

@@ -1145,7 +1145,7 @@ really_inline SuperVector<32> SuperVector<32>::loadu_maskz(void const *ptr, uint
template<>
really_inline SuperVector<32> SuperVector<32>::alignr(SuperVector<32> &other, int8_t offset)
{
#if defined(HAVE__BUILTIN_CONSTANT_P) && !(defined(__GNUC__) && (__GNUC__ == 13))
#if defined(HAVE__BUILTIN_CONSTANT_P) && !(defined(__GNUC__) && ((__GNUC__ == 13) || (__GNUC__ == 14)))
if (__builtin_constant_p(offset)) {
if (offset == 16) {
return *this;
@@ -1801,7 +1801,7 @@ really_inline SuperVector<64> SuperVector<64>::pshufb_maskz(SuperVector<64> b, u
template<>
really_inline SuperVector<64> SuperVector<64>::alignr(SuperVector<64> &l, int8_t offset)
{
#if defined(HAVE__BUILTIN_CONSTANT_P)
#if defined(HAVE__BUILTIN_CONSTANT_P) && !(defined(__GNUC__) && (__GNUC__ == 14))
if (__builtin_constant_p(offset)) {
if (offset == 16) {
return *this;