Skip to content

Commit 5f7a640

Browse files
theamirocohenYossi Levy
authored andcommitted
Fix Compilation problems
1 parent 5256e96 commit 5f7a640

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

TESTS/mbed_hal/trng/main.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
#define MSG_TRNG_TEST_STEP2 "check_step2"
6565
#define MSG_TRNG_TEST_SUITE_ENDED "Test_suite_ended"
6666

67+
#define RESULT_SUCCESS 0
68+
6769
#define NVKEY 1 //NVstore key for storing and loading data
6870

6971
/*there are some issues with nvstore and greentea reset, so for now nvstore is disabled,
@@ -114,7 +116,7 @@ static void compress_and_compare(char *key, char *value)
114116
#if NVSTORE_RESET
115117
uint16_t actual = 0;
116118
result = nvstore.get(NVKEY, sizeof(buffer), buffer, actual);
117-
TEST_ASSERT_EQUAL(NVSTORE_SUCCESS, result);
119+
TEST_ASSERT_EQUAL(RESULT_SUCCESS, result);
118120
#else
119121
/*Using base64 to decode data sent from host*/
120122
uint32_t lengthWritten = 0;
@@ -173,11 +175,11 @@ static void compress_and_compare(char *key, char *value)
173175
int result = 0;
174176
#if NVSTORE_RESET
175177
result = nvstore.set(NVKEY, sizeof(buffer), buffer);
176-
TEST_ASSERT_EQUAL(NVSTORE_SUCCESS, result);
178+
TEST_ASSERT_EQUAL(RESULT_SUCCESS, result);
177179
#else
178180
/*Using base64 to encode data sending from host*/
179181
result = trng_EncodeBase64(buffer, BUFFER_LEN, (char *)out_comp_buf, sizeof(out_comp_buf));
180-
TEST_ASSERT_EQUAL(NVSTORE_SUCCESS, result);
182+
TEST_ASSERT_EQUAL(RESULT_SUCCESS, result);
181183
greentea_send_kv(MSG_TRNG_BUFFER, (const char *)out_comp_buf);
182184
#endif
183185
system_reset();

TESTS/mbed_hal/trng/pithy/pithy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ size_t pithy_Compress(const char *uncompressed,
585585
do {
586586
if (compressionLevel > 2) {
587587
DCHECK((uncompressedPtr + 5ul) <= uncompressedEnd);
588-
uncompressedBytes64 = pithy_Load64(uncompressedPtr + 1ul);
588+
uncompressedBytes64 = pithy_Load64((uint64_t*)uncompressedPtr + 1ul);
589589
hashTable[pithy_HashBytes(pithy_GetUint32AtOffset(uncompressedBytes64, 0u), shift)] =
590590
uncompressedPtr + 1ul;
591591
if (compressionLevel > 4) {
@@ -618,7 +618,7 @@ size_t pithy_Compress(const char *uncompressed,
618618

619619
DCHECK(((uncompressedPtr - 3ul) >= uncompressed) && (uncompressedPtr <= uncompressedEnd));
620620

621-
uncompressedBytes64 = pithy_Load64(uncompressedPtr - 3ul);
621+
uncompressedBytes64 = pithy_Load64((uint64_t*)uncompressedPtr - 3ul);
622622

623623
if (compressionLevel > 0) {
624624
if (compressionLevel > 8) {

0 commit comments

Comments
 (0)