summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordscho <dscho>2008-01-31 11:52:50 +0000
committerdscho <dscho>2008-01-31 11:52:50 +0000
commitc5173f364f98230bb51fa8c1baf79d171e2c9e72 (patch)
tree7acf20b300315dac2b1d3276cf8029c4698f427b
parent3d9a5639838d18e790586f0acc294fdf7ebadd74 (diff)
downloadlibtdevnc-c5173f36.tar.gz
libtdevnc-c5173f36.zip
Fix Swap16IfLE() on bytes
When swapping the values for the colour table to little-endian (because they are 16-bit values), we need to cast "unsigned char" to "unsigned short"; otherwise, Microsoft's compiler would keep complaining. Noticed by Christian Ehrlicher. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
-rw-r--r--libvncserver/rfbserver.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index e809110..3dd2f29 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -3093,9 +3093,9 @@ rfbSendSetColourMapEntries(rfbClientPtr cl,
rgb[i*3+1] = Swap16IfLE(cm->data.shorts[i*3+1]);
rgb[i*3+2] = Swap16IfLE(cm->data.shorts[i*3+2]);
} else {
- rgb[i*3] = Swap16IfLE(cm->data.bytes[i*3]);
- rgb[i*3+1] = Swap16IfLE(cm->data.bytes[i*3+1]);
- rgb[i*3+2] = Swap16IfLE(cm->data.bytes[i*3+2]);
+ rgb[i*3] = Swap16IfLE((unsigned short)cm->data.bytes[i*3]);
+ rgb[i*3+1] = Swap16IfLE((unsigned short)cm->data.bytes[i*3+1]);
+ rgb[i*3+2] = Swap16IfLE((unsigned short)cm->data.bytes[i*3+2]);
}
}
}