summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2011-03-17 14:43:55 +0100
committerChristian Beier <dontmind@freeshell.org>2011-03-17 14:43:55 +0100
commitfe1ca16e9b75b5f38ab374c8dfff92d2c3ea4532 (patch)
tree8539521ed668d65f6dbd59c491bc9565bce6e8cb /examples
parent56234cd0b656de3c8827288f2adf78c9cb12d0c5 (diff)
downloadlibtdevnc-fe1ca16e9b75b5f38ab374c8dfff92d2c3ea4532.tar.gz
libtdevnc-fe1ca16e9b75b5f38ab374c8dfff92d2c3ea4532.zip
Fix (most) MinGW32 compiler warnings.
Diffstat (limited to 'examples')
-rw-r--r--examples/rotate.c30
-rw-r--r--examples/rotatetemplate.c10
-rw-r--r--examples/vncev.c3
3 files changed, 22 insertions, 21 deletions
diff --git a/examples/rotate.c b/examples/rotate.c
index e552e4a..028de8c 100644
--- a/examples/rotate.c
+++ b/examples/rotate.c
@@ -10,22 +10,22 @@
#define FUNCNAME rfbRotate
#define FUNC(i, j) (h - 1 - j + i * h)
#define SWAPDIMENSIONS
-#define OUT 8
+#define OUTBITS 8
#include "rotatetemplate.c"
-#define OUT 16
+#define OUTBITS 16
#include "rotatetemplate.c"
-#define OUT 32
+#define OUTBITS 32
#include "rotatetemplate.c"
#undef FUNCNAME
#undef FUNC
#define FUNCNAME rfbRotateCounterClockwise
#define FUNC(i, j) (j + (w - 1 - i) * h)
-#define OUT 8
+#define OUTBITS 8
#include "rotatetemplate.c"
-#define OUT 16
+#define OUTBITS 16
#include "rotatetemplate.c"
-#define OUT 32
+#define OUTBITS 32
#include "rotatetemplate.c"
#undef FUNCNAME
#undef FUNC
@@ -33,33 +33,33 @@
#define FUNCNAME rfbFlipHorizontally
#define FUNC(i, j) ((w - 1 - i) + j * w)
-#define OUT 8
+#define OUTBITS 8
#include "rotatetemplate.c"
-#define OUT 16
+#define OUTBITS 16
#include "rotatetemplate.c"
-#define OUT 32
+#define OUTBITS 32
#include "rotatetemplate.c"
#undef FUNCNAME
#undef FUNC
#define FUNCNAME rfbFlipVertically
#define FUNC(i, j) (i + (h - 1 - j) * w)
-#define OUT 8
+#define OUTBITS 8
#include "rotatetemplate.c"
-#define OUT 16
+#define OUTBITS 16
#include "rotatetemplate.c"
-#define OUT 32
+#define OUTBITS 32
#include "rotatetemplate.c"
#undef FUNCNAME
#undef FUNC
#define FUNCNAME rfbRotateHundredAndEighty
#define FUNC(i, j) ((w - 1 - i) + (h - 1 - j) * w)
-#define OUT 8
+#define OUTBITS 8
#include "rotatetemplate.c"
-#define OUT 16
+#define OUTBITS 16
#include "rotatetemplate.c"
-#define OUT 32
+#define OUTBITS 32
#include "rotatetemplate.c"
#undef FUNCNAME
#undef FUNC
diff --git a/examples/rotatetemplate.c b/examples/rotatetemplate.c
index 57dc052..0d7e007 100644
--- a/examples/rotatetemplate.c
+++ b/examples/rotatetemplate.c
@@ -1,5 +1,5 @@
-#define OUT_T CONCAT3E(uint,OUT,_t)
-#define FUNCTION CONCAT2E(FUNCNAME,OUT)
+#define OUT_T CONCAT3E(uint,OUTBITS,_t)
+#define FUNCTION CONCAT2E(FUNCNAME,OUTBITS)
static void FUNCTION(rfbScreenInfoPtr screen)
{
@@ -16,7 +16,7 @@ static void FUNCTION(rfbScreenInfoPtr screen)
#ifdef SWAPDIMENSIONS
screen->width = h;
- screen->paddedWidthInBytes = h * OUT / 8;
+ screen->paddedWidthInBytes = h * OUTBITS / 8;
screen->height = w;
{
@@ -31,7 +31,7 @@ static void FUNCTION(rfbScreenInfoPtr screen)
rfbMarkRectAsModified(screen, 0, 0, screen->width, screen->height);
}
-#if OUT == 32
+#if OUTBITS == 32
void FUNCNAME(rfbScreenInfoPtr screen) {
if (screen->serverFormat.bitsPerPixel == 32)
CONCAT2E(FUNCNAME,32)(screen);
@@ -48,5 +48,5 @@ void FUNCNAME(rfbScreenInfoPtr screen) {
#endif
#undef FUNCTION
-#undef OUT
+#undef OUTBITS
diff --git a/examples/vncev.c b/examples/vncev.c
index ba9441a..b185746 100644
--- a/examples/vncev.c
+++ b/examples/vncev.c
@@ -99,7 +99,8 @@ static enum rfbNewClientAction newclient(rfbClientPtr cl)
{
char buffer[1024];
struct sockaddr_in addr;
- unsigned int len=sizeof(addr),ip;
+ socklen_t len=sizeof(addr);
+ unsigned int ip;
getpeername(cl->sock,(struct sockaddr*)&addr,&len);
ip=ntohl(addr.sin_addr.s_addr);