diff options
author | dholland <dholland@NetBSD.org> | 2014-03-22 23:23:55 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2014-03-22 23:23:55 +0000 |
commit | bab8acbebbc3abc9c5408dc3c4b9a0f9a7be035a (patch) | |
tree | 721ffb400df9d2a228c6ec8b62e576bcfa234f75 /battlestar | |
parent | 90c91fd6e16e90924f93dc82972a114cefaf7447 (diff) | |
download | bsdgames-darwin-bab8acbebbc3abc9c5408dc3c4b9a0f9a7be035a.tar.gz bsdgames-darwin-bab8acbebbc3abc9c5408dc3c4b9a0f9a7be035a.tar.zst bsdgames-darwin-bab8acbebbc3abc9c5408dc3c4b9a0f9a7be035a.zip |
avoid signed left-shift
Diffstat (limited to 'battlestar')
-rw-r--r-- | battlestar/extern.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/battlestar/extern.h b/battlestar/extern.h index 74191131..51b407e9 100644 --- a/battlestar/extern.h +++ b/battlestar/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.34 2014/03/22 23:16:21 dholland Exp $ */ +/* $NetBSD: extern.h,v 1.35 2014/03/22 23:23:55 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -42,14 +42,14 @@ #include <time.h> #include <unistd.h> -#define BITS (CHAR_BIT * sizeof (int)) +#define BITS (CHAR_BIT * sizeof (unsigned int)) #define OUTSIDE (position > 68 && position < 246 && position != 218) #define rnd(x) (rand() % (x)) #define max(a,b) ((a) < (b) ? (b) : (a)) -#define testbit(array, index) (array[index/BITS] & (1 << (index % BITS))) -#define setbit(array, index) (array[index/BITS] |= (1 << (index % BITS))) -#define clearbit(array, index) (array[index/BITS] &= ~(1 << (index % BITS))) +#define testbit(array, index) (array[index/BITS] & (1U << (index % BITS))) +#define setbit(array, index) (array[index/BITS] |= (1U << (index % BITS))) +#define clearbit(array, index) (array[index/BITS] &= ~(1U << (index % BITS))) /* well known rooms */ #define FINAL 275 |