From 347c4a98475d1dba8030efe33aa0b35856c4d17f Mon Sep 17 00:00:00 2001 From: runge Date: Sat, 13 May 2006 14:10:57 +0000 Subject: fix some build issues WRT ultravnc code. --- libvncserver/scale.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libvncserver/scale.c') diff --git a/libvncserver/scale.c b/libvncserver/scale.c index 44d1d11..63d232e 100644 --- a/libvncserver/scale.c +++ b/libvncserver/scale.c @@ -66,7 +66,10 @@ #endif /****************************/ -#include +#define CEIL(x) ( (double) ((int) (x)) == (x) ? \ + (double) ((int) (x)) : (double) ((int) (x) + 1) ) +#define FLOOR(x) ( (double) ((int) (x)) ) + int ScaleX(rfbScreenInfoPtr from, rfbScreenInfoPtr to, int x) { @@ -105,12 +108,12 @@ void rfbScaledCorrection(rfbScreenInfoPtr from, rfbScreenInfoPtr to, int *x, int /*cast from double to int is same as "*x = floor(x1);" */ - x2 = floor(x1); - y2 = floor(y1); + x2 = FLOOR(x1); + y2 = FLOOR(y1); /* include into W and H the jitter of scaling X and Y */ - w2 = ceil(w1 + ( x1 - x2 )); - h2 = ceil(h1 + ( y1 - y2 )); + w2 = CEIL(w1 + ( x1 - x2 )); + h2 = CEIL(h1 + ( y1 - y2 )); /* * rfbLog("%s (%dXx%dY-%dWx%dH -> %fXx%fY-%fWx%fH) {%dWx%dH -> %dWx%dH}\n", -- cgit v1.2.3