From b8656877e278bea810f85b9c1d207bdba09ef7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martijn=20Th=C3=A9?= Date: Tue, 20 Feb 2018 16:13:04 +0100 Subject: [PATCH] Fix misc. compiler warnings (#2202) JerryScript-DCO-1.0-Signed-off-by: Martijn The martijn.the@intel.com --- jerry-core/api/jerry.c | 5 +++-- tests/unit-core/test-mem-stats.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/jerry-core/api/jerry.c b/jerry-core/api/jerry.c index f26676067..cb5790d91 100644 --- a/jerry-core/api/jerry.c +++ b/jerry-core/api/jerry.c @@ -313,7 +313,8 @@ jerry_get_memory_stats (jerry_heap_stats_t *out_stats_p) /**< [out] heap memory return false; } - jmem_heap_stats_t jmem_heap_stats = {0}; + jmem_heap_stats_t jmem_heap_stats; + memset (&jmem_heap_stats, 0, sizeof (jmem_heap_stats)); jmem_heap_get_stats (&jmem_heap_stats); *out_stats_p = (jerry_heap_stats_t) @@ -992,7 +993,7 @@ jerry_get_error_type (const jerry_value_t value) /**< api value */ ecma_object_t *object_p = ecma_get_object_from_value (object); ecma_standard_error_t error_type = ecma_get_error_type (object_p); - return error_type; + return (jerry_error_t) error_type; } /* jerry_get_error_type */ /** diff --git a/tests/unit-core/test-mem-stats.c b/tests/unit-core/test-mem-stats.c index 299d6456a..fd889febc 100644 --- a/tests/unit-core/test-mem-stats.c +++ b/tests/unit-core/test-mem-stats.c @@ -33,7 +33,8 @@ int main (void) jerry_value_t res = jerry_run (parsed_code_val); TEST_ASSERT (!jerry_value_has_error_flag (res)); - jerry_heap_stats_t stats = {0}; + jerry_heap_stats_t stats; + memset (&stats, 0, sizeof (stats)); bool get_stats_ret = jerry_get_memory_stats (&stats); TEST_ASSERT (get_stats_ret); TEST_ASSERT (stats.version == 1);