misc.c
changeset 3033 e4f7c60a1742
parent 2989 99c95a3ebcaa
child 3046 f81bee40701f
equal deleted inserted replaced
3032:3d607ca2d8fc 3033:e4f7c60a1742
   598 	//  Created by Darkvater.. blame him if it is wrong ;)
   598 	//  Created by Darkvater.. blame him if it is wrong ;)
   599 	// Btw, the macro FINDFIRSTBIT is better to use when your value is
   599 	// Btw, the macro FINDFIRSTBIT is better to use when your value is
   600 	//  not more than 128.
   600 	//  not more than 128.
   601 	byte i = 0;
   601 	byte i = 0;
   602 	if (value & 0xffff0000) { value >>= 16; i += 16; }
   602 	if (value & 0xffff0000) { value >>= 16; i += 16; }
   603 	if (value & 0x0000ff00) { value >>= 8;  i += 8; }
   603 	if (value & 0x0000ff00) { value >>= 8;  i +=  8; }
   604 	if (value & 0x000000f0) { value >>= 4;  i += 4; }
   604 	if (value & 0x000000f0) { value >>= 4;  i +=  4; }
   605 	if (value & 0x0000000c) { value >>= 2;  i += 2; }
   605 	if (value & 0x0000000c) { value >>= 2;  i +=  2; }
   606 	if (value & 0x00000002) { i += 1; }
   606 	if (value & 0x00000002) { i += 1; }
   607 	return i;
   607 	return i;
   608 }
   608 }
   609 
   609 
   610 //!We're writing an own sort algorithm here, as
   610 //!We're writing an own sort algorithm here, as