File tree Expand file tree Collapse file tree 6 files changed +18
-14
lines changed Expand file tree Collapse file tree 6 files changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -634,7 +634,7 @@ Registers an external magic string array.
634
634
635
635
```c
636
636
void
637
- jerry_register_magic_strings (const jerry_char_t **ex_str_items_p,
637
+ jerry_register_magic_strings (const jerry_char_t * const *ex_str_items_p,
638
638
uint32_t count,
639
639
const jerry_length_t *str_lengths_p);
640
640
```
@@ -657,11 +657,11 @@ main (void)
657
657
658
658
// must be static, because 'jerry_register_magic_strings' does not copy
659
659
// the items must be sorted by size at first, then lexicographically
660
- static const jerry_char_t *magic_string_items[] = {
661
- (const jerry_char_t *) "magicstring1",
662
- (const jerry_char_t *) "magicstring2",
663
- (const jerry_char_t *) "magicstring3"
664
- };
660
+ static const jerry_char_t * const magic_string_items[] = {
661
+ (const jerry_char_t *) "magicstring1",
662
+ (const jerry_char_t *) "magicstring2",
663
+ (const jerry_char_t *) "magicstring3"
664
+ };
665
665
uint32_t num_magic_string_items = (uint32_t) (sizeof (magic_string_items) / sizeof (jerry_char_t *));
666
666
667
667
// must be static, because 'jerry_register_magic_strings' does not copy
Original file line number Diff line number Diff line change @@ -258,14 +258,16 @@ jerry_get_context_data (const jerry_context_data_manager_t *manager_p)
258
258
* Register external magic string array
259
259
*/
260
260
void
261
- jerry_register_magic_strings (const jerry_char_t * * ex_str_items_p , /**< character arrays, representing
262
- * external magic strings' contents */
261
+ jerry_register_magic_strings (const jerry_char_t * const * ex_str_items_p , /**< character arrays, representing
262
+ * external magic strings' contents */
263
263
uint32_t count , /**< number of the strings */
264
264
const jerry_length_t * str_lengths_p ) /**< lengths of all strings */
265
265
{
266
266
jerry_assert_api_available ();
267
267
268
- lit_magic_strings_ex_set ((const lit_utf8_byte_t * * ) ex_str_items_p , count , (const lit_utf8_size_t * ) str_lengths_p );
268
+ lit_magic_strings_ex_set ((const lit_utf8_byte_t * const * ) ex_str_items_p ,
269
+ count ,
270
+ (const lit_utf8_size_t * ) str_lengths_p );
269
271
} /* jerry_register_magic_strings */
270
272
271
273
/**
Original file line number Diff line number Diff line change @@ -303,7 +303,8 @@ typedef struct jerry_context_t jerry_context_t;
303
303
*/
304
304
void jerry_init (jerry_init_flag_t flags );
305
305
void jerry_cleanup (void );
306
- void jerry_register_magic_strings (const jerry_char_t * * ex_str_items_p , uint32_t count ,
306
+ void jerry_register_magic_strings (const jerry_char_t * const * ex_str_items_p ,
307
+ uint32_t count ,
307
308
const jerry_length_t * str_lengths_p );
308
309
void jerry_gc (jerry_gc_mode_t mode );
309
310
void * jerry_get_context_data (const jerry_context_data_manager_t * manager_p );
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ struct jerry_context_t
94
94
jmem_pools_chunk_t * jmem_free_16_byte_chunk_p ; /**< list of free sixteen byte pool chunks */
95
95
#endif /* JERRY_CPOINTER_32_BIT */
96
96
jmem_free_unused_memory_callback_t jmem_free_unused_memory_callback ; /**< Callback for freeing up memory. */
97
- const lit_utf8_byte_t * * lit_magic_string_ex_array ; /**< array of external magic strings */
97
+ const lit_utf8_byte_t * const * lit_magic_string_ex_array ; /**< array of external magic strings */
98
98
const lit_utf8_size_t * lit_magic_string_ex_sizes ; /**< external magic string lengths */
99
99
ecma_lit_storage_item_t * string_list_first_p ; /**< first item of the literal string list */
100
100
ecma_lit_storage_item_t * number_list_first_p ; /**< first item of the literal number list */
Original file line number Diff line number Diff line change @@ -134,8 +134,8 @@ lit_get_magic_string_ex_size (lit_magic_string_ex_id_t id) /**< external magic s
134
134
* Register external magic strings
135
135
*/
136
136
void
137
- lit_magic_strings_ex_set (const lit_utf8_byte_t * * ex_str_items , /**< character arrays, representing
138
- * external magic strings' contents */
137
+ lit_magic_strings_ex_set (const lit_utf8_byte_t * const * ex_str_items , /**< character arrays, representing
138
+ * external magic strings' contents */
139
139
uint32_t count , /**< number of the strings */
140
140
const lit_utf8_size_t * ex_str_sizes ) /**< sizes of the strings */
141
141
{
Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ lit_utf8_size_t lit_get_magic_string_size (lit_magic_string_id_t id);
58
58
const lit_utf8_byte_t * lit_get_magic_string_ex_utf8 (lit_magic_string_ex_id_t id );
59
59
lit_utf8_size_t lit_get_magic_string_ex_size (lit_magic_string_ex_id_t id );
60
60
61
- void lit_magic_strings_ex_set (const lit_utf8_byte_t * * ex_str_items , uint32_t count ,
61
+ void lit_magic_strings_ex_set (const lit_utf8_byte_t * const * ex_str_items ,
62
+ uint32_t count ,
62
63
const lit_utf8_size_t * ex_str_sizes );
63
64
64
65
lit_magic_string_id_t lit_is_utf8_string_magic (const lit_utf8_byte_t * string_p , lit_utf8_size_t string_size );
You can’t perform that action at this time.
0 commit comments