summaryrefslogtreecommitdiffstats
path: root/src/libnr
diff options
context:
space:
mode:
authorKees Cook <kees@outflux.net>2008-01-25 01:47:22 +0000
committerkeescook <keescook@users.sourceforge.net>2008-01-25 01:47:22 +0000
commit0d3df23255d90d09a3a4ece8fdc75370828dc913 (patch)
treeaa755bc3bda4dbccf87bdd448bd8eeea27332b28 /src/libnr
parentUpdate (diff)
downloadinkscape-0d3df23255d90d09a3a4ece8fdc75370828dc913.tar.gz
inkscape-0d3df23255d90d09a3a4ece8fdc75370828dc913.zip
first set of updates to headers for clean gcc 4.3 builds
(bzr r4588)
Diffstat (limited to 'src/libnr')
-rw-r--r--src/libnr/n-art-bpath.h2
-rw-r--r--src/libnr/nr-pixops.h4
2 files changed, 4 insertions, 2 deletions
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 <stdlib.h>
+
#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<unsigned int divisor> 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<unsigned int divisor> static inline unsigned int FAST_DIV_ROUND(unsigned int v) { return FAST_DIVIDE<divisor>(v+(divisor)/2); }