Return-Path: From: Sven Eckelmann Date: Tue, 17 Jun 2014 21:56:00 +0200 Message-Id: <1403034964-6737-3-git-send-email-sven@narfation.org> In-Reply-To: <1403034964-6737-1-git-send-email-sven@narfation.org> References: <1403034964-6737-1-git-send-email-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH 3/7] batmand: Fix bitarray 1 bit shift type Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: b.a.t.m.a.n@lists.open-mesh.org Cc: Sven Eckelmann The default type of an integer constant is int. This reduced the possible bits for a shift to 32. But the size of uintmax_t is most likely larger (64 bit). Thus the upper 32 bit cannot be accessed correctly with this bitarray implementation. Signed-off-by: Sven Eckelmann --- bitarray.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitarray.c b/bitarray.c index 133f6e7..354eddd 100644 --- a/bitarray.c +++ b/bitarray.c @@ -49,7 +49,7 @@ uint8_t get_bit_status( TYPE_OF_WORD *seq_bits, uint16_t last_seqno, uint16_t cu word_offset= ( last_seqno - curr_seqno ) % WORD_BIT_SIZE; /* which position in the selected word */ word_num = ( last_seqno - curr_seqno ) / WORD_BIT_SIZE; /* which word */ - if ( seq_bits[word_num] & 1<