Skip to content

Commit 876622a

Browse files
authored
Fix vera++ rule to find expressions without space after parentheses (#3776)
Regex didn't include some characters that may occur after ')' JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
1 parent 5d60691 commit 876622a

File tree

16 files changed

+30
-30
lines changed

16 files changed

+30
-30
lines changed

jerry-core/ecma/base/ecma-globals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,12 +1748,12 @@ typedef struct
17481748
/**
17491749
* Function callback descriptor of a %TypedArray% object getter
17501750
*/
1751-
typedef ecma_number_t (*ecma_typedarray_getter_fn_t)(lit_utf8_byte_t *src);
1751+
typedef ecma_number_t (*ecma_typedarray_getter_fn_t) (lit_utf8_byte_t *src);
17521752

17531753
/**
17541754
* Function callback descriptor of a %TypedArray% object setter
17551755
*/
1756-
typedef void (*ecma_typedarray_setter_fn_t)(lit_utf8_byte_t *src, ecma_number_t value);
1756+
typedef void (*ecma_typedarray_setter_fn_t) (lit_utf8_byte_t *src, ecma_number_t value);
17571757

17581758
/**
17591759
* Builtin id for the different types of TypedArray's

jerry-core/ecma/base/ecma-helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ uintptr_t JERRY_ATTR_NOINLINE
15271527
ecma_get_current_stack_usage (void)
15281528
{
15291529
volatile int __sp;
1530-
return (uintptr_t) (JERRY_CONTEXT (stack_base) - (uintptr_t)&__sp);
1530+
return (uintptr_t) (JERRY_CONTEXT (stack_base) - (uintptr_t) &__sp);
15311531
} /* ecma_get_current_stack_usage */
15321532

15331533
#endif /* (JERRY_STACK_LIMIT != 0) */

jerry-core/ecma/base/ecma-init-finalize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ecma_init (void)
5353

5454
#if (JERRY_STACK_LIMIT != 0)
5555
volatile int sp;
56-
JERRY_CONTEXT (stack_base) = (uintptr_t)&sp;
56+
JERRY_CONTEXT (stack_base) = (uintptr_t) &sp;
5757
#endif /* (JERRY_STACK_LIMIT != 0) */
5858

5959
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)

