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:
+15
-23
@@ -18,27 +18,26 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "jerryscript-port-default.h"
|
||||
#include "jerryscript-port.h"
|
||||
#include "jerryscript.h"
|
||||
|
||||
#include "jerryscript-ext/debugger.h"
|
||||
#include "jerryscript-ext/handler.h"
|
||||
#include "jerryscript-port.h"
|
||||
#include "jerryscript-port-default.h"
|
||||
|
||||
#include "main-utils.h"
|
||||
#include "main-options.h"
|
||||
#include "main-utils.h"
|
||||
|
||||
/**
|
||||
* Temporal buffer size.
|
||||
*/
|
||||
#define JERRY_BUFFER_SIZE 256u
|
||||
|
||||
#if defined (JERRY_EXTERNAL_CONTEXT) && (JERRY_EXTERNAL_CONTEXT == 1)
|
||||
#if defined(JERRY_EXTERNAL_CONTEXT) && (JERRY_EXTERNAL_CONTEXT == 1)
|
||||
/**
|
||||
* The alloc function passed to jerry_create_context
|
||||
*/
|
||||
static void *
|
||||
context_alloc (size_t size,
|
||||
void *cb_data_p)
|
||||
context_alloc (size_t size, void *cb_data_p)
|
||||
{
|
||||
(void) cb_data_p; /* unused */
|
||||
return malloc (size);
|
||||
@@ -46,8 +45,7 @@ context_alloc (size_t size,
|
||||
#endif /* defined (JERRY_EXTERNAL_CONTEXT) && (JERRY_EXTERNAL_CONTEXT == 1) */
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char **argv)
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
union
|
||||
{
|
||||
@@ -63,7 +61,7 @@ main (int argc,
|
||||
|
||||
main_parse_args (argc, argv, &arguments);
|
||||
|
||||
#if defined (JERRY_EXTERNAL_CONTEXT) && (JERRY_EXTERNAL_CONTEXT == 1)
|
||||
#if defined(JERRY_EXTERNAL_CONTEXT) && (JERRY_EXTERNAL_CONTEXT == 1)
|
||||
jerry_context_t *context_p = jerry_create_context (JERRY_GLOBAL_HEAP_SIZE * 1024, context_alloc, NULL);
|
||||
jerry_port_default_set_current_context (context_p);
|
||||
#endif /* defined (JERRY_EXTERNAL_CONTEXT) && (JERRY_EXTERNAL_CONTEXT == 1) */
|
||||
@@ -145,8 +143,7 @@ restart:
|
||||
}
|
||||
default:
|
||||
{
|
||||
assert (source_file_p->type == SOURCE_SCRIPT
|
||||
|| source_file_p->type == SOURCE_MODULE);
|
||||
assert (source_file_p->type == SOURCE_SCRIPT || source_file_p->type == SOURCE_MODULE);
|
||||
|
||||
if (!jerry_is_valid_utf8_string ((jerry_char_t *) source_p, (jerry_size_t) source_size))
|
||||
{
|
||||
@@ -157,12 +154,10 @@ restart:
|
||||
|
||||
jerry_parse_options_t parse_options;
|
||||
parse_options.options = JERRY_PARSE_HAS_RESOURCE;
|
||||
parse_options.resource_name = jerry_create_string_sz ((const jerry_char_t *) file_path_p,
|
||||
(jerry_size_t) strlen (file_path_p));
|
||||
parse_options.resource_name =
|
||||
jerry_create_string_sz ((const jerry_char_t *) file_path_p, (jerry_size_t) strlen (file_path_p));
|
||||
|
||||
ret_value = jerry_parse (source_p,
|
||||
source_size,
|
||||
&parse_options);
|
||||
ret_value = jerry_parse (source_p, source_size, &parse_options);
|
||||
|
||||
jerry_release_value (parse_options.resource_name);
|
||||
jerry_port_release_source (source_p);
|
||||
@@ -199,9 +194,7 @@ restart:
|
||||
while (true)
|
||||
{
|
||||
jerry_debugger_wait_for_source_status_t receive_status;
|
||||
receive_status = jerry_debugger_wait_for_client_source (main_wait_for_source_callback,
|
||||
NULL,
|
||||
&ret_value);
|
||||
receive_status = jerry_debugger_wait_for_client_source (main_wait_for_source_callback, NULL, &ret_value);
|
||||
|
||||
if (receive_status == JERRY_DEBUGGER_SOURCE_RECEIVE_FAILED)
|
||||
{
|
||||
@@ -218,8 +211,7 @@ restart:
|
||||
assert (receive_status == JERRY_DEBUGGER_CONTEXT_RESET_RECEIVED
|
||||
|| receive_status == JERRY_DEBUGGER_SOURCE_RECEIVED);
|
||||
|
||||
if (receive_status == JERRY_DEBUGGER_CONTEXT_RESET_RECEIVED
|
||||
|| main_is_value_reset (ret_value))
|
||||
if (receive_status == JERRY_DEBUGGER_CONTEXT_RESET_RECEIVED || main_is_value_reset (ret_value))
|
||||
{
|
||||
jerry_cleanup ();
|
||||
goto restart;
|
||||
@@ -370,7 +362,7 @@ restart:
|
||||
exit:
|
||||
jerry_cleanup ();
|
||||
|
||||
#if defined (JERRY_EXTERNAL_CONTEXT) && (JERRY_EXTERNAL_CONTEXT == 1)
|
||||
#if defined(JERRY_EXTERNAL_CONTEXT) && (JERRY_EXTERNAL_CONTEXT == 1)
|
||||
free (context_p);
|
||||
#endif /* defined (JERRY_EXTERNAL_CONTEXT) && (JERRY_EXTERNAL_CONTEXT == 1) */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user