Skip to content

Commit 87a7887

Browse files
huxinxLaszloLango
authored andcommitted
Replace uint32_t magic string lengths with uint8_t
JerryScript-DCO-1.0-Signed-off-by: Xin Hu [email protected]
1 parent 4062694 commit 87a7887

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

jerry-core/lit/lit-globals.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ typedef uint8_t lit_utf8_byte_t;
114114
*/
115115
typedef uint32_t lit_utf8_size_t;
116116

117+
/**
118+
* Size of a magic string in bytes
119+
*/
120+
typedef uint8_t lit_magic_size_t;
121+
117122
/**
118123
* Unicode code point
119124
*/

jerry-core/lit/lit-magic-strings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* Lengths of magic strings
2222
*/
23-
static lit_utf8_size_t lit_magic_string_sizes[LIT_MAGIC_STRING__COUNT];
23+
static lit_magic_size_t lit_magic_string_sizes[LIT_MAGIC_STRING__COUNT];
2424

2525
/**
2626
* External magic strings data array, count and lengths
@@ -52,7 +52,7 @@ lit_magic_strings_init (void)
5252
id < LIT_MAGIC_STRING__COUNT;
5353
id = (lit_magic_string_id_t) (id + 1))
5454
{
55-
lit_magic_string_sizes[id] = lit_zt_utf8_string_size (lit_get_magic_string_utf8 (id));
55+
lit_magic_string_sizes[id] = (lit_magic_size_t) lit_zt_utf8_string_size (lit_get_magic_string_utf8 (id));
5656

5757
#ifndef JERRY_NDEBUG
5858
ecma_magic_string_max_length = JERRY_MAX (ecma_magic_string_max_length, lit_magic_string_sizes[id]);

0 commit comments

Comments
 (0)