summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-07-19 16:02:02 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-07-20 00:09:33 +0000
commitdf37450f91aa793423be9a3d59a8bfc50ea5aee2 (patch)
tree203cdb67df49221dc5e82302145b26e3f940384a
parent09fc9ee9a3355e1700284bc90127948fe523605a (diff)
downloadrockbox-df37450f91.tar.gz
rockbox-df37450f91.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
-rw-r--r--apps/talk.h4
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 {
/* make a "talkable" ID from number + unit
unit is upper 4 bits, number the remaining (in regular 2's complement) */
-#define TALK_ID(n,u) (((long)(u))<<UNIT_SHIFT | ((n) & ~(-1L<<DECIMAL_SHIFT)))
+#define TALK_ID(n,u) (((long)(u))<<UNIT_SHIFT | ((n) & ~(((unsigned int)-1L)<<DECIMAL_SHIFT)))
/* make a "talkable" ID from a decimal number + unit, the decimal number
is represented like x*10^d where d is the number of decimal digits */
#define TALK_ID_DECIMAL(n,d,u) (((long)(u))<<UNIT_SHIFT |\
((long)(d))<<DECIMAL_SHIFT |\
- ((n) & ~(-1L<<DECIMAL_SHIFT)))
+ ((n) & ~(((unsigned int)-1L)<<DECIMAL_SHIFT)))
/* convenience macro to have both virtual pointer and ID as arguments */
#define STR(id) ID2P(id), id