Remove the ENABLED/DISABLED macros (#4515)

The removal of these macros enabled cppcheck to reveal new errors.
These errors are also fixed by the patch.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2021-02-04 23:47:05 +01:00
committed by GitHub
parent e01c2549d7
commit 0628ae1e7b
337 changed files with 5186 additions and 5191 deletions
+9 -9
View File
@@ -25,7 +25,7 @@
#include "jerryscript-port.h"
#include "lit-char-helpers.h"
#if ENABLED (JERRY_DEBUGGER)
#if JERRY_DEBUGGER
/**
* Incoming message: next message of string data.
@@ -763,9 +763,9 @@ jerry_debugger_process_message (const uint8_t *recv_buffer_p, /**< pointer to th
JERRY_CONTEXT (debugger_byte_code_free_tail) = ECMA_NULL_POINTER;
}
#if ENABLED (JERRY_MEM_STATS)
#if JERRY_MEM_STATS
jmem_stats_free_byte_code_bytes (((size_t) byte_code_free_p->size) << JMEM_ALIGNMENT_LOG);
#endif /* ENABLED (JERRY_MEM_STATS) */
#endif /* JERRY_MEM_STATS */
jmem_heap_free_block (byte_code_free_p,
((size_t) byte_code_free_p->size) << JMEM_ALIGNMENT_LOG);
@@ -1378,7 +1378,7 @@ jerry_debugger_send_memstats (void)
memstats_p->type = JERRY_DEBUGGER_MEMSTATS_RECEIVE;
#if ENABLED (JERRY_MEM_STATS) /* if memory statistics feature is enabled */
#if JERRY_MEM_STATS /* if memory statistics feature is enabled */
jmem_heap_stats_t *heap_stats = &JERRY_CONTEXT (jmem_heap_stats);
uint32_t allocated_bytes = (uint32_t) heap_stats->allocated_bytes;
@@ -1391,13 +1391,13 @@ jerry_debugger_send_memstats (void)
memcpy (memstats_p->object_bytes, &object_bytes, sizeof (uint32_t));
uint32_t property_bytes = (uint32_t) heap_stats->property_bytes;
memcpy (memstats_p->property_bytes, &property_bytes, sizeof (uint32_t));
#else /* !ENABLED (JERRY_MEM_STATS) if not, just put zeros */
#else /* !JERRY_MEM_STATS if not, just put zeros */
memset (memstats_p->allocated_bytes, 0, sizeof (uint32_t));
memset (memstats_p->byte_code_bytes, 0, sizeof (uint32_t));
memset (memstats_p->string_bytes, 0, sizeof (uint32_t));
memset (memstats_p->object_bytes, 0, sizeof (uint32_t));
memset (memstats_p->property_bytes, 0, sizeof (uint32_t));
#endif /* ENABLED (JERRY_MEM_STATS) */
#endif /* JERRY_MEM_STATS */
jerry_debugger_send (sizeof (jerry_debugger_send_memstats_t));
} /* jerry_debugger_send_memstats */
@@ -1431,7 +1431,7 @@ jerry_debugger_exception_object_to_string (ecma_value_t exception_obj_value) /**
switch (((ecma_extended_object_t *) prototype_p)->u.built_in.id)
{
#if ENABLED (JERRY_BUILTIN_ERRORS)
#if JERRY_BUILTIN_ERRORS
case ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE:
{
string_id = LIT_MAGIC_STRING_EVAL_ERROR_UL;
@@ -1462,7 +1462,7 @@ jerry_debugger_exception_object_to_string (ecma_value_t exception_obj_value) /**
string_id = LIT_MAGIC_STRING_URI_ERROR_UL;
break;
}
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
#endif /* JERRY_BUILTIN_ERRORS */
case ECMA_BUILTIN_ID_ERROR_PROTOTYPE:
{
string_id = LIT_MAGIC_STRING_ERROR_UL;
@@ -1545,4 +1545,4 @@ jerry_debugger_send_exception_string (ecma_value_t exception_value)
return result;
} /* jerry_debugger_send_exception_string */
#endif /* ENABLED (JERRY_DEBUGGER) */
#endif /* JERRY_DEBUGGER */