Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes msvc warnings #4862

Closed

Conversation

lygstate
Copy link
Contributor

@lygstate lygstate commented Dec 7, 2021

Simplify the code a bit by rename lit_unicode_white_space_interval_lengths to lit_unicode_white_space_interval_ends

[build] [1/3 33% :: 0.150] Building C object jerry-core\CMakeFiles\jerry-core.dir\lit\lit-char-helpers.c.obj
[build] C:\work\study\languages\typescript\jerryscript\jerry-core\lit\lit-char-helpers.c(154): warning C4018: '<=': signed/unsigned mismatch

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com

Simplify the code a bit by rename lit_unicode_white_space_interval_lengths to lit_unicode_white_space_interval_ends

[build] [1/3  33% :: 0.150] Building C object jerry-core\CMakeFiles\jerry-core.dir\lit\lit-char-helpers.c.obj
[build] C:\work\study\languages\typescript\jerryscript\jerry-core\lit\lit-char-helpers.c(154): warning C4018: '<=': signed/unsigned mismatch

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
*/
static const uint8_t lit_unicode_white_space_interval_lengths[] JERRY_ATTR_CONST_DATA = { 0x000a };
static const uint16_t lit_unicode_white_space_interval_ends[] JERRY_ATTR_CONST_DATA = { 0x2000 + 0x000a };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an auto generated file, so no way that you can edit it like that.

@@ -150,8 +150,7 @@ lit_char_is_white_space (lit_code_point_t c) /**< code point */
}

return (c <= LIT_UTF16_CODE_UNIT_MAX
&& ((c >= lit_unicode_white_space_interval_starts[0]
&& c <= lit_unicode_white_space_interval_starts[0] + lit_unicode_white_space_interval_lengths[0])
&& ((c >= lit_unicode_white_space_interval_starts[0] && c <= lit_unicode_white_space_interval_ends[0])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lit_unicode_white_space_interval_starts[0] is an u16,
lit_unicode_white_space_interval_lengths[0] is an u16,
their sum is an int, so a simple cast to lit_code_point_t should resolve this warning

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot more msvc compile warnings, I'd like if
#4852
#4853
#4854
Can be merged, and we can setup the github windows ci to monitoring these warnings

@rerobika rerobika added the windows Windows specific label Dec 8, 2021
@lygstate lygstate closed this Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
windows Windows specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants