From 0d3df23255d90d09a3a4ece8fdc75370828dc913 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Fri, 25 Jan 2008 01:47:22 +0000 Subject: first set of updates to headers for clean gcc 4.3 builds (bzr r4588) --- src/libnr/n-art-bpath.h | 2 ++ src/libnr/nr-pixops.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libnr') diff --git a/src/libnr/n-art-bpath.h b/src/libnr/n-art-bpath.h index abce499e0..0f0f690fc 100644 --- a/src/libnr/n-art-bpath.h +++ b/src/libnr/n-art-bpath.h @@ -5,6 +5,8 @@ * NArtBpath: old-style path segment. */ +#include + #include "libnr/nr-point.h" #include "libnr/nr-path-code.h" diff --git a/src/libnr/nr-pixops.h b/src/libnr/nr-pixops.h index 2c41f8dbf..417e5e2c9 100644 --- a/src/libnr/nr-pixops.h +++ b/src/libnr/nr-pixops.h @@ -19,8 +19,8 @@ // FAST_DIVIDE assumes that 0<=num<=256*denom // (this covers the case that num=255*denom+denom/2, which is used by DIV_ROUND) template static inline unsigned int FAST_DIVIDE(unsigned int v) { return v/divisor; } -template<> static inline unsigned int FAST_DIVIDE<255>(unsigned int v) { return ((v+1)*0x101) >> 16; } -template<> static inline unsigned int FAST_DIVIDE<255*255>(unsigned int v) { v=(v+1)<<1; v=v+(v>>7)+((v*0x3)>>16)+(v>>22); return (v>>16)>>1; } +template<> inline unsigned int FAST_DIVIDE<255>(unsigned int v) { return ((v+1)*0x101) >> 16; } +template<> inline unsigned int FAST_DIVIDE<255*255>(unsigned int v) { v=(v+1)<<1; v=v+(v>>7)+((v*0x3)>>16)+(v>>22); return (v>>16)>>1; } // FAST_DIV_ROUND assumes that 0<=num<=255*denom (DIV_ROUND should work upto num=2^32-1-(denom/2), // but FAST_DIVIDE_BY_255 already fails at num=65790=258*255, which is not too far above 255.5*255) template static inline unsigned int FAST_DIV_ROUND(unsigned int v) { return FAST_DIVIDE(v+(divisor)/2); } -- cgit v1.2.3