aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2012-10-11 13:34:49 -0400
committerJeff Mahoney <jeffm@suse.com>2012-10-11 15:57:26 -0400
commitb337b2b190b724317bf41e24c63291bca7227b7d (patch)
tree741141a60681bdeaa2a2d639833d1e9d52317516
parentc21c96f7c39a40bad91b98a2951e7b758ab101ee (diff)
downloadreiserfsprogs-b337b2b190b724317bf41e24c63291bca7227b7d.tar.gz
reiserfsprogs: fix -Wpointer-sign warnings for blocksize and position
This patch fixes the following warnings: pointer targets in passing argument 5 of ‘reiserfs_bin_search’ differ in signedness [-Wpointer-sign] pointer targets in passing argument 2 of ‘init_rollback_file’ differ in signedness [-Wpointer-sign] Signed-off-by: Jeff Mahoney <jeffm@suse.com>
-rw-r--r--include/io.h3
-rw-r--r--include/reiserfs_fs.h6
-rw-r--r--lib/io.c4
-rw-r--r--reiserfscore/reiserfslib.c4
-rw-r--r--reiserfscore/stree.c5
5 files changed, 14 insertions, 8 deletions
diff --git a/include/io.h b/include/io.h
index ae9af4c..d4dc0f0 100644
--- a/include/io.h
+++ b/include/io.h
@@ -72,7 +72,8 @@ struct buffer_head * reiserfs_bread (int dev, unsigned long block, int size, int
int bwrite (struct buffer_head * bh);
void brelse (struct buffer_head * bh);
void bforget (struct buffer_head * bh);
-void init_rollback_file (char * rollback_file, int *bloksize, FILE * log);
+void init_rollback_file (char * rollback_file, unsigned int *blocksize,
+ FILE * log);
int open_rollback_file (char * rollback_file, FILE * log);
void close_rollback_file ();
void do_fsck_rollback (int fd_device, int fd_journal_device, FILE * log);
diff --git a/include/reiserfs_fs.h b/include/reiserfs_fs.h
index bcee57b..1a00c95 100644
--- a/include/reiserfs_fs.h
+++ b/include/reiserfs_fs.h
@@ -1111,8 +1111,8 @@ struct disk_child {
struct path_element {
struct buffer_head * pe_buffer; /* Pointer to the buffer at the path in
the tree. */
- int pe_position; /* Position in the tree node which is placed in the
- buffer above. */
+ unsigned int pe_position; /* Position in the tree node which is placed
+ in the buffer above. */
};
@@ -1512,7 +1512,7 @@ struct buffer_info {
void padd_item (char * item, int total_length, int length);
int B_IS_IN_TREE(struct buffer_head *);
struct key * get_rkey (struct path * p_s_chk_path, reiserfs_filsys_t *);
-int bin_search (void * p_v_key, void * p_v_base, int p_n_num, int p_n_width, int * p_n_pos);
+int bin_search (void * p_v_key, void * p_v_base, int p_n_num, int p_n_width, unsigned int * p_n_pos);
int search_by_key (reiserfs_filsys_t *, struct key *, struct path *, int);
int search_by_entry_key (reiserfs_filsys_t *, struct key *, struct path *);
int search_for_position_by_key (reiserfs_filsys_t *, struct key *, struct path *);
diff --git a/lib/io.c b/lib/io.c
index 3f9fe6a..62aec45 100644
--- a/lib/io.c
+++ b/lib/io.c
@@ -534,7 +534,9 @@ static int do_rollback = 0;
static char * rollback_data;
static int rollback_blocksize;
-void init_rollback_file (char * rollback_file, int *blocksize, FILE * log) {
+void init_rollback_file (char * rollback_file, unsigned int *blocksize,
+ FILE * log)
+{
char * string;
struct stat buf;
diff --git a/reiserfscore/reiserfslib.c b/reiserfscore/reiserfslib.c
index 5cecc3b..9c03ba4 100644
--- a/reiserfscore/reiserfslib.c
+++ b/reiserfscore/reiserfslib.c
@@ -464,7 +464,9 @@ static int reiserfs_search_by_key_x (reiserfs_filsys_t * fs, struct key * key,
}
retval = reiserfs_bin_search (key, B_N_PKEY (bh, 0), B_NR_ITEMS (bh),
is_leaf_node (bh) ? IH_SIZE : KEY_SIZE,
- &(curr->pe_position), key_length == 4 ? comp_keys : comp_keys_3);
+ &curr->pe_position,
+ key_length == 4 ?
+ comp_keys : comp_keys_3);
if (retval == POSITION_FOUND) {
/* key found, return if this is leaf level */
if (is_leaf_node (bh)) {
diff --git a/reiserfscore/stree.c b/reiserfscore/stree.c
index eea7062..566c7f6 100644
--- a/reiserfscore/stree.c
+++ b/reiserfscore/stree.c
@@ -138,7 +138,7 @@ int comp_keys (const void * p1, const void * p2)
there are no possible items, and we have not found it. With each examination we
cut the number of possible items it could be by one more than half rounded down,
or we find it. */
-inline int bin_search (
+int bin_search (
void * p_v_key, /* Key to search for. */
void * p_v_base, /* First item in the array. */
int p_n_num, /* Number of items in the array. */
@@ -150,7 +150,8 @@ inline int bin_search (
of item headers in a node, p_n_width
is actually the item header size not
the item size. */
- int * p_n_pos /* Number of the searched for element. */
+ unsigned int * p_n_pos /* Number of the searched
+ for element. */
) {
int n_rbound, n_lbound, n_j;