diff --git a/lib/common/compiler.h b/lib/common/compiler.h index fea1ca51e460e8ade92c3c0ec5c1df4234e144d2..206ecc7c0ee603d99a2b5702123dadb1da6c102e 100644 --- a/lib/common/compiler.h +++ b/lib/common/compiler.h @@ -68,7 +68,7 @@ ((b) > maximum_unsigned_value_of_type(a) - (a)) -#define __get_unaligned_t(type, ptr) ({ \ +#define __get_unaligned_t(type, ptr) __extension__ ({ \ const struct { type x; } __attribute__((packed)) *__pptr = (__typeof__(__pptr))(ptr); \ __pptr->x; \ }) @@ -88,7 +88,7 @@ * @note the size of the value is determined by the pointer type */ -#define get_unaligned(ptr) __get_unaligned_t(__typeof__(*(ptr)), (ptr)) +#define get_unaligned(ptr) __get_unaligned_t(__typeof__(*(ptr)), (ptr)) /** diff --git a/lib/icu_compress/cmp_icu.c b/lib/icu_compress/cmp_icu.c index 593740d9a3c57baa9019d46445a944b698ffca51..b2d4c5b786f90522f9d8986c6319e9e94abe12a2 100644 --- a/lib/icu_compress/cmp_icu.c +++ b/lib/icu_compress/cmp_icu.c @@ -2305,7 +2305,7 @@ static int set_cmp_col_size(uint8_t *p, int cmp_col_size) if (cmp_col_size > UINT16_MAX) return -1; - v -= COLLECTION_HDR_SIZE+2; + v -= COLLECTION_HDR_SIZE+CMP_COLLECTION_FILD_SIZE; if (p) { memset(p, v >> 8, 1); memset(p+1, v & 0xFF, 1); @@ -2700,8 +2700,8 @@ int32_t compress_chunk(void *chunk, uint32_t chunk_size, return -1; } - err = cmp_ent_build_chunk_header((struct cmp_entity *)dst, chunk_size, &cfg, - start_timestamp, cmp_size_byte); + err = cmp_ent_build_chunk_header((struct cmp_entity *)dst, chunk_size, + &cfg, start_timestamp, cmp_size_byte); if (err < 0) return err;