зеркало из https://github.com/mozilla/pjs.git
Bugzilla bug 104645: Fixed compiler warnings. Improved compiler warning
fixes. r=mcafee. Modified files: src/h_page.c src/hash.c tests/lots.c
This commit is contained in:
Родитель
4ce960a311
Коммит
fcc52c8feb
|
@ -1123,7 +1123,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);
|
||||
|
@ -1165,11 +1165,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. */
|
||||
|
|
|
@ -868,7 +868,7 @@ hash_access(
|
|||
|
||||
if (bp[1] >= REAL_KEY) {
|
||||
/* Real key/data pair */
|
||||
if (size == (unsigned)(off - *bp) &&
|
||||
if (size == (unsigned long)(off - *bp) &&
|
||||
memcmp(kp, rbufp->page + *bp, size) == 0)
|
||||
goto found;
|
||||
off = bp[1];
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -327,7 +327,7 @@ GenData(int32 num)
|
|||
int32 n;
|
||||
static DBT *data=0;
|
||||
int32 *int32_array;
|
||||
int32 size;
|
||||
size_t size;
|
||||
|
||||
if(!data)
|
||||
{
|
||||
|
@ -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));
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче