Add some fixes required by the C99 standard.
Use c-style cast instead of reinterpret_cast. Use identifiers for function parameters. Use type cast to avoid conversion error. JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
@@ -616,7 +616,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
|||||||
|
|
||||||
lit_string_hash_t hash = name_p->hash;
|
lit_string_hash_t hash = name_p->hash;
|
||||||
uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
|
uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
|
||||||
uint32_t bitmap_column = hash % bitmap_row_size;
|
uint32_t bitmap_column = (uint32_t) (hash % bitmap_row_size);
|
||||||
|
|
||||||
if ((own_names_hashes_bitmap[bitmap_row] & (1u << bitmap_column)) == 0)
|
if ((own_names_hashes_bitmap[bitmap_row] & (1u << bitmap_column)) == 0)
|
||||||
{
|
{
|
||||||
@@ -648,7 +648,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
|||||||
{
|
{
|
||||||
lit_string_hash_t hash = name_p->hash;
|
lit_string_hash_t hash = name_p->hash;
|
||||||
uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
|
uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
|
||||||
uint32_t bitmap_column = hash % bitmap_row_size;
|
uint32_t bitmap_column = (uint32_t) (hash % bitmap_row_size);
|
||||||
|
|
||||||
bool is_add = true;
|
bool is_add = true;
|
||||||
|
|
||||||
@@ -687,7 +687,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
|||||||
|
|
||||||
lit_string_hash_t hash = name_p->hash;
|
lit_string_hash_t hash = name_p->hash;
|
||||||
uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
|
uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
|
||||||
uint32_t bitmap_column = hash % bitmap_row_size;
|
uint32_t bitmap_column = (uint32_t) (hash % bitmap_row_size);
|
||||||
|
|
||||||
if ((names_hashes_bitmap[bitmap_row] & (1u << bitmap_column)) == 0)
|
if ((names_hashes_bitmap[bitmap_row] & (1u << bitmap_column)) == 0)
|
||||||
{
|
{
|
||||||
@@ -805,7 +805,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
|||||||
|
|
||||||
lit_string_hash_t hash = name_p->hash;
|
lit_string_hash_t hash = name_p->hash;
|
||||||
uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
|
uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
|
||||||
uint32_t bitmap_column = hash % bitmap_row_size;
|
uint32_t bitmap_column = (uint32_t) (hash % bitmap_row_size);
|
||||||
|
|
||||||
if ((names_hashes_bitmap[bitmap_row] & (1u << bitmap_column)) == 0)
|
if ((names_hashes_bitmap[bitmap_row] & (1u << bitmap_column)) == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
+10
-3
@@ -287,8 +287,12 @@ static bool foreach (const jerry_api_string_t *name,
|
|||||||
return true;
|
return true;
|
||||||
} /* foreach */
|
} /* foreach */
|
||||||
|
|
||||||
static bool foreach_exception (const jerry_api_string_t *name, const jerry_api_value_t *, void *)
|
#define UNUSED(x) (void)(x)
|
||||||
|
|
||||||
|
static bool foreach_exception (const jerry_api_string_t *name, const jerry_api_value_t *value, void * user_data)
|
||||||
{
|
{
|
||||||
|
UNUSED (value);
|
||||||
|
UNUSED (user_data);
|
||||||
char str_buf_p[128];
|
char str_buf_p[128];
|
||||||
ssize_t sz = jerry_api_string_to_char_buffer (name, (jerry_api_char_t *)str_buf_p, 128);
|
ssize_t sz = jerry_api_string_to_char_buffer (name, (jerry_api_char_t *)str_buf_p, 128);
|
||||||
str_buf_p[sz] = '\0';
|
str_buf_p[sz] = '\0';
|
||||||
@@ -300,9 +304,12 @@ static bool foreach_exception (const jerry_api_string_t *name, const jerry_api_v
|
|||||||
return true;
|
return true;
|
||||||
} /* foreach_exception */
|
} /* foreach_exception */
|
||||||
|
|
||||||
static bool foreach_subset (const jerry_api_string_t *, const jerry_api_value_t *, void *user_data)
|
static bool foreach_subset (const jerry_api_string_t *name, const jerry_api_value_t *value, void *user_data)
|
||||||
{
|
{
|
||||||
int *count_p = reinterpret_cast<int *>(user_data);
|
UNUSED (name);
|
||||||
|
UNUSED (value);
|
||||||
|
int *count_p = (int *) (user_data);
|
||||||
|
|
||||||
if (*count_p == 3)
|
if (*count_p == 3)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -28,10 +28,10 @@
|
|||||||
const uint32_t test_iters = 1024;
|
const uint32_t test_iters = 1024;
|
||||||
|
|
||||||
// Subiterations count
|
// Subiterations count
|
||||||
const uint32_t test_max_sub_iters = 1024;
|
#define TEST_MAX_SUB_ITERS 1024
|
||||||
|
|
||||||
uint8_t *ptrs[test_max_sub_iters];
|
uint8_t *ptrs[TEST_MAX_SUB_ITERS];
|
||||||
uint8_t data[test_max_sub_iters][MEM_POOL_CHUNK_SIZE];
|
uint8_t data[TEST_MAX_SUB_ITERS][MEM_POOL_CHUNK_SIZE];
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int __attr_unused___ argc,
|
main (int __attr_unused___ argc,
|
||||||
@@ -43,7 +43,7 @@ main (int __attr_unused___ argc,
|
|||||||
|
|
||||||
for (uint32_t i = 0; i < test_iters; i++)
|
for (uint32_t i = 0; i < test_iters; i++)
|
||||||
{
|
{
|
||||||
const size_t subiters = ((size_t) rand () % test_max_sub_iters) + 1;
|
const size_t subiters = ((size_t) rand () % TEST_MAX_SUB_ITERS) + 1;
|
||||||
|
|
||||||
for (size_t j = 0; j < subiters; j++)
|
for (size_t j = 0; j < subiters; j++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user