Commit c5173f36 authored by dscho's avatar dscho

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: 's avatarJohannes Schindelin <johannes.schindelin@gmx.de>
parent 3d9a5639
...@@ -3093,9 +3093,9 @@ rfbSendSetColourMapEntries(rfbClientPtr cl, ...@@ -3093,9 +3093,9 @@ rfbSendSetColourMapEntries(rfbClientPtr cl,
rgb[i*3+1] = Swap16IfLE(cm->data.shorts[i*3+1]); rgb[i*3+1] = Swap16IfLE(cm->data.shorts[i*3+1]);
rgb[i*3+2] = Swap16IfLE(cm->data.shorts[i*3+2]); rgb[i*3+2] = Swap16IfLE(cm->data.shorts[i*3+2]);
} else { } else {
rgb[i*3] = Swap16IfLE(cm->data.bytes[i*3]); rgb[i*3] = Swap16IfLE((unsigned short)cm->data.bytes[i*3]);
rgb[i*3+1] = Swap16IfLE(cm->data.bytes[i*3+1]); rgb[i*3+1] = Swap16IfLE((unsigned short)cm->data.bytes[i*3+1]);
rgb[i*3+2] = Swap16IfLE(cm->data.bytes[i*3+2]); rgb[i*3+2] = Swap16IfLE((unsigned short)cm->data.bytes[i*3+2]);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment