lib/bloom: Fix a -Wconversion warning in OstreeBloom
authorPhilip Withnall <withnall@endlessm.com>
Sat, 30 Sep 2017 23:13:17 +0000 (00:13 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Sun, 1 Oct 2017 12:24:46 +0000 (12:24 +0000)
Compiling with -Wconversion warns on this line, as the conversion from
guint64 to guint8 is implicit (but safe: there is no bug here, since the
implicit cast is applied after the modulus arithmetic).

Make the cast explicit to silence -Wconversion.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1231
Approved by: cgwalters

src/libostree/ostree-bloom.c

index 8defb1767354ba743ed382f1536ebf48348f930d..9bd2ad2835b025399a6e1a3c4f9e7e4692e2ec83 100644 (file)
@@ -246,7 +246,7 @@ ostree_bloom_set_bit (OstreeBloom *bloom,
 {
   g_assert (bloom->is_mutable);
   g_assert (idx / 8 < bloom->n_bytes);
-  bloom->mutable_bytes[idx / 8] |= (1 << (idx % 8));
+  bloom->mutable_bytes[idx / 8] |= (guint8) (1 << (idx % 8));
 }
 
 /**