aboutsummaryrefslogtreecommitdiff
path: root/jerry-ext/handler
diff options
context:
space:
mode:
Diffstat (limited to 'jerry-ext/handler')
-rw-r--r--jerry-ext/handler/handler-assert.c16
-rw-r--r--jerry-ext/handler/handler-gc.c4
-rw-r--r--jerry-ext/handler/handler-print.c16
-rw-r--r--jerry-ext/handler/handler-register.c2
4 files changed, 16 insertions, 22 deletions
diff --git a/jerry-ext/handler/handler-assert.c b/jerry-ext/handler/handler-assert.c
index 96d8d597..13c6e0c9 100644
--- a/jerry-ext/handler/handler-assert.c
+++ b/jerry-ext/handler/handler-assert.c
@@ -13,10 +13,11 @@
* limitations under the License.
*/
-#include "jerryscript-ext/handler.h"
+#include <inttypes.h>
+
#include "jerryscript-port.h"
-#include <inttypes.h>
+#include "jerryscript-ext/handler.h"
/**
* Hard assert for scripts. The routine calls jerry_port_fatal on assertion failure.
@@ -35,8 +36,7 @@ jerryx_handler_assert_fatal (const jerry_call_info_t *call_info_p, /**< call inf
{
(void) call_info_p; /* unused */
- if (args_cnt == 1
- && jerry_value_is_true (args_p[0]))
+ if (args_cnt == 1 && jerry_value_is_true (args_p[0]))
{
return jerry_create_boolean (true);
}
@@ -65,7 +65,7 @@ jerryx_handler_assert_fatal (const jerry_call_info_t *call_info_p, /**< call inf
* on some systems it can be printed. To avoid differences in the uint32_t typdef
* The "PRIu32" macro is used to correctly add the formatter.
*/
- jerry_port_log (JERRY_LOG_LEVEL_ERROR, " %"PRIu32": ", idx);
+ jerry_port_log (JERRY_LOG_LEVEL_ERROR, " %" PRIu32 ": ", idx);
do
{
jerry_size_t copied_bytes = jerry_substring_to_utf8_char_buffer (property,
@@ -77,8 +77,7 @@ jerryx_handler_assert_fatal (const jerry_call_info_t *call_info_p, /**< call inf
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "%s", string_buffer);
current_size += copied_bytes;
- }
- while (total_size != current_size);
+ } while (total_size != current_size);
jerry_port_log (JERRY_LOG_LEVEL_ERROR, "\n");
jerry_release_value (property);
@@ -103,8 +102,7 @@ jerryx_handler_assert_throw (const jerry_call_info_t *call_info_p, /**< call inf
{
(void) call_info_p; /* unused */
- if (args_cnt == 1
- && jerry_value_is_true (args_p[0]))
+ if (args_cnt == 1 && jerry_value_is_true (args_p[0]))
{
return jerry_create_boolean (true);
}
diff --git a/jerry-ext/handler/handler-gc.c b/jerry-ext/handler/handler-gc.c
index b9feab5d..789d4914 100644
--- a/jerry-ext/handler/handler-gc.c
+++ b/jerry-ext/handler/handler-gc.c
@@ -27,8 +27,8 @@ jerryx_handler_gc (const jerry_call_info_t *call_info_p, /**< call information *
{
(void) call_info_p; /* unused */
- jerry_gc_mode_t mode = ((args_cnt > 0 && jerry_value_to_boolean (args_p[0])) ? JERRY_GC_PRESSURE_HIGH
- : JERRY_GC_PRESSURE_LOW);
+ jerry_gc_mode_t mode =
+ ((args_cnt > 0 && jerry_value_to_boolean (args_p[0])) ? JERRY_GC_PRESSURE_HIGH : JERRY_GC_PRESSURE_LOW);
jerry_gc (mode);
return jerry_create_undefined ();
diff --git a/jerry-ext/handler/handler-print.c b/jerry-ext/handler/handler-print.c
index 7c931605..f5f6f6e1 100644
--- a/jerry-ext/handler/handler-print.c
+++ b/jerry-ext/handler/handler-print.c
@@ -13,9 +13,10 @@
* limitations under the License.
*/
-#include "jerryscript-ext/handler.h"
-#include "jerryscript-port.h"
#include "jerryscript-debugger.h"
+#include "jerryscript-port.h"
+
+#include "jerryscript-ext/handler.h"
/**
* Provide a 'print' implementation for scripts.
@@ -43,7 +44,7 @@ jerryx_handler_print (const jerry_call_info_t *call_info_p, /**< call informatio
{
(void) call_info_p; /* unused */
- const char * const null_str = "\\u0000";
+ const char *const null_str = "\\u0000";
jerry_value_t ret_val = jerry_create_undefined ();
@@ -73,11 +74,7 @@ jerryx_handler_print (const jerry_call_info_t *call_info_p, /**< call informatio
do
{
- jerry_size_t substr_size = jerry_substring_to_utf8_char_buffer (str_val,
- substr_pos,
- length,
- substr_buf,
- 256 - 1);
+ jerry_size_t substr_size = jerry_substring_to_utf8_char_buffer (str_val, substr_pos, length, substr_buf, 256 - 1);
jerry_char_t *buf_end_p = substr_buf + substr_size;
@@ -111,8 +108,7 @@ jerryx_handler_print (const jerry_call_info_t *call_info_p, /**< call informatio
jerry_port_print_char (null_str[null_index]);
}
}
- }
- while (substr_pos < length);
+ } while (substr_pos < length);
jerry_release_value (str_val);
}
diff --git a/jerry-ext/handler/handler-register.c b/jerry-ext/handler/handler-register.c
index caddf884..f4229b72 100644
--- a/jerry-ext/handler/handler-register.c
+++ b/jerry-ext/handler/handler-register.c
@@ -61,7 +61,7 @@ jerryx_register_result
jerryx_set_properties (const jerry_value_t target_object, /**< target object */
const jerryx_property_entry entries[]) /**< array of method entries */
{
-#define JERRYX_SET_PROPERTIES_RESULT(VALUE, IDX) ((jerryx_register_result) { VALUE, IDX })
+#define JERRYX_SET_PROPERTIES_RESULT(VALUE, IDX) ((jerryx_register_result){ VALUE, IDX })
uint32_t idx = 0;
if (entries == NULL)