[hackers] [libgrapheme] Use explicit constant-macro instead of cast || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Tue, 4 Oct 2022 08:11:49 +0200 (CEST)

commit 0aa5d262f8d0975341bcc60916e12044c7d64d0d
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Tue Oct 4 08:11:00 2022 +0200
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Tue Oct 4 08:11:40 2022 +0200

    Use explicit constant-macro instead of cast
    
    Thanks NRK for the suggestion!
    
    Signed-off-by: Laslo Hunhold <dev_AT_frign.de>

diff --git a/src/character.c b/src/character.c
index 4240332..7bcc72f 100644
--- a/src/character.c
+++ b/src/character.c
_AT_@ -132,9 +132,9 @@ static inline void
 state_deserialize(uint_least16_t in, struct character_break_state *out)
 {
         out->prop = in & UINT8_C(0xFF);
- out->prop_set = in & (((uint_least16_t)(1)) << 8);
- out->gb11_flag = in & (((uint_least16_t)(1)) << 9);
- out->gb12_13_flag = in & (((uint_least16_t)(1)) << 10);
+ out->prop_set = in & (UINT16_C(1) << 8);
+ out->gb11_flag = in & (UINT16_C(1) << 9);
+ out->gb12_13_flag = in & (UINT16_C(1) << 10);
 }
 
 bool
Received on Tue Oct 04 2022 - 08:11:49 CEST

This archive was generated by hypermail 2.3.0 : Tue Oct 04 2022 - 08:12:40 CEST