Fixing style according to rules defined in vera++ scripts.

This commit is contained in:
Ruben Ayrapetyan
2015-02-17 19:47:00 +03:00
parent 88353e93cf
commit f42faabe89
12 changed files with 185 additions and 173 deletions
+2 -1
View File
@@ -61,7 +61,8 @@
putchar (' '); \ putchar (' '); \
} \ } \
printf ("^\n"); \ printf ("^\n"); \
printf ("SORRY, Unimplemented: Ln %lu, Col %lu: %s\n", (unsigned long) (line + 1), (unsigned long) (column + 1), MESSAGE); \ printf ("SORRY, Unimplemented: Ln %lu, Col %lu: %s\n", \
(unsigned long) (line + 1), (unsigned long) (column + 1), MESSAGE); \
JERRY_UNIMPLEMENTED ("Unimplemented parser feature."); \ JERRY_UNIMPLEMENTED ("Unimplemented parser feature."); \
} while (0) } while (0)
#else /* JERRY_NDEBUG */ #else /* JERRY_NDEBUG */
+10 -1
View File
@@ -26,7 +26,8 @@
#define LP(s) create_literal_from_str_compute_len (s) #define LP(s) create_literal_from_str_compute_len (s)
#define NUM(s) create_literal_from_num (s) #define NUM(s) create_literal_from_num (s)
static uint8_t opcode_sizes[] = { static uint8_t opcode_sizes[] =
{
OP_LIST (OPCODE_SIZE) OP_LIST (OPCODE_SIZE)
0 0
}; };
@@ -43,15 +44,23 @@ opcodes_equal (const opcode_t *opcodes1, opcode_t *opcodes2, uint16_t size)
uint8_t j; uint8_t j;
if (opcode_num1 != opcode_num2) if (opcode_num1 != opcode_num2)
{
return false; return false;
}
if (opcode_num1 == NAME_TO_ID (nop) || opcode_num1 == NAME_TO_ID (ret)) if (opcode_num1 == NAME_TO_ID (nop) || opcode_num1 == NAME_TO_ID (ret))
{
return true; return true;
}
for (j = 1; j < opcode_sizes[opcode_num1]; j++) for (j = 1; j < opcode_sizes[opcode_num1]; j++)
{
if (((uint8_t*)&opcodes1[i])[j] != ((uint8_t*)&opcodes2[i])[j]) if (((uint8_t*)&opcodes1[i])[j] != ((uint8_t*)&opcodes2[i])[j])
{
return false; return false;
} }
}
}
return true; return true;
} }
+2 -2
View File
@@ -103,7 +103,7 @@ main( int __attr_unused___ argc,
{ {
for (uint32_t j = 0; j < test_sub_iters; j++) for (uint32_t j = 0; j < test_sub_iters; j++)
{ {
size_t size = (unsigned int) rand() % ( test_threshold_block_size ); size_t size = (size_t) rand () % test_threshold_block_size;
ptrs[j] = (uint8_t*) mem_heap_alloc_block (size, ptrs[j] = (uint8_t*) mem_heap_alloc_block (size,
(rand () % 2) ? (rand () % 2) ?
MEM_HEAP_ALLOC_SHORT_TERM : MEM_HEAP_ALLOC_SHORT_TERM); MEM_HEAP_ALLOC_SHORT_TERM : MEM_HEAP_ALLOC_SHORT_TERM);
@@ -124,7 +124,7 @@ main( int __attr_unused___ argc,
JERRY_ASSERT(ptrs[j][k] == 0); JERRY_ASSERT(ptrs[j][k] == 0);
} }
size_t new_size = (unsigned int) rand() % ( test_threshold_block_size ); size_t new_size = (size_t) rand () % (test_threshold_block_size);
if (mem_heap_try_resize_block (ptrs[j], new_size)) if (mem_heap_try_resize_block (ptrs[j], new_size))
{ {
+2 -1
View File
@@ -35,7 +35,8 @@ const uint32_t test_iters = 64;
// Subiterations count // Subiterations count
const uint32_t test_max_sub_iters = 1024; const uint32_t test_max_sub_iters = 1024;
#define TEST_POOL_SPACE_SIZE (sizeof (mem_pool_state_t) + (1ull << MEM_POOL_MAX_CHUNKS_NUMBER_LOG) * MEM_POOL_CHUNK_SIZE) #define TEST_POOL_SPACE_SIZE (sizeof (mem_pool_state_t) + \
(1ull << MEM_POOL_MAX_CHUNKS_NUMBER_LOG) * MEM_POOL_CHUNK_SIZE)
uint8_t test_pool [TEST_POOL_SPACE_SIZE] __attribute__ ((aligned (MEM_ALIGNMENT))); uint8_t test_pool [TEST_POOL_SPACE_SIZE] __attribute__ ((aligned (MEM_ALIGNMENT)));
uint8_t* ptrs[test_max_sub_iters]; uint8_t* ptrs[test_max_sub_iters];
+2 -1
View File
@@ -38,7 +38,8 @@ main( int __attr_unused___ argc,
parser_parse_program (); parser_parse_program ();
parser_free (); parser_free ();
opcode_t opcodes[] = { opcode_t opcodes[] =
{
getop_reg_var_decl (128, 129), // var tmp128 .. tmp129; getop_reg_var_decl (128, 129), // var tmp128 .. tmp129;
getop_var_decl (0), // var a; getop_var_decl (0), // var a;
getop_assignment (129, 1, 1), // tmp129 = 1: SMALLINT; getop_assignment (129, 1, 1), // tmp129 = 1: SMALLINT;