diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-08-17 03:06:20 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-08-17 03:06:20 +0000 |
commit | f2d538a105a61ce6d2852700fc328e15ac158827 (patch) | |
tree | 47c819007b231a5a8ebfcc7faa0c1354561366df /source3/lib | |
parent | c5e2c883c0415ca3c7e366357c8c6ba573713aa6 (diff) | |
download | samba-f2d538a105a61ce6d2852700fc328e15ac158827.tar.gz samba-f2d538a105a61ce6d2852700fc328e15ac158827.tar.bz2 samba-f2d538a105a61ce6d2852700fc328e15ac158827.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.
(This used to be commit 8bc2627ff28d340db65bfa017daca2dc291d5ef7)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/bitmap.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/lib/bitmap.c b/source3/lib/bitmap.c index ab84a2a84e..ce677f7846 100644 --- a/source3/lib/bitmap.c +++ b/source3/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))) { |