Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e83aaf6e authored by Antoine Soulier's avatar Antoine Soulier Committed by Jakub Pawlowski
Browse files

improvement: Hint for the compiler that 16 bits multiplier is enough

Bug: 221166532
Test: run liblc3_fuzzer
Change-Id: Ieabb30d40027e5d9048027904d610140977d60b0
parent 0639d991
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -83,8 +83,8 @@ enum lc3_bits_mode {
 */

struct lc3_ac_symbol {
    unsigned low   : 16;
    unsigned range : 16;
    uint16_t low   : 16;
    uint16_t range : 16;
};

struct lc3_ac_model {
@@ -286,9 +286,9 @@ static inline unsigned lc3_get_symbol(
    const struct lc3_ac_symbol *symbols = model->s;
    struct lc3_bits_ac *ac = &bits->ac;

    unsigned range = ac->range >> 10;
    uint16_t range = ac->range >> 10;

    ac->error |= (ac->low >= (range << 10));
    ac->error |= (ac->low >= ((unsigned)range << 10));
    if (ac->error)
        ac->low = 0;