git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
back ported version 3.66f tg3 driver
[linux-2.6.git]
/
scripts
/
binoffset.c
diff --git
a/scripts/binoffset.c
b/scripts/binoffset.c
index
7b8100d
..
1a2e39b
100644
(file)
--- a/
scripts/binoffset.c
+++ b/
scripts/binoffset.c
@@
-1,6
+1,6
@@
/***************************************************************************
* binoffset.c
/***************************************************************************
* binoffset.c
- * (C) 2002 Randy Dunlap <rd
dunlap@osdl.org
>
+ * (C) 2002 Randy Dunlap <rd
unlap@xenotime.net
>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@
-41,7
+41,7
@@
char *progname;
char *inputname;
int inputfd;
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 */
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);
}
exit (1);
}
-
int
get_pattern (int pat_count, char *pats [])
+
void
get_pattern (int pat_count, char *pats [])
{
int ix, err, tmp;
{
int ix, err, tmp;
@@
-81,7
+81,7
@@
int get_pattern (int pat_count, char *pats [])
pat_len = pat_count;
}
pat_len = pat_count;
}
-
int
search_pattern (void)
+
void
search_pattern (void)
{
for (bix = 0; bix < filesize; bix++) {
if (madr[bix] == patterns[0]) {
{
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);
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;
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;
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 ("%
l
d\n", firstloc);
+ fprintf (stderr, "%
l
d\n", firstloc);
exit (num_matches ? 0 : 2);
}
exit (num_matches ? 0 : 2);
}