Files
reactos/reactos/lib/rtl/bit.c
Alex Ionescu 8c002db0c2 - NDK fix: don't undef a million status codes, instead, have apps define WIN32_NO_STATUS.
- 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
2005-10-19 17:03:38 +00:00

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 */