mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-23 16:10:52 +00:00
Optimized and correct handling of 16 bit in _get_8_bits()
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@27669 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
993a5d976b
commit
d3974d45dc
2 changed files with 16 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
2009-01-13 Riccardo Mottola <rmottola@users.sf.net>
|
||||
|
||||
* Source/art/image.m: Optimized and correct handling of 16 bit in _get_8_bits()
|
||||
|
||||
2009-01-17 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/x11/XGServerWindow.m (_setSupportedWMProtocols:,
|
||||
|
|
|
@ -52,6 +52,18 @@ not just discard the extra bits
|
|||
bit_ofs %= 8;
|
||||
|
||||
v = 0;
|
||||
|
||||
/* if we are handling 16 bit values we optimize */
|
||||
|
||||
/* TODO: this code could be little/big-endian unsafe */
|
||||
if (num_bits == 16)
|
||||
{
|
||||
ptr++;
|
||||
v = *ptr;
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < 8 && i < num_bits; i++)
|
||||
{
|
||||
v <<= 1;
|
||||
|
|
Loading…
Reference in a new issue