diff options
author | runge <runge> | 2006-05-13 14:10:57 +0000 |
---|---|---|
committer | runge <runge> | 2006-05-13 14:10:57 +0000 |
commit | 347c4a98475d1dba8030efe33aa0b35856c4d17f (patch) | |
tree | 6edb8cc875fb9d925a94d3fe421d877e30df1013 /libvncserver/scale.c | |
parent | 279f35495a122c9892198545f83e03c6fc50fa08 (diff) | |
download | libtdevnc-347c4a98475d1dba8030efe33aa0b35856c4d17f.tar.gz libtdevnc-347c4a98475d1dba8030efe33aa0b35856c4d17f.zip |
fix some build issues WRT ultravnc code.
Diffstat (limited to 'libvncserver/scale.c')
-rw-r--r-- | libvncserver/scale.c | 13 |
1 files changed, 8 insertions, 5 deletions
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 <math.h> +#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", |