From 8bee19374da063f3600d3eb31cc9ec377392bef1 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Thu, 14 Dec 2000 04:14:56 +0000 Subject: Added some casts to get rid of warnings. (tail_dump): #if 0ed this out to 2000-12-13 Christopher James Lahey * disktail.c (tail_compress): (tail_get): Added some casts to get rid of warnings. (tail_dump): #if 0ed this out to get rid of a warning. (ibex_diskarray_dump): Added a prototype. * ibex_block.c (ibex_index_buffer): Assigned cat the value 0 to start off with to avoid a warning. svn path=/trunk/; revision=6993 --- libibex/ChangeLog | 10 ++++++++++ libibex/disktail.c | 14 +++++++++----- libibex/ibex_block.c | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) (limited to 'libibex') diff --git a/libibex/ChangeLog b/libibex/ChangeLog index 4aa7650b0a..877d9b8e29 100644 --- a/libibex/ChangeLog +++ b/libibex/ChangeLog @@ -1,3 +1,13 @@ +2000-12-13 Christopher James Lahey + + * disktail.c (tail_compress): + (tail_get): Added some casts to get rid of warnings. + (tail_dump): #if 0ed this out to get rid of a warning. + (ibex_diskarray_dump): Added a prototype. + + * ibex_block.c (ibex_index_buffer): Assigned cat the value 0 to + start off with to avoid a warning. + 2000-12-12 Christopher James Lahey * wordindex.c (cache_sanity): Made cache_sanity only be included diff --git a/libibex/disktail.c b/libibex/disktail.c index 9f5a0dbea2..88f5ca6c55 100644 --- a/libibex/disktail.c +++ b/libibex/disktail.c @@ -173,8 +173,8 @@ tail_compress(struct _tailblock *bucket, int index, int newsize) g_assert(newstart+(end-start)-newsize <= &bucket->tb_data[sizeof(bucket->tb_data)/sizeof(bucket->tb_data[0])]); g_assert(newstart + (start-newstart) + MIN(end-start, newsize) <= &bucket->tb_data[sizeof(bucket->tb_data)/sizeof(bucket->tb_data[0])]); - g_assert(newstart+(end-start)-newsize >= &bucket->tb_offset[bucket->used]); - g_assert(newstart + (start-newstart) + MIN(end-start, newsize) >= &bucket->tb_offset[bucket->used]); + g_assert(newstart+(end-start)-newsize >= (blockid_t *) &bucket->tb_offset[bucket->used]); + g_assert(newstart + (start-newstart) + MIN(end-start, newsize) >= (blockid_t *) &bucket->tb_offset[bucket->used]); memmove(newstart+(end-start)-newsize, newstart, ((start-newstart)+MIN(end-start, newsize)) * sizeof(blockid_t)); @@ -198,6 +198,7 @@ tail_space(struct _tailblock *tail) - (blockid_t *)&tail->tb_offset[tail->used]; } +#if 0 static void tail_dump(struct _memcache *blocks, blockid_t tailid) { @@ -210,6 +211,7 @@ tail_dump(struct _memcache *blocks, blockid_t tailid) } printf("\n"); } +#endif static blockid_t tail_get(struct _memcache *blocks, int size) @@ -240,13 +242,13 @@ tail_get(struct _memcache *blocks, int size) ibex_block_dirty((struct _block *)tail); g_assert(&tail->tb_offset[tail->used-1] - < &tail->tb_data[tail->tb_offset[tail->used-1]]); + < (unsigned char *) &tail->tb_data[tail->tb_offset[tail->used-1]]); return tailid; } g_assert(&tail->tb_offset[tail->used-1] - < &tail->tb_data[tail->tb_offset[tail->used-1]]); + < (unsigned char *) &tail->tb_data[tail->tb_offset[tail->used-1]]); /* see if we have a free slot first */ freeindex = -1; @@ -297,7 +299,7 @@ tail_get(struct _memcache *blocks, int size) d(printf("allocated %d (%d), used %d\n", tailid, TAIL_KEY(tailid, 0), tail->used)); g_assert(&tail->tb_offset[tail->used-1] - < &tail->tb_data[tail->tb_offset[tail->used-1]]); + < (unsigned char *) &tail->tb_data[tail->tb_offset[tail->used-1]]); return TAIL_KEY(tailid, 0); } @@ -730,6 +732,8 @@ disk_get(struct _IBEXStore *store, blockid_t head, blockid_t tail) return result; } +void ibex_diskarray_dump(struct _memcache *blocks, blockid_t head, blockid_t tail); + void ibex_diskarray_dump(struct _memcache *blocks, blockid_t head, blockid_t tail) { diff --git a/libibex/ibex_block.c b/libibex/ibex_block.c index 565b8f02dc..41388162c4 100644 --- a/libibex/ibex_block.c +++ b/libibex/ibex_block.c @@ -159,7 +159,7 @@ int ibex_index_buffer (ibex *ib, char *name, char *buffer, size_t len, size_t *unread) { char *p, *q, *nq, *end, *word; - int wordsiz, cat; + int wordsiz, cat = 0; GHashTable *words = g_hash_table_new(g_str_hash, g_str_equal); GPtrArray *wordlist = g_ptr_array_new(); int i, ret=-1; -- cgit