]> granicus.if.org Git - recode/commitdiff
Redefine BIT_MASK to avoid shifting negative quantity warning
authorReuben Thomas <rrt@sc3d.org>
Tue, 30 Jan 2018 15:49:32 +0000 (15:49 +0000)
committerReuben Thomas <rrt@sc3d.org>
Tue, 30 Jan 2018 17:04:27 +0000 (17:04 +0000)
src/common.h

index 20ba4c788c7181abe4ffd3de260108a17c3751da..9865dd013a6fa19dfac2348412ff330e929a8c58 100644 (file)
@@ -43,7 +43,7 @@
 #define N_(Text) Text
 
 /* Generate a mask of LENGTH one-bits, right justified in a word.  */
-#define BIT_MASK(Length) ((unsigned) ~(~0 << (Length)))
+#define BIT_MASK(Length) ((1U << (Length)) - 1)
 
 /* Indicate if CHARACTER holds into 7 bits.  */
 #define IS_ASCII(Character) \