From: Jeff Mahoney <jeffm@suse.com>
To: reiserfs-devel@vger.kernel.org
Subject: [PATCH 06/10] reiserfsprogs: fix -Wpointer-sign warnings for blocksize and position
Date: Thu, 11 Oct 2012 13:34:49 -0400 [thread overview]
Message-ID: <20121011200115.BDB2F200B2@oldboy.suse.de> (raw)
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>
---
include/io.h | 3 ++-
include/reiserfs_fs.h | 6 +++---
lib/io.c | 4 +++-
reiserfscore/reiserfslib.c | 4 +++-
reiserfscore/stree.c | 5 +++--
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;
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
reply other threads:[~2012-10-11 17:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121011200115.BDB2F200B2@oldboy.suse.de \
--to=jeffm@suse.com \
--cc=reiserfs-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).