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>
pull/1/head
dscho 16 years ago
parent 3d9a563983
commit c5173f364f

@ -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]);
}
}
}

Loading…
Cancel
Save