patch for bitmap.c in HEAD
andreas moroder
claudiamoroder at st-ulrich.suedtirol.net
Sat Feb 9 01:41:16 GMT 2002
Hello,
in bitmap.c signed and unsigned integers was used for the same values.
Here two small patches to lib/bitmap.c and include/smb.h
that changes the parameters to uint16.
This changes should also be made in 2.2.3
Bye
Andreas
--- bitmap.c Fri Feb 8 19:05:49 2002
+++ bitmap.and Sat Feb 9 10:15:40 2002
@@ -26,7 +26,7 @@
/****************************************************************************
allocate a bitmap of the specified size
****************************************************************************/
-struct bitmap *bitmap_allocate(int n)
+struct bitmap *bitmap_allocate(uint16 n)
{
struct bitmap *bm;
@@ -62,7 +62,7 @@
/****************************************************************************
set a bit in a bitmap
****************************************************************************/
-BOOL bitmap_set(struct bitmap *bm, unsigned i)
+BOOL bitmap_set(struct bitmap *bm, uint16 i)
{
if (i >= bm->n) {
DEBUG(0,("Setting invalid bitmap entry %d (of %d)\n",
@@ -76,7 +76,7 @@
/****************************************************************************
clear a bit in a bitmap
****************************************************************************/
-BOOL bitmap_clear(struct bitmap *bm, unsigned i)
+BOOL bitmap_clear(struct bitmap *bm, uint16 i)
{
if (i >= bm->n) {
DEBUG(0,("clearing invalid bitmap entry %d (of %d)\n",
@@ -90,7 +90,7 @@
/****************************************************************************
query a bit in a bitmap
****************************************************************************/
-BOOL bitmap_query(struct bitmap *bm, unsigned i)
+BOOL bitmap_query(struct bitmap *bm, uint16 i)
{
if (i >= bm->n) return False;
if (bm->b[i/32] & (1<<(i%32))) {
@@ -103,9 +103,9 @@
find a zero bit in a bitmap starting at the specified offset, with
wraparound
****************************************************************************/
-int bitmap_find(struct bitmap *bm, unsigned ofs)
+int bitmap_find(struct bitmap *bm, uint16 ofs)
{
- int i, j;
+ uint16 i, j;
if (ofs > bm->n) ofs = 0;
--- smb.h Fri Feb 8 19:05:48 2002
+++ smb.and Sat Feb 9 10:15:48 2002
@@ -776,7 +776,7 @@
struct bitmap {
uint32 *b;
- int n;
+ uint16 n;
};
#define FLAG_BASIC 0x01 /* fundamental options */
More information about the samba-technical
mailing list