LLVM 10 can't build www/netsurf/libcss because of -Werror.  This diff
allows me to build libcss with LLVM 10 on amd64.  "make test" passes
in libcss, and I can run the netsurf browser.  OK?

I don't remove -Werror.  I change "xx" to from float to double, so
"xx > MAX_INT" stops using the imprecise (float)MAX_INT.    --George

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/netsurf/libcss/Makefile,v
retrieving revision 1.24
diff -u -p -r1.24 Makefile
--- Makefile    27 May 2020 11:38:18 -0000      1.24
+++ Makefile    2 Aug 2020 20:16:27 -0000
@@ -4,6 +4,7 @@ COMMENT =               CSS parser and selection engi
 
 NETSURF_PROJECT =      libcss
 NETSURF_VERSION =      0.9.1
+REVISION =             0
 
 SHARED_LIBS =          css 6.0 #0.9.0
 
Index: patches/patch-include_libcss_fpmath_h
===================================================================
RCS file: patches/patch-include_libcss_fpmath_h
diff -N patches/patch-include_libcss_fpmath_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-include_libcss_fpmath_h       2 Aug 2020 20:16:27 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+/usr/ports/pobj/libcss-0.9.1/libcss-0.9.1/include/libcss/fpmath.h:104:11:
+error: implicit conversion from 'int' to 'float' changes value from
+2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion]
+        if (xx > INT_MAX)
+               ~ ^~~~~~~
+
+Index: include/libcss/fpmath.h
+--- include/libcss/fpmath.h.orig
++++ include/libcss/fpmath.h
+@@ -96,7 +96,7 @@ css_int_to_fixed(const int a) {
+ 
+ static inline css_fixed
+ css_float_to_fixed(const float a) {
+-      float xx = a * (float) (1 << CSS_RADIX_POINT);
++      double xx = a * (float) (1 << CSS_RADIX_POINT);
+ 
+       if (xx < INT_MIN)
+               xx = INT_MIN;

Reply via email to