diff options
author | Randy Dunlap <rddunlap@osdl.org> | 2004-08-18 04:02:40 +0200 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2004-08-18 04:02:40 +0200 |
commit | d300a25d4a2c395e4d6cc55284142542cbb78140 (patch) | |
tree | 4b3f965fff2b20cec60ce9dd440c66ff59f278a2 /scripts | |
parent | a817884fa8bac6867eded68b5acde4fc11ebb98c (diff) | |
download | history-d300a25d4a2c395e4d6cc55284142542cbb78140.tar.gz |
fix warnings in scripts/binoffset.c
Correct gcc warnings for function return type, printf argument
types, and signed/unsigned compare.
Cross-compiled with no warnings/errors for alpha, ia64,
ppc32, ppc64, sparc32, sparc64, x86_64, and native on i386.
(-W -Wall)
[pre-built tool chains are available from:
http://developer.osdl.org/dev/plm/cross_compile/ ]
Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/binoffset.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/binoffset.c b/scripts/binoffset.c index 7b8100d8e10660..591309d855186b 100644 --- a/scripts/binoffset.c +++ b/scripts/binoffset.c @@ -41,7 +41,7 @@ char *progname; char *inputname; int inputfd; -int bix; /* buf index */ +unsigned int bix; /* buf index */ unsigned char patterns [PAT_SIZE] = {0}; /* byte-sized pattern array */ int pat_len; /* actual number of pattern bytes */ unsigned char *madr; /* mmap address */ @@ -58,7 +58,7 @@ void usage (void) exit (1); } -int get_pattern (int pat_count, char *pats []) +void get_pattern (int pat_count, char *pats []) { int ix, err, tmp; @@ -81,7 +81,7 @@ int get_pattern (int pat_count, char *pats []) pat_len = pat_count; } -int search_pattern (void) +void search_pattern (void) { for (bix = 0; bix < filesize; bix++) { if (madr[bix] == patterns[0]) { @@ -109,7 +109,7 @@ size_t get_filesize (int fd) struct stat stat; err = fstat (fd, &stat); - fprintf (stderr, "filesize: %d\n", err < 0 ? err : stat.st_size); + fprintf (stderr, "filesize: %ld\n", err < 0 ? (long)err : stat.st_size); if (err < 0) return err; return (size_t) stat.st_size; @@ -154,8 +154,8 @@ int main (int argc, char *argv []) fprintf (stderr, "number of pattern matches = %d\n", num_matches); if (num_matches == 0) firstloc = ~0; - printf ("%d\n", firstloc); - fprintf (stderr, "%d\n", firstloc); + printf ("%ld\n", firstloc); + fprintf (stderr, "%ld\n", firstloc); exit (num_matches ? 0 : 2); } |