diff --git a/lib/icu_compress/cmp_icu.c b/lib/icu_compress/cmp_icu.c index 6c8830ad58e3d38ffd426c7f876426058d3f2f29..f35021393875af99470c1b840abccce5653f95c8 100644 --- a/lib/icu_compress/cmp_icu.c +++ b/lib/icu_compress/cmp_icu.c @@ -2280,9 +2280,11 @@ uint32_t compress_chunk_set_model_id_and_counter(void *dst, uint32_t dst_size, uint32_t compress_like_rdcu(const struct rdcu_cfg *rcfg, struct cmp_info *info) { - struct cmp_cfg cfg = {0}; + struct cmp_cfg cfg; uint32_t cmp_size_bit; + memset(&cfg, 0, sizeof(cfg)); + if (info) memset(info, 0, sizeof(*info)); diff --git a/test/cmp_decmp/test_cmp_decmp.c b/test/cmp_decmp/test_cmp_decmp.c index c4ce8d9e4d558e165afb0ae6398b6466c15eedf5..53e1a0030740837004e0a1064635a679877b07db 100644 --- a/test/cmp_decmp/test_cmp_decmp.c +++ b/test/cmp_decmp/test_cmp_decmp.c @@ -23,6 +23,7 @@ #include <string.h> #include <stdlib.h> #include <stdio.h> +#include <math.h> #include <unity.h> #include "../test_common/test_common.h" @@ -40,11 +41,13 @@ #include <cmp_max_used_bits.h> #include <cmp_cal_up_model.h> -#if defined __has_include -# if __has_include(<time.h>) -# include <time.h> -# include <unistd.h> -# define HAS_TIME_H 1 +#ifndef ICU_ASW +# if defined __has_include +# if __has_include(<time.h>) && !defined(__sparc__) +# include <time.h> +# include <unistd.h> +# define HAS_TIME_H 1 +# endif # endif #endif diff --git a/test/cmp_entity/test_cmp_entity.c b/test/cmp_entity/test_cmp_entity.c index 2fd053cff29246908e62d9c937e3e1dfa1e55b59..d7dc03ac7e0583a85e25fc5c22400ba114d521bd 100644 --- a/test/cmp_entity/test_cmp_entity.c +++ b/test/cmp_entity/test_cmp_entity.c @@ -19,10 +19,13 @@ #include <stdlib.h> #include <string.h> -#if defined __has_include -# if __has_include(<time.h>) -# include <time.h> -# define HAS_TIME_H 1 + +#ifndef ICU_ASW +# if defined __has_include +# if __has_include(<time.h>) +# include <time.h> +# define HAS_TIME_H 1 +# endif # endif #endif diff --git a/test/cmp_icu/test_cmp_icu.c b/test/cmp_icu/test_cmp_icu.c index 415240629433aa0b54f2cebe574ab0a902830722..7b8b5c94a1eae5d51d8d2697c70dfe27b63ac862 100644 --- a/test/cmp_icu/test_cmp_icu.c +++ b/test/cmp_icu/test_cmp_icu.c @@ -20,11 +20,13 @@ #include <stdlib.h> #include <leon_inttypes.h> -#if defined __has_include -# if __has_include(<time.h>) -# include <time.h> -# include <unistd.h> -# define HAS_TIME_H 1 +#ifndef ICU_ASW +# if defined __has_include +# if __has_include(<time.h>) +# include <time.h> +# include <unistd.h> +# define HAS_TIME_H 1 +# endif # endif #endif @@ -2429,6 +2431,7 @@ void test_compress_chunk_cmp_size_bound(void) TEST_ASSERT_TRUE(cmp_is_error(bound)); TEST_ASSERT_EQUAL_INT(CMP_ERROR_CHUNK_SIZE_INCONSISTENT, cmp_get_error_code(bound)); +#ifndef __sparc__ { /* containing only zero data size collections */ size_t i; uint8_t *chunk_big; @@ -2436,6 +2439,7 @@ void test_compress_chunk_cmp_size_bound(void) - NON_IMAGETTE_HEADER_SIZE - CMP_COLLECTION_FILD_SIZE; chunk_big = malloc(max_chunk_size); + TEST_ASSERT_NOT_NULL(chunk_big); for (i = 0; i < max_chunk_size-COLLECTION_HDR_SIZE; i = i+COLLECTION_HDR_SIZE) TEST_ASSERT_FALSE(cmp_col_set_data_length((struct collection_hdr *)&chunk_big[i], 0)); @@ -2443,6 +2447,7 @@ void test_compress_chunk_cmp_size_bound(void) TEST_ASSERT_EQUAL_INT(CMP_ERROR_CHUNK_TOO_LARGE, cmp_get_error_code(bound)); free(chunk_big); } +#endif }