Skip to content

Commit

Permalink
fixup commit for tag 'DBM_1_6_BETA1'
Browse files Browse the repository at this point in the history
  • Loading branch information
cvs2hg committed Oct 24, 2001
1 parent 953d3be commit c07e451
Show file tree
Hide file tree
Showing 1,379 changed files with 30 additions and 560,817 deletions.
41 changes: 20 additions & 21 deletions dbm/src/h_page.c
Expand Up @@ -292,8 +292,7 @@ __split_page(HTAB *hashp, uint32 obucket, uint32 nbucket)
DBT key, val;
uint16 n, ndx;
int retval;
uint16 copyto, diff, moved;
size_t off;
uint16 copyto, diff, off, moved;
char *op;

copyto = (uint16)hashp->BSIZE;
Expand Down Expand Up @@ -344,7 +343,7 @@ __split_page(HTAB *hashp, uint32 obucket, uint32 nbucket)
if (diff) {
copyto = ino[n + 1] + diff;
memmove(op + copyto, op + ino[n + 1],
off - ino[n + 1]);
(size_t)(off - ino[n + 1]));
ino[ndx] = copyto + ino[n] - ino[n + 1];
ino[ndx + 1] = copyto;
} else
Expand Down Expand Up @@ -692,8 +691,7 @@ __get_page(HTAB *hashp,
int is_disk,
int is_bitmap)
{
register int fd, page;
size_t size;
register int fd, page, size;
int rsize;
uint16 *bp;

Expand All @@ -709,14 +707,14 @@ __get_page(HTAB *hashp,
else
page = OADDR_TO_PAGE(bucket);
if ((MY_LSEEK(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||
((rsize = read(fd, p, size)) == -1))
((rsize = read(fd, p, (size_t)size)) == -1))
return (-1);

bp = (uint16 *)p;
if (!rsize)
bp[0] = 0; /* We hit the EOF, so initialize a new page */
else
if ((unsigned)rsize != size) {
if (rsize != size) {
errno = EFTYPE;
return (-1);
}
Expand Down Expand Up @@ -757,7 +755,7 @@ __get_page(HTAB *hashp,
* the maximum number of entries
* in the array
*/
if((unsigned)max > (size / sizeof(uint16)))
if(max > (size / (int)sizeof(uint16)))
return(DATABASE_CORRUPTED_ERROR);

/* do the byte order swap
Expand Down Expand Up @@ -828,8 +826,7 @@ __get_page(HTAB *hashp,
extern int
__put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap)
{
register int fd, page;
size_t size;
register int fd, page, size;
int wsize;
off_t offset;

Expand All @@ -853,7 +850,7 @@ __put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap)
* the maximum number of entries
* in the array
*/
if((unsigned)max > (size / sizeof(uint16)))
if(max > (size / (int)sizeof(uint16)))
return(DATABASE_CORRUPTED_ERROR);

for (i = 0; i <= max; i++)
Expand All @@ -868,10 +865,10 @@ __put_page(HTAB *hashp, char *p, uint32 bucket, int is_bucket, int is_bitmap)
page = OADDR_TO_PAGE(bucket);
offset = (off_t)page << hashp->BSHIFT;
if ((MY_LSEEK(fd, offset, SEEK_SET) == -1) ||
((wsize = write(fd, p, size)) == -1))
((wsize = write(fd, p, (size_t)size)) == -1))
/* Errno is set */
return (-1);
if ((unsigned)wsize != size) {
if (wsize != size) {
errno = EFTYPE;
return (-1);
}
Expand Down Expand Up @@ -957,7 +954,7 @@ overflow_page(HTAB *hashp)
register uint32 *freep=NULL;
register int max_free, offset, splitnum;
uint16 addr;
uint32 i;
int i;
int bit, first_page, free_bit, free_page, in_use_bits, j;
#ifdef DEBUG2
int tmp1, tmp2;
Expand All @@ -970,16 +967,16 @@ overflow_page(HTAB *hashp)

/* Look through all the free maps to find the first free block */
first_page = hashp->LAST_FREED >>(hashp->BSHIFT + BYTE_SHIFT);
for ( i = first_page; i <= (unsigned)free_page; i++ ) {
for ( i = first_page; i <= free_page; i++ ) {
if (!(freep = (uint32 *)hashp->mapp[i]) &&
!(freep = fetch_bitmap(hashp, i)))
!(freep = fetch_bitmap(hashp, (uint32)i)))
return (0);
if (i == (unsigned)free_page)
if (i == free_page)
in_use_bits = free_bit;
else
in_use_bits = (hashp->BSIZE << BYTE_SHIFT) - 1;

if (i == (unsigned)first_page) {
if (i == first_page) {
bit = hashp->LAST_FREED &
((hashp->BSIZE << BYTE_SHIFT) - 1);
j = bit / BITS_PER_MAP;
Expand Down Expand Up @@ -1088,7 +1085,7 @@ overflow_page(HTAB *hashp)
hashp->LAST_FREED = bit - 1;

/* Calculate the split number for this page */
for (i = 0; (i < (unsigned)splitnum) && (bit > hashp->SPARES[i]); i++) {}
for (i = 0; (i < splitnum) && (bit > hashp->SPARES[i]); i++) {}
offset = (i ? bit - hashp->SPARES[i - 1] : bit);
if (offset >= SPLITMASK)
return (0); /* Out of overflow pages */
Expand Down Expand Up @@ -1123,7 +1120,7 @@ __free_ovflpage(HTAB *hashp, BUFHEAD *obufp)
ndx = (((uint16)addr) >> SPLITSHIFT);
bit_address =
(ndx ? hashp->SPARES[ndx - 1] : 0) + (addr & SPLITMASK) - 1;
if (bit_address < (unsigned)hashp->LAST_FREED)
if (bit_address < (uint32)hashp->LAST_FREED)
hashp->LAST_FREED = bit_address;
free_page = (bit_address >> (hashp->BSHIFT + BYTE_SHIFT));
free_bit = bit_address & ((hashp->BSIZE << BYTE_SHIFT) - 1);
Expand Down Expand Up @@ -1165,11 +1162,13 @@ open_temp(HTAB *hashp)
#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
sigset_t set, oset;
#endif
#if !defined(macintosh)
char * tmpdir;
size_t len;
char last;
#endif
static const char namestr[] = "/_hashXXXXXX";
char filename[1024];
char last;

#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
/* Block signals; make sure file goes away at process exit. */
Expand Down
8 changes: 4 additions & 4 deletions dbm/src/hash.c
Expand Up @@ -868,7 +868,7 @@ hash_access(

if (bp[1] >= REAL_KEY) {
/* Real key/data pair */
if (size == (unsigned)(off - *bp) &&
if (size == (size_t)(off - *bp) &&
memcmp(kp, rbufp->page + *bp, size) == 0)
goto found;
off = bp[1];
Expand Down Expand Up @@ -1012,7 +1012,7 @@ hash_seq(
for (bp = NULL; !bp || !bp[0]; ) {
if (!(bufp = hashp->cpage)) {
for (bucket = hashp->cbucket;
bucket <= (unsigned)hashp->MAX_BUCKET;
bucket <= (uint32)hashp->MAX_BUCKET;
bucket++, hashp->cndx = 1) {
bufp = __get_buf(hashp, bucket, NULL, 0);
if (!bufp)
Expand Down Expand Up @@ -1116,7 +1116,7 @@ __expand_table(HTAB *hashp)
hashp->OVFL_POINT = spare_ndx;
}

if (new_bucket > (unsigned)hashp->HIGH_MASK) {
if (new_bucket > (uint32)hashp->HIGH_MASK) {
/* Starting a new doubling */
hashp->LOW_MASK = hashp->HIGH_MASK;
hashp->HIGH_MASK = new_bucket | hashp->LOW_MASK;
Expand Down Expand Up @@ -1152,7 +1152,7 @@ __call_hash(HTAB *hashp, char *k, size_t len)

n = hashp->hash(k, len);
bucket = n & hashp->HIGH_MASK;
if (bucket > (unsigned)hashp->MAX_BUCKET)
if (bucket > (uint32)hashp->MAX_BUCKET)
bucket = bucket & hashp->LOW_MASK;
return (bucket);
}
Expand Down
12 changes: 6 additions & 6 deletions dbm/tests/lots.c
Expand Up @@ -139,7 +139,7 @@ DBT * MakeLargeKey(int32 num)
static DBT rv;
static char *string_rv=0;
int rep_char;
int32 size;
size_t size;

if(string_rv)
free(string_rv);
Expand All @@ -154,9 +154,9 @@ DBT * MakeLargeKey(int32 num)

/* malloc a string low_bits wide */
size = low_bits*sizeof(char);
string_rv = (char *)malloc((size_t)size);
string_rv = (char *)malloc(size);

memset(string_rv, rep_char, (size_t)size);
memset(string_rv, rep_char, size);

rv.data = string_rv;
rv.size = size;
Expand Down Expand Up @@ -223,7 +223,7 @@ int
VerifyData(DBT *data, int32 num, key_type_enum key_type)
{
int32 count, compare_num;
uint32 size;
size_t size;
int32 *int32_array;

/* The first int32 is count
Expand Down Expand Up @@ -327,7 +327,7 @@ GenData(int32 num)
int32 n;
static DBT *data=0;
int32 *int32_array;
int32 size;
size_t size;

if(!data)
{
Expand All @@ -346,7 +346,7 @@ GenData(int32 num)


size = sizeof(int32)*(n+1);
int32_array = (int32 *) malloc((size_t)size);
int32_array = (int32 *) malloc(size);

memcpy(&int32_array[0], &n, sizeof(int32));

Expand Down
155 changes: 0 additions & 155 deletions security/nss/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion security/nss/cmd/.cvsignore

This file was deleted.

0 comments on commit c07e451

Please sign in to comment.