jerry-core/ecma/builtin-objects/ecma-builtin-helpers.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ ecma_builtin_helper_error_dispatch_call (ecma_standard_error_t error_type, const
234234
/**
235235
* Comparison callback function header for sorting helper routines.
236236
*/
237-
typedef ecma_value_t (*ecma_builtin_helper_sort_compare_fn_t)(ecma_value_t lhs, /**< left value */
238-
ecma_value_t rhs, /**< right value */
239-
ecma_value_t compare_func); /**< compare function */
237+
typedef ecma_value_t (*ecma_builtin_helper_sort_compare_fn_t) (ecma_value_t lhs, /**< left value */
238+
ecma_value_t rhs, /**< right value */
239+
ecma_value_t compare_func); /**< compare function */
240240

241241
ecma_value_t ecma_builtin_helper_array_heap_sort_helper (ecma_value_t *array_p,
242242
uint32_t right,

jerry-core/ecma/builtin-objects/ecma-builtin-json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ ecma_builtin_json_parse_string (ecma_json_token_t *token_p) /**< token argument
204204

205205
ecma_stringbuilder_append_raw (&result_builder,
206206
unappended_p,
207-
(lit_utf8_size_t)(current_p - unappended_p));
207+
(lit_utf8_size_t) (current_p - unappended_p));
208208
token_p->u.string_p = ecma_stringbuilder_finalize (&result_builder);
209209
token_p->current_p = current_p + 1;
210210
token_p->type = TOKEN_STRING;

jerry-core/ecma/builtin-objects/ecma-builtins.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ typedef const ecma_builtin_property_descriptor_t *ecma_builtin_property_list_ref
4343
/**
4444
* Definition of built-in dispatch routine function pointer.
4545
*/
46-
typedef ecma_value_t (*ecma_builtin_dispatch_routine_t)(uint16_t builtin_routine_id,
47-
ecma_value_t this_arg,
48-
const ecma_value_t arguments_list[],
49-
ecma_length_t arguments_number);
46+
typedef ecma_value_t (*ecma_builtin_dispatch_routine_t) (uint16_t builtin_routine_id,
47+
ecma_value_t this_arg,
48+
const ecma_value_t arguments_list[],
49+
ecma_length_t arguments_number);
5050
/**
5151
* Definition of built-in dispatch call function pointer.
5252
*/
53-
typedef ecma_value_t (*ecma_builtin_dispatch_call_t)(const ecma_value_t arguments_list[],
54-
ecma_length_t arguments_number);
53+
typedef ecma_value_t (*ecma_builtin_dispatch_call_t) (const ecma_value_t arguments_list[],
54+
ecma_length_t arguments_number);
5555
/**
5656
* Definition of a builtin descriptor which contains the builtin object's:
5757
* - prototype objects's id (13-bits)

jerry-core/ecma/operations/ecma-container-object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ ecma_op_container_free_weakmap_entries (ecma_object_t *object_p, /**< object poi
228228

229229
for (uint32_t i = 0; i < entry_count; i += ECMA_CONTAINER_PAIR_SIZE)
230230
{
231-
ecma_container_pair_t *entry_p = (ecma_container_pair_t *)(start_p + i);
231+
ecma_container_pair_t *entry_p = (ecma_container_pair_t *) (start_p + i);
232232

233233
if (ecma_is_value_empty (entry_p->key))
234234
{
@@ -287,7 +287,7 @@ ecma_op_container_free_map_entries (ecma_collection_t *container_p)
287287

288288
for (uint32_t i = 0; i < entry_count; i += ECMA_CONTAINER_PAIR_SIZE)
289289
{
290-
ecma_container_pair_t *entry_p = (ecma_container_pair_t *)(start_p + i);
290+
ecma_container_pair_t *entry_p = (ecma_container_pair_t *) (start_p + i);
291291

292292
if (ecma_is_value_empty (entry_p->key))
293293
{

jerry-core/jmem/jmem-heap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
static inline jmem_heap_free_t * JERRY_ATTR_ALWAYS_INLINE JERRY_ATTR_PURE
6363
jmem_heap_get_region_end (jmem_heap_free_t *curr_p) /**< current region */
6464
{
65-
return (jmem_heap_free_t *)((uint8_t *) curr_p + curr_p->size);
65+
return (jmem_heap_free_t *) ((uint8_t *) curr_p + curr_p->size);
6666
} /* jmem_heap_get_region_end */
6767
#endif /* !ENABLED (JERRY_SYSTEM_ALLOCATOR) */
6868

@@ -516,7 +516,7 @@ jmem_heap_realloc_block (void *ptr, /**< memory region to reallocate */
516516
JMEM_VALGRIND_RESIZE_SPACE (block_p, old_size, new_size);
517517
JMEM_HEAP_STAT_FREE (old_size);
518518
JMEM_HEAP_STAT_ALLOC (new_size);
519-
jmem_heap_insert_block ((jmem_heap_free_t *)((uint8_t *) block_p + aligned_new_size),
519+
jmem_heap_insert_block ((jmem_heap_free_t *) ((uint8_t *) block_p + aligned_new_size),
520520
jmem_heap_find_prev (block_p),
521521
aligned_old_size - aligned_new_size);
522522

jerry-core/vm/vm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,7 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
22712271
stack_top_p[-2] = stack_top_p[-3];
22722272
stack_top_p[-3] = result;
22732273
}
2274-
opcode_data &= (uint32_t)~VM_OC_PUT_STACK;
2274+
opcode_data &= (uint32_t) ~VM_OC_PUT_STACK;
22752275
}
22762276
else if (opcode_data & VM_OC_PUT_BLOCK)
22772277
{
@@ -2334,7 +2334,7 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
23342334
stack_top_p[-2] = stack_top_p[-3];
23352335
stack_top_p[-3] = ecma_copy_value (result);
23362336
}
2337-
opcode_data &= (uint32_t)~VM_OC_PUT_STACK;
2337+
opcode_data &= (uint32_t) ~VM_OC_PUT_STACK;
23382338
}
23392339
else if (opcode_data & VM_OC_PUT_BLOCK)
23402340
{

jerry-ext/debugger/debugger-tcp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ jerryx_debugger_tcp_configure_socket (jerryx_socket server_socket, /** < socket
257257
return false;
258258
}
259259

260-
if (bind (server_socket, (struct sockaddr *)&addr, sizeof (struct sockaddr_in)) != 0)
260+
if (bind (server_socket, (struct sockaddr *) &addr, sizeof (struct sockaddr_in)) != 0)
261261
{
262262
return false;
263263
}
@@ -309,7 +309,7 @@ jerryx_debugger_tcp_create (uint16_t port) /**< listening port */
309309
struct sockaddr_in addr;
310310
socklen_t sin_size = sizeof (struct sockaddr_in);
311311

312-
jerryx_socket tcp_socket = accept (server_socket, (struct sockaddr *)&addr, &sin_size);
312+
jerryx_socket tcp_socket = accept (server_socket, (struct sockaddr *) &addr, &sin_size);
313313

314314
jerryx_debugger_tcp_close_socket (server_socket);
315315

0 commit comments

Comments
 (0)