Skip to content

Commit 0d83ff0

Browse files
committed
Remove redefinitions of typedef in c.
The release.linux build fails with enabled ALL_IN_ONE option. There is no redefinition of typedef in C99. JerryScript-DCO-1.0-Signed-off-by: Robert Sipka [email protected]
1 parent a0bedaa commit 0d83ff0

15 files changed

+72
-38
lines changed

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,24 @@
2020
#include "jrt.h"
2121
#include "mem-poolman.h"
2222

23-
JERRY_STATIC_ASSERT (sizeof (ecma_property_t) <= sizeof (uint64_t));
23+
JERRY_STATIC_ASSERT (sizeof (ecma_property_t) <= sizeof (uint64_t),
24+
size_of_ecma_property_t_must_be_less_than_or_equal_to_8_bytes);
2425

25-
JERRY_STATIC_ASSERT (sizeof (ecma_object_t) <= sizeof (uint64_t));
26-
JERRY_STATIC_ASSERT (ECMA_OBJECT_OBJ_TYPE_SIZE <= sizeof (uint64_t) * JERRY_BITSINBYTE);
27-
JERRY_STATIC_ASSERT (ECMA_OBJECT_LEX_ENV_TYPE_SIZE <= sizeof (uint64_t) * JERRY_BITSINBYTE);
26+
JERRY_STATIC_ASSERT (sizeof (ecma_object_t) <= sizeof (uint64_t),
27+
size_of_ecma_object_t_must_be_less_than_or_equal_to_8_bytes);
28+
JERRY_STATIC_ASSERT (ECMA_OBJECT_OBJ_TYPE_SIZE <= sizeof (uint64_t) * JERRY_BITSINBYTE,
29+
ECMA_OBJECT_OBJ_TYPE_SIZE_must_be_less_than_or_equal_to_64_bytes);
30+
JERRY_STATIC_ASSERT (ECMA_OBJECT_LEX_ENV_TYPE_SIZE <= sizeof (uint64_t) * JERRY_BITSINBYTE,
31+
ECMA_OBJECT_LEX_ENV_TYPE_SIZE_must_be_less_than_or_equal_to_64_bytes);
2832

29-
JERRY_STATIC_ASSERT (sizeof (ecma_collection_header_t) == sizeof (uint64_t));
30-
JERRY_STATIC_ASSERT (sizeof (ecma_collection_chunk_t) == sizeof (uint64_t));
31-
JERRY_STATIC_ASSERT (sizeof (ecma_string_t) == sizeof (uint64_t));
32-
JERRY_STATIC_ASSERT (sizeof (ecma_getter_setter_pointers_t) <= sizeof (uint64_t));
33+
JERRY_STATIC_ASSERT (sizeof (ecma_collection_header_t) == sizeof (uint64_t),
34+
ecma_collection_header_t_must_be_less_than_or_equal_to_8_bytes);
35+
JERRY_STATIC_ASSERT (sizeof (ecma_collection_chunk_t) == sizeof (uint64_t),
36+
ecma_collection_chunk_t_must_be_less_than_or_equal_to_8_bytes);
37+
JERRY_STATIC_ASSERT (sizeof (ecma_string_t) == sizeof (uint64_t),
38+
ecma_string_t_must_be_less_than_or_equal_to_8_bytes);
39+
JERRY_STATIC_ASSERT (sizeof (ecma_getter_setter_pointers_t) <= sizeof (uint64_t),
40+
ecma_getter_setter_pointers_t_must_be_less_than_or_equal_to_8_bytes);
3341

3442
/** \addtogroup ecma ECMA
3543
* @{

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ ecma_create_external_pointer_property (ecma_object_t *obj_p, /**< object to crea
6060
is_new = false;
6161
}
6262

63-
JERRY_STATIC_ASSERT (sizeof (uint32_t) <= sizeof (prop_p->u.internal_property.value));
63+
JERRY_STATIC_ASSERT (sizeof (uint32_t) <= sizeof (prop_p->u.internal_property.value),
64+
size_of_internal_property_value_must_be_greater_than_or_equal_to_4_bytes);
6465

6566
if (sizeof (ecma_external_pointer_t) == sizeof (uint32_t))
6667
{
@@ -119,7 +120,8 @@ ecma_get_external_pointer_value (ecma_object_t *obj_p, /**< object to get proper
119120
return false;
120121
}
121122

122-
JERRY_STATIC_ASSERT (sizeof (uint32_t) <= sizeof (prop_p->u.internal_property.value));
123+
JERRY_STATIC_ASSERT (sizeof (uint32_t) <= sizeof (prop_p->u.internal_property.value),
124+
size_of_internal_property_value_must_be_greater_than_or_equal_to_4_bytes);
123125

124126
if (sizeof (ecma_external_pointer_t) == sizeof (uint32_t))
125127
{

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
#include "ecma-helpers.h"
2626

2727
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
28-
JERRY_STATIC_ASSERT (sizeof (ecma_number_t) == sizeof (uint32_t));
28+
JERRY_STATIC_ASSERT (sizeof (ecma_number_t) == sizeof (uint32_t),
29+
size_of_ecma_number_t_must_be_equal_to_4_bytes);
2930

3031
/**
3132
* Packing sign, fraction and biased exponent to ecma-number
@@ -111,7 +112,8 @@ const int32_t ecma_number_exponent_bias = 127;
111112
*/
112113
const ecma_number_t ecma_number_relative_eps = 1.0e-10f;
113114
#elif CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
114-
JERRY_STATIC_ASSERT (sizeof (ecma_number_t) == sizeof (uint64_t));
115+
JERRY_STATIC_ASSERT (sizeof (ecma_number_t) == sizeof (uint64_t),
116+
size_of_ecma_number_t_must_be_equal_to_8_bytes);
115117

