Replace vera++ with clang-format (#4518)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
This commit is contained in:
@@ -19,8 +19,8 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "jerryscript.h"
|
||||
#include "jerryscript-port.h"
|
||||
#include "jerryscript.h"
|
||||
|
||||
/*
|
||||
* Make sure unused parameters, variables, or expressions trigger no compiler warning.
|
||||
@@ -35,39 +35,43 @@
|
||||
* __LINE__ may be the same for asserts in a header
|
||||
* and in an implementation file.
|
||||
*/
|
||||
#define JERRYX_STATIC_ASSERT_GLUE_(a, b, c) a ## b ## _ ## c
|
||||
#define JERRYX_STATIC_ASSERT_GLUE(a, b, c) JERRYX_STATIC_ASSERT_GLUE_ (a, b, c)
|
||||
#define JERRYX_STATIC_ASSERT(x, msg) \
|
||||
enum { JERRYX_STATIC_ASSERT_GLUE (static_assertion_failed_, __LINE__, msg) = 1 / (!!(x)) }
|
||||
#define JERRYX_STATIC_ASSERT_GLUE_(a, b, c) a##b##_##c
|
||||
#define JERRYX_STATIC_ASSERT_GLUE(a, b, c) JERRYX_STATIC_ASSERT_GLUE_ (a, b, c)
|
||||
#define JERRYX_STATIC_ASSERT(x, msg) \
|
||||
enum \
|
||||
{ \
|
||||
JERRYX_STATIC_ASSERT_GLUE (static_assertion_failed_, __LINE__, msg) = 1 / (!!(x)) \
|
||||
}
|
||||
|
||||
#ifndef JERRY_NDEBUG
|
||||
void JERRY_ATTR_NORETURN
|
||||
jerry_assert_fail (const char *assertion, const char *file, const char *function, const uint32_t line);
|
||||
void JERRY_ATTR_NORETURN
|
||||
jerry_unreachable (const char *file, const char *function, const uint32_t line);
|
||||
void JERRY_ATTR_NORETURN jerry_assert_fail (const char *assertion,
|
||||
const char *file,
|
||||
const char *function,
|
||||
const uint32_t line);
|
||||
void JERRY_ATTR_NORETURN jerry_unreachable (const char *file, const char *function, const uint32_t line);
|
||||
|
||||
#define JERRYX_ASSERT(x) \
|
||||
do \
|
||||
{ \
|
||||
if (JERRY_UNLIKELY (!(x))) \
|
||||
{ \
|
||||
#define JERRYX_ASSERT(x) \
|
||||
do \
|
||||
{ \
|
||||
if (JERRY_UNLIKELY (!(x))) \
|
||||
{ \
|
||||
jerry_assert_fail (#x, __FILE__, __func__, __LINE__); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define JERRYX_UNREACHABLE() \
|
||||
do \
|
||||
{ \
|
||||
#define JERRYX_UNREACHABLE() \
|
||||
do \
|
||||
{ \
|
||||
jerry_unreachable (__FILE__, __func__, __LINE__); \
|
||||
} while (0)
|
||||
#else /* JERRY_NDEBUG */
|
||||
#define JERRYX_ASSERT(x) \
|
||||
do \
|
||||
{ \
|
||||
if (false) \
|
||||
{ \
|
||||
do \
|
||||
{ \
|
||||
if (false) \
|
||||
{ \
|
||||
JERRYX_UNUSED (x); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#ifdef __GNUC__
|
||||
@@ -75,7 +79,7 @@ jerry_unreachable (const char *file, const char *function, const uint32_t line);
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define JERRYX_UNREACHABLE() _assume (0)
|
||||
#define JERRYX_UNREACHABLE() _assume (0)
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#ifndef JERRYX_UNREACHABLE
|
||||
@@ -87,9 +91,9 @@ jerry_unreachable (const char *file, const char *function, const uint32_t line);
|
||||
/*
|
||||
* Logging
|
||||
*/
|
||||
#define JERRYX_ERROR_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_ERROR, __VA_ARGS__)
|
||||
#define JERRYX_ERROR_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_ERROR, __VA_ARGS__)
|
||||
#define JERRYX_WARNING_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_WARNING, __VA_ARGS__)
|
||||
#define JERRYX_DEBUG_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_DEBUG, __VA_ARGS__)
|
||||
#define JERRYX_TRACE_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_TRACE, __VA_ARGS__)
|
||||
#define JERRYX_DEBUG_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_DEBUG, __VA_ARGS__)
|
||||
#define JERRYX_TRACE_MSG(...) jerry_port_log (JERRY_LOG_LEVEL_TRACE, __VA_ARGS__)
|
||||
|
||||
#endif /* !JEXT_COMMON_H */
|
||||
|
||||
Reference in New Issue
Block a user