diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2021-07-19 16:02:02 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-07-20 00:09:33 +0000 |
commit | df37450f91aa793423be9a3d59a8bfc50ea5aee2 (patch) | |
tree | 203cdb67df49221dc5e82302145b26e3f940384a /apps/talk.h | |
parent | 09fc9ee9a3355e1700284bc90127948fe523605a (diff) | |
download | rockbox-df37450f91aa793423be9a3d59a8bfc50ea5aee2.tar.gz rockbox-df37450f91aa793423be9a3d59a8bfc50ea5aee2.zip |
talk: Explicitly cast -1 as unsigned before a left shift.
The code is explcitly relying on twos complement numerical represntation
so this just shuts up the compiler and static analysis warnings.
Change-Id: If11cd0a3a4127e8a872a752119d347ac6e09424c
Diffstat (limited to 'apps/talk.h')
-rw-r--r-- | apps/talk.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/talk.h b/apps/talk.h index b4aa344916..d5f3bb2996 100644 --- a/apps/talk.h +++ b/apps/talk.h | |||
@@ -70,13 +70,13 @@ enum talk_status { | |||
70 | 70 | ||
71 | /* make a "talkable" ID from number + unit | 71 | /* make a "talkable" ID from number + unit |
72 | unit is upper 4 bits, number the remaining (in regular 2's complement) */ | 72 | unit is upper 4 bits, number the remaining (in regular 2's complement) */ |
73 | #define TALK_ID(n,u) (((long)(u))<<UNIT_SHIFT | ((n) & ~(-1L<<DECIMAL_SHIFT))) | 73 | #define TALK_ID(n,u) (((long)(u))<<UNIT_SHIFT | ((n) & ~(((unsigned int)-1L)<<DECIMAL_SHIFT))) |
74 | 74 | ||
75 | /* make a "talkable" ID from a decimal number + unit, the decimal number | 75 | /* make a "talkable" ID from a decimal number + unit, the decimal number |
76 | is represented like x*10^d where d is the number of decimal digits */ | 76 | is represented like x*10^d where d is the number of decimal digits */ |
77 | #define TALK_ID_DECIMAL(n,d,u) (((long)(u))<<UNIT_SHIFT |\ | 77 | #define TALK_ID_DECIMAL(n,d,u) (((long)(u))<<UNIT_SHIFT |\ |
78 | ((long)(d))<<DECIMAL_SHIFT |\ | 78 | ((long)(d))<<DECIMAL_SHIFT |\ |
79 | ((n) & ~(-1L<<DECIMAL_SHIFT))) | 79 | ((n) & ~(((unsigned int)-1L)<<DECIMAL_SHIFT))) |
80 | 80 | ||
81 | /* convenience macro to have both virtual pointer and ID as arguments */ | 81 | /* convenience macro to have both virtual pointer and ID as arguments */ |
82 | #define STR(id) ID2P(id), id | 82 | #define STR(id) ID2P(id), id |