116118
/**
117119
* Packing sign, fraction and biased exponent to ecma-number

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
* The length should be representable with int32_t.
4343
*/
4444
JERRY_STATIC_ASSERT ((uint32_t) ((int32_t) ECMA_STRING_MAX_CONCATENATION_LENGTH) ==
45-
ECMA_STRING_MAX_CONCATENATION_LENGTH);
45+
ECMA_STRING_MAX_CONCATENATION_LENGTH,
46+
the_length_should_be_representable_with_int32_t);
4647

4748
static void
4849
ecma_init_ecma_string_from_lit_cp (ecma_string_t *string_p,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
#include "jrt-bit-fields.h"
2929
#include "vm-defines.h"
3030

31-
JERRY_STATIC_ASSERT (sizeof (ecma_value_t) * JERRY_BITSINBYTE >= ECMA_VALUE_SIZE);
31+
JERRY_STATIC_ASSERT (sizeof (ecma_value_t) * JERRY_BITSINBYTE >= ECMA_VALUE_SIZE,
32+
size_of_ecma_value_t_multiply_by_JERRY_BITSINBYTE_must_be_greater_or_equal_to_ECMA_VALUE_SIZE);
3233

3334
/**
3435
* Get type field of ecma value

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,8 @@ ecma_create_internal_property (ecma_object_t *object_p, /**< the object */
444444
ECMA_SET_POINTER (new_property_p->next_property_p, list_head_p);
445445
ecma_set_property_list (object_p, new_property_p);
446446

447-
JERRY_STATIC_ASSERT (ECMA_INTERNAL_PROPERTY__COUNT <= (1ull << ECMA_PROPERTY_INTERNAL_PROPERTY_TYPE_WIDTH));
447+
JERRY_STATIC_ASSERT (ECMA_INTERNAL_PROPERTY__COUNT <= (1ull << ECMA_PROPERTY_INTERNAL_PROPERTY_TYPE_WIDTH),
448+
ECMA_INTERNAL_PROPERTY__COUNT_must_be_less_than_or_equal_to_1ull_left_shifting_with_5_bits);
448449
JERRY_ASSERT (property_id < ECMA_INTERNAL_PROPERTY__COUNT);
449450

450451
new_property_p->u.internal_property.type = property_id & ((1ull << ECMA_PROPERTY_INTERNAL_PROPERTY_TYPE_WIDTH) - 1);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ typedef struct
4545
uint16_t padding;
4646
} ecma_lcache_hash_entry_t;
4747

48-
JERRY_STATIC_ASSERT (sizeof (ecma_lcache_hash_entry_t) == sizeof (uint64_t));
48+
JERRY_STATIC_ASSERT (sizeof (ecma_lcache_hash_entry_t) == sizeof (uint64_t),
49+
size_of_ecma_lcache_hash_entry_t_must_be_equal_to_8_bytes);
4950

5051
/**
5152
* LCache hash value length, in bits

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ ecma_builtin_global_object_print (ecma_value_t this_arg __attr_unused___, /**< t
108108
}
109109
else
110110
{
111-
JERRY_STATIC_ASSERT (sizeof (code_point) == 2);
111+
JERRY_STATIC_ASSERT (sizeof (code_point) == 2,
112+
size_of_code_point_must_be_equal_to_2);
112113

113114
uint32_t byte_high = (uint32_t) jrt_extract_bit_field (code_point,
114115
JERRY_BITSINBYTE,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
314314
ECMA_INTERNAL_PROPERTY_BUILT_IN_ROUTINE_DESC);
315315
uint64_t builtin_routine_desc = desc_prop_p->u.internal_property.value;
316316

317-
JERRY_STATIC_ASSERT (sizeof (uint8_t) * JERRY_BITSINBYTE == ECMA_BUILTIN_ROUTINE_ID_LENGTH_VALUE_WIDTH);
317+
JERRY_STATIC_ASSERT (sizeof (uint8_t) * JERRY_BITSINBYTE == ECMA_BUILTIN_ROUTINE_ID_LENGTH_VALUE_WIDTH,
318+
size_of_ECMA_BUILTIN_ROUTINE_ID_LENGTH_VALUE_WIDTH_must_be_equal_to_8_bytes);
318319
uint8_t length_prop_value = (uint8_t) jrt_extract_bit_field (builtin_routine_desc,
319320
ECMA_BUILTIN_ROUTINE_ID_LENGTH_VALUE_POS,
320321
ECMA_BUILTIN_ROUTINE_ID_LENGTH_VALUE_WIDTH);

jerry-core/jerry.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,8 @@ jerry_api_invoke_function (bool is_invoke_as_constructor, /**< true - invoke fun
13821382
jerry_api_length_t args_count) /**< number of the arguments */
13831383
{
13841384
JERRY_ASSERT (args_count == 0 || args_p != NULL);
1385-
JERRY_STATIC_ASSERT (sizeof (args_count) == sizeof (ecma_length_t));
1385+
JERRY_STATIC_ASSERT (sizeof (args_count) == sizeof (ecma_length_t),
1386+
size_of_args_count_must_be_equal_to_size_of_ecma_length_t);
13861387

13871388
bool is_successful = true;
13881389

0 commit comments

Comments
 (0)