Ticket #57751: patch-src_xmlpatterns_api_qcoloroutput_p_h

File patch-src_xmlpatterns_api_qcoloroutput_p_h, 826 bytes (added by devernay (Frédéric Devernay), 5 years ago)
Line 
1$OpenBSD$
2
3Use unsigned arithmetic to prevent signed overflow error from gcc 6.
4error: shift expression '(1048575 << 20)' overflows [-fpermissive]
5error: enumerator value for 'BackgroundMask' is not an integer constant
6
7BackgroundMask overflows because it sets bits 20 to 39, but there are
8no bits above 31 in an int.
9
10Index: src/xmlpatterns/api/qcoloroutput_p.h
11--- src/xmlpatterns/api/qcoloroutput_p.h.orig
12+++ src/xmlpatterns/api/qcoloroutput_p.h
13@@ -71,7 +71,7 @@ namespace QPatternist
14             BackgroundShift = 20,
15             SpecialShift    = 20,
16             ForegroundMask  = ((1 << ForegroundShift) - 1) << ForegroundShift,
17-            BackgroundMask  = ((1 << BackgroundShift) - 1) << BackgroundShift
18+            BackgroundMask  = ((1U << BackgroundShift) - 1) << BackgroundShift
19         };
20 
21     public: