diff --git a/libntfs/bootsect.c b/libntfs/bootsect.c index dee15a17..0d9f8125 100644 --- a/libntfs/bootsect.c +++ b/libntfs/bootsect.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * bootsect.c - Boot sector handling code. Part of the Linux-NTFS project. * * Copyright (c) 2000,2001 Anton Altaparmakov. diff --git a/libntfs/compat.c b/libntfs/compat.c index e69de29b..894f9b95 100644 --- a/libntfs/compat.c +++ b/libntfs/compat.c @@ -0,0 +1,56 @@ +/* + * compat.c - Tweaks for Windows compatability + * + * Copyright (c) 2002 Richard Russon. + * + * This program/include file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program/include file is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program (in the main directory of the Linux-NTFS + * distribution in the file COPYING); if not, write to the Free Software + * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifdef WINDOWS + +#include "compat.h" + +int ffs (int x) +{ + int r = 1; + + if (!x) + return 0; + if (!(x & 0xffff)) { + x >>= 16; + r += 16; + } + if (!(x & 0xff)) { + x >>= 8; + r += 8; + } + if (!(x & 0xf)) { + x >>= 4; + r += 4; + } + if (!(x & 3)) { + x >>= 2; + r += 2; + } + if (!(x & 1)) { + x >>= 1; + r += 1; + } + return r; +} + +#endif /* WINDOWS */ + diff --git a/libntfs/debug.c b/libntfs/debug.c index 01328ec0..34e1cb7c 100644 --- a/libntfs/debug.c +++ b/libntfs/debug.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * debug.c - Debugging output functions. Part of the Linux-NTFS project. * * Copyright (c) 2002 Anton Altaparmakov. diff --git a/libntfs/dir.c b/libntfs/dir.c index dd156fba..e9bd2178 100644 --- a/libntfs/dir.c +++ b/libntfs/dir.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * dir.c - Directory handling code. Part of the Linux-NTFS project. * * Copyright (c) 2002 Anton Altaparmakov. diff --git a/libntfs/disk_io.c b/libntfs/disk_io.c index 2d812aec..806db398 100644 --- a/libntfs/disk_io.c +++ b/libntfs/disk_io.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * disk_io.c - Disk io functions. Part of the Linux-NTFS project. * * Copyright (c) 2000-2002 Anton Altaparmakov. diff --git a/libntfs/mst.c b/libntfs/mst.c index e4ece6dc..834fa8a4 100644 --- a/libntfs/mst.c +++ b/libntfs/mst.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * mst.c - Multi sector fixup handling code. Part of the Linux-NTFS project. * * Copyright (c) 2000-2002 Anton Altaparmakov. diff --git a/libntfs/runlist.c b/libntfs/runlist.c index dd2bd15b..95669a00 100644 --- a/libntfs/runlist.c +++ b/libntfs/runlist.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * runlist.c - Run list handling code. Part of the Linux-NTFS project. * * Copyright (c) 2002 Anton Altaparmakov. diff --git a/libntfs/unistr.c b/libntfs/unistr.c index ec749c43..b0321402 100644 --- a/libntfs/unistr.c +++ b/libntfs/unistr.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * unistr.c - Unicode string handling. Part of the Linux-NTFS project. * * Copyright (c) 2000-2002 Anton Altaparmakov. diff --git a/libntfs/volume.c b/libntfs/volume.c index c23f0bcc..d81cb034 100644 --- a/libntfs/volume.c +++ b/libntfs/volume.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * volume.c - NTFS volume handling code. Part of the Linux-NTFS project. * * Copyright (c) 2000-2002 Anton Altaparmakov.