summaryrefslogtreecommitdiff
path: root/ext2fs/bitmap.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-10-01 21:53:38 +0000
committerRoland McGrath <roland@gnu.org>1999-10-01 21:53:38 +0000
commit93028dc75b5c91d6d7194b0ee6479fd1b090cf6a (patch)
tree8c229d6edad0afecde657e0a1458783545c05325 /ext2fs/bitmap.c
parenta994827b8de4e85f62fa85518bab59569213182a (diff)
1999-10-01 Roland McGrath <roland@baalperazim.frob.com>
* bitmap.c (memscan): Function removed. * ext2fs.h: Removed its decl. * balloc.c (memscan): New static function, defined using memchr.
Diffstat (limited to 'ext2fs/bitmap.c')
-rw-r--r--ext2fs/bitmap.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/ext2fs/bitmap.c b/ext2fs/bitmap.c
index a983cab9..b6c91127 100644
--- a/ext2fs/bitmap.c
+++ b/ext2fs/bitmap.c
@@ -1,6 +1,6 @@
/* Bitmap perusing routines
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1999 Free Software Foundation, Inc.
Converted to work under the hurd by Miles Bader <miles@gnu.ai.mit.edu>
@@ -33,8 +33,8 @@ unsigned long count_free (char * map, unsigned int numchars)
{
unsigned int i;
unsigned long sum = 0;
-
- if (!map)
+
+ if (!map)
return (0);
for (i = 0; i < numchars; i++)
sum += nibblemap[map[i] & 0xf] +
@@ -89,7 +89,7 @@ find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
return size;
size -= result;
offset &= 31UL;
- if (offset)
+ if (offset)
{
tmp = *(p++);
tmp |= ~0UL >> (32-offset);
@@ -100,7 +100,7 @@ find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
size -= 32;
result += 32;
}
- while (size & ~31UL)
+ while (size & ~31UL)
{
if (~(tmp = *(p++)))
goto found_middle;
@@ -126,18 +126,3 @@ find_first_zero_bit(void *buf, unsigned len)
{
return find_next_zero_bit(buf, len, 0);
}
-
-/* ---------------------------------------------------------------- */
-
-/* Returns a pointer to the first occurence of CH in the buffer BUF of len
- LEN, or BUF + LEN if CH doesn't occur. */
-void *memscan(void *buf, unsigned char ch, unsigned len)
-{
- unsigned char *p = (unsigned char *)buf;
- while (len-- > 0)
- if (*p == ch)
- break;
- else
- p++;
- return (void *)p;
-}