[babl] extensions: fast-float: babl_lookup(): use 1UL, not just 1
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] extensions: fast-float: babl_lookup(): use 1UL, not just 1
- Date: Sat, 20 Aug 2016 17:39:10 +0000 (UTC)
commit de2d56e9c7abe5e581fa2f0abaaabe6b8d0b802c
Author: Roman Lebedev <lebedev ri gmail com>
Date: Fri Aug 19 20:04:59 2016 +0300
extensions: fast-float: babl_lookup(): use 1UL, not just 1
Fixes:
fast-float.c:81:35: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
and
fast-float.c:91:34: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
extensions/fast-float.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/extensions/fast-float.c b/extensions/fast-float.c
index fd7fb9f..04802a9 100644
--- a/extensions/fast-float.c
+++ b/extensions/fast-float.c
@@ -78,7 +78,7 @@ babl_lookup (BablLookup *lookup,
else
return lookup->function (number, lookup->data);
- if (!(lookup->bitmask[i/32] & (1<<(i & 31))))
+ if (!(lookup->bitmask[i/32] & (1UL<<(i & 31))))
{
/* XXX: should look up the value in the middle of the range
* that yields a given value,
@@ -88,7 +88,7 @@ babl_lookup (BablLookup *lookup,
* lookup table..
*/
lookup->table[i]= lookup->function (number, lookup->data);
- lookup->bitmask[i/32] |= (1<<(i & 31));
+ lookup->bitmask[i/32] |= (1UL<<(i & 31));
}
return lookup->table[i];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]