Skip to content

Avoid possible lexer truncation warnings#196

Merged
ToruNiina merged 1 commit intoToruNiina:masterfrom
Jajauma:AvoidCharStaticCasts
Aug 17, 2022
Merged

Avoid possible lexer truncation warnings#196
ToruNiina merged 1 commit intoToruNiina:masterfrom
Jajauma:AvoidCharStaticCasts

Conversation

@Jajauma
Copy link
Contributor

@Jajauma Jajauma commented Aug 13, 2022

Instead of static_cast calls that convert int to char, literals of type
char are now used directly with the value encoded via escape sequence.

The benefits are:

  • code without static_cast is much more compact and expresses intent
    better
  • fixed value truncation warning on some compilers (e.g. C4309 on Visual
    Studio 2017)

Instead of static_cast calls that convert int to char, literals of type
char are now used directly with the value encoded via escape sequence.

The benefits are:
- code without static_cast is much more compact and expresses intent
better
- fixed value truncation warning on some compilers (e.g. C4309 on Visual
Studio 2017)
Copy link
Owner

@ToruNiina ToruNiina left a comment

Choose a reason for hiding this comment

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

nice. Thank you!

@ToruNiina ToruNiina merged commit bbdbae9 into ToruNiina:master Aug 17, 2022
@Jajauma Jajauma deleted the AvoidCharStaticCasts branch August 18, 2022 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants