Skip to content

Commit 18a1a64

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 18a1a64

15 files changed

+88
-46
lines changed

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

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
1+
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
2+
* Copyright 2016 University of Szeged.
23
*
34
* Licensed under the Apache License, Version 2.0 (the "License");
45
* you may not use this file except in compliance with the License.
@@ -20,16 +21,24 @@
2021
#include "jrt.h"
2122
#include "mem-poolman.h"
2223

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

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);
27+
JERRY_STATIC_ASSERT (sizeof (ecma_object_t) <= sizeof (uint64_t),
28+
size_of_ecma_object_t_must_be_less_than_or_equal_to_8_bytes);
29+
JERRY_STATIC_ASSERT (ECMA_OBJECT_OBJ_TYPE_SIZE <= sizeof (uint64_t) * JERRY_BITSINBYTE,
30+
ECMA_OBJECT_OBJ_TYPE_SIZE_must_be_less_than_or_equal_to_bits_in_uint64_t);
31+
JERRY_STATIC_ASSERT (ECMA_OBJECT_LEX_ENV_TYPE_SIZE <= sizeof (uint64_t) * JERRY_BITSINBYTE,
32+
ECMA_OBJECT_LEX_ENV_TYPE_SIZE_must_be_less_than_or_equal_to_bits_in_uint64_t);
2833

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));
34+
JERRY_STATIC_ASSERT (sizeof (ecma_collection_header_t) == sizeof (uint64_t),
35+
size_of_ecma_collection_header_t_must_be_less_than_or_equal_to_8_bytes);
36+
JERRY_STATIC_ASSERT (sizeof (ecma_collection_chunk_t) == sizeof (uint64_t),
37+
size_of_ecma_collection_chunk_t_must_be_less_than_or_equal_to_8_bytes);
38+
JERRY_STATIC_ASSERT (sizeof (ecma_string_t) == sizeof (uint64_t),
39+
size_of_ecma_string_t_must_be_less_than_or_equal_to_8_bytes);
40+
JERRY_STATIC_ASSERT (sizeof (ecma_getter_setter_pointers_t) <= sizeof (uint64_t),
41+
size_of_ecma_getter_setter_pointers_t_must_be_less_than_or_equal_to_8_bytes);
3342

3443
/** \addtogroup ecma ECMA
3544
* @{

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright 2015 Samsung Electronics Co., Ltd.
1+
/* Copyright 2015-2016 Samsung Electronics Co., Ltd.
2+
* Copyright 2016 University of Szeged.
23
*
34
* Licensed under the Apache License, Version 2.0 (the "License");
45
* you may not use this file except in compliance with the License.
@@ -60,7 +61,8 @@ ecma_create_external_pointer_property (ecma_object_t *obj_p, /**< object to crea
6061
is_new = false;
6162
}
6263

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

6567
if (sizeof (ecma_external_pointer_t) == sizeof (uint32_t))
6668
{
@@ -119,7 +121,8 @@ ecma_get_external_pointer_value (ecma_object_t *obj_p, /**< object to get proper
119121
return false;
120122
}
121123

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

124127
if (sizeof (ecma_external_pointer_t) == sizeof (uint32_t))
125128
{

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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
2+
* Copyright 2016 University of Szeged.
23
*
34
* Licensed under the Apache License, Version 2.0 (the "License");
45
* you may not use this file except in compliance with the License.
@@ -41,8 +42,9 @@
4142
/**
4243
* The length should be representable with int32_t.
4344
*/
44-
JERRY_STATIC_ASSERT ((uint32_t) ((int32_t) ECMA_STRING_MAX_CONCATENATION_LENGTH) ==
45-
ECMA_STRING_MAX_CONCATENATION_LENGTH);
45+
JERRY_STATIC_ASSERT ((int32_t) ECMA_STRING_MAX_CONCATENATION_LENGTH ==
46+
ECMA_STRING_MAX_CONCATENATION_LENGTH,
47+
ECMA_STRING_MAX_CONCATENATION_LENGTH_should_be_representable_with_int32_t);
4648

4749
static void
4850
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+
bits_in_ecma_value_t_must_be_greater_than_or_equal_to_ECMA_VALUE_SIZE);
3233

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

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,11 @@ 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 (
448+
ECMA_INTERNAL_PROPERTY__COUNT <= (1ull << ECMA_PROPERTY_INTERNAL_PROPERTY_TYPE_WIDTH),
449+
ECMA_PROPERTY_INTERNAL_PROPERTY_TYPE_WIDTH_bits_must_be_able_to_represent_ECMA_INTERNAL_PROPERTY__COUNT_values
450+
);
451+
448452
JERRY_ASSERT (property_id < ECMA_INTERNAL_PROPERTY__COUNT);
449453

450454
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
2-
* Copyright 2015-2016 University of Szeged
2+
* Copyright 2015-2016 University of Szeged.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -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_bytes);
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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
2+
* Copyright 2015-2016 University of Szeged
23
*
34
* Licensed under the Apache License, Version 2.0 (the "License");
45
* you may not use this file except in compliance with the License.
@@ -314,7 +315,8 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
314315
ECMA_INTERNAL_PROPERTY_BUILT_IN_ROUTINE_DESC);
315316
uint64_t builtin_routine_desc = desc_prop_p->u.internal_property.value;
316317

317-
JERRY_STATIC_ASSERT (sizeof (uint8_t) * JERRY_BITSINBYTE == ECMA_BUILTIN_ROUTINE_ID_LENGTH_VALUE_WIDTH);
318+
JERRY_STATIC_ASSERT (sizeof (uint8_t) * JERRY_BITSINBYTE == ECMA_BUILTIN_ROUTINE_ID_LENGTH_VALUE_WIDTH,
319+
bits_in_uint8_t_must_be_equal_to_ECMA_BUILTIN_ROUTINE_ID_LENGTH_VALUE_WIDTH);
318320
uint8_t length_prop_value = (uint8_t) jrt_extract_bit_field (builtin_routine_desc,
319321
ECMA_BUILTIN_ROUTINE_ID_LENGTH_VALUE_POS,
320322
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)