summaryrefslogtreecommitdiffstats
path: root/source/lib/bitmap.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-17 03:06:20 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-17 03:06:20 +0000
commit8bc2627ff28d340db65bfa017daca2dc291d5ef7 (patch)
tree2ab14b18760b8d94a3fed755e0096eda407d095e /source/lib/bitmap.c
parentf1c67a00b8603bf1a9e6bef680c0d563727ba108 (diff)
downloadsamba-8bc2627ff28d340db65bfa017daca2dc291d5ef7.tar.gz
samba-8bc2627ff28d340db65bfa017daca2dc291d5ef7.tar.xz
samba-8bc2627ff28d340db65bfa017daca2dc291d5ef7.zip
some cleanups from the conversion of Pipes[] to a linked list. I also
removed most cases where a pnum is used and substituted a pipes_struct*. in files.c I added a offset of 0x1000 to all file handles on the wire. This makes it much less likely that bad parsing will give us the wrong field.
Diffstat (limited to 'source/lib/bitmap.c')
-rw-r--r--source/lib/bitmap.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source/lib/bitmap.c b/source/lib/bitmap.c
index ab84a2a84ec..ce677f78461 100644
--- a/source/lib/bitmap.c
+++ b/source/lib/bitmap.c
@@ -21,6 +21,8 @@
#include "includes.h"
+extern int DEBUGLEVEL;
+
/* these functions provide a simple way to allocate integers from a
pool without repitition */
@@ -64,7 +66,11 @@ set a bit in a bitmap
****************************************************************************/
BOOL bitmap_set(struct bitmap *bm, unsigned i)
{
- if (i >= bm->n) return False;
+ if (i >= bm->n) {
+ DEBUG(0,("Setting invalid bitmap entry %d (of %d)\n",
+ i, bm->n));
+ return False;
+ }
bm->b[i/32] |= (1<<(i%32));
return True;
}
@@ -74,7 +80,11 @@ clear a bit in a bitmap
****************************************************************************/
BOOL bitmap_clear(struct bitmap *bm, unsigned i)
{
- if (i >= bm->n) return False;
+ if (i >= bm->n) {
+ DEBUG(0,("clearing invalid bitmap entry %d (of %d)\n",
+ i, bm->n));
+ return False;
+ }
bm->b[i/32] &= ~(1<<(i%32));
return True;
}
@@ -82,7 +92,7 @@ BOOL bitmap_clear(struct bitmap *bm, unsigned i)
/****************************************************************************
query a bit in a bitmap
****************************************************************************/
-BOOL bitmap_query(struct bitmap *bm, unsigned i)
+static BOOL bitmap_query(struct bitmap *bm, unsigned i)
{
if (i >= bm->n) return False;
if (bm->b[i/32] & (1<<(i%32))) {