mirror of
https://github.com/reactos/reactos.git
synced 2026-06-23 22:06:28 +08:00
- winnt.h: respect WIN32_NO_STATUS for DBG codes. - rtl: change STDCALL to NTAPI - everything else: add precompiled headers where missing, define WIN32_NO_STATUS. svn path=/trunk/; revision=18598
58 lines
849 B
C
58 lines
849 B
C
/* COPYRIGHT: See COPYING in the top level directory
|
|
* PROJECT: ReactOS system libraries
|
|
* FILE: lib/rtl/bit.c
|
|
* PROGRAMER: Eric Kohl
|
|
*/
|
|
|
|
/* INCLUDES *****************************************************************/
|
|
|
|
#include <rtl.h>
|
|
|
|
#define NDEBUG
|
|
#include <debug.h>
|
|
|
|
/* FUNCTIONS ****************************************************************/
|
|
|
|
/*
|
|
* @implemented
|
|
*/
|
|
CCHAR NTAPI
|
|
RtlFindLeastSignificantBit(IN ULONGLONG Set)
|
|
{
|
|
int i;
|
|
|
|
if (Set == 0ULL)
|
|
return -1;
|
|
|
|
for (i = 0; i < 64; i++)
|
|
{
|
|
if (Set & (1 << i))
|
|
return (CCHAR)i;
|
|
}
|
|
|
|
return -1;
|
|
}
|
|
|
|
|
|
/*
|
|
* @implemented
|
|
*/
|
|
CCHAR NTAPI
|
|
RtlFindMostSignificantBit(IN ULONGLONG Set)
|
|
{
|
|
int i;
|
|
|
|
if (Set == 0ULL)
|
|
return -1;
|
|
|
|
for (i = 63; i >= 0; i--)
|
|
{
|
|
if (Set & (1 << i))
|
|
return (CCHAR)i;
|
|
}
|
|
|
|
return -1;
|
|
}
|
|
|
|
/* EOF */
|