Fabio Berton | efa5849 | 2015-10-26 13:22:07 -0200 | [diff] [blame] | 1 | Upstream-Status: Inappropriate [configuration] |
| 2 | |
| 3 | Subject: [PATCH 5/5] Change compiler warnings |
| 4 | Organization: O.S. Systems Software LTDA. |
| 5 | |
| 6 | Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br> |
| 7 | --- |
| 8 | src/debug.c | 6 +++--- |
| 9 | src/toast.c | 17 +++++++---------- |
| 10 | 2 files changed, 10 insertions(+), 13 deletions(-) |
| 11 | |
| 12 | diff --git a/src/debug.c b/src/debug.c |
| 13 | index 04c3907..a2a5136 100644 |
| 14 | --- a/src/debug.c |
| 15 | +++ b/src/debug.c |
| 16 | @@ -49,7 +49,7 @@ void gsm_debug_longwords P4( (name, from, to, ptr), |
Holger Hans Peter Freyther | b49f512 | 2011-11-11 21:36:15 +0800 | [diff] [blame] | 17 | fprintf( stderr, "%s [%d .. %d]: ", name, from, to ); |
| 18 | while (from <= to) { |
| 19 | |
| 20 | - fprintf(stderr, "%d ", ptr[ from ] ); |
| 21 | + fprintf(stderr, "%ld ", ptr[ from ] ); |
| 22 | from++; |
| 23 | if (nprinted++ >= 7) { |
| 24 | nprinted = 0; |
Fabio Berton | efa5849 | 2015-10-26 13:22:07 -0200 | [diff] [blame] | 25 | @@ -63,14 +63,14 @@ void gsm_debug_longword P2( (name, value), |
Holger Hans Peter Freyther | b49f512 | 2011-11-11 21:36:15 +0800 | [diff] [blame] | 26 | char * name, |
| 27 | longword value ) |
| 28 | { |
| 29 | - fprintf(stderr, "%s: %d\n", name, (long)value ); |
| 30 | + fprintf(stderr, "%s: %ld\n", name, (long)value ); |
| 31 | } |
| 32 | |
| 33 | void gsm_debug_word P2( (name, value), |
| 34 | char * name, |
| 35 | word value ) |
| 36 | { |
| 37 | - fprintf(stderr, "%s: %d\n", name, (long)value); |
| 38 | + fprintf(stderr, "%s: %ld\n", name, (long)value); |
| 39 | } |
| 40 | |
| 41 | #endif |
Fabio Berton | efa5849 | 2015-10-26 13:22:07 -0200 | [diff] [blame] | 42 | diff --git a/src/toast.c b/src/toast.c |
| 43 | index 9823642..55606d7 100644 |
| 44 | --- a/src/toast.c |
| 45 | +++ b/src/toast.c |
| 46 | @@ -251,8 +251,8 @@ static char * emalloc P1((len), size_t len) |
Holger Hans Peter Freyther | b49f512 | 2011-11-11 21:36:15 +0800 | [diff] [blame] | 47 | { |
| 48 | char * s; |
| 49 | if (!(s = malloc(len))) { |
| 50 | - fprintf(stderr, "%s: failed to malloc %d bytes -- abort\n", |
| 51 | - progname, len); |
| 52 | + fprintf(stderr, "%s: failed to malloc %ld bytes -- abort\n", |
| 53 | + progname, (long) len); |
| 54 | onintr(); |
| 55 | exit(1); |
| 56 | } |
Fabio Berton | efa5849 | 2015-10-26 13:22:07 -0200 | [diff] [blame] | 57 | @@ -270,7 +270,7 @@ static char* normalname P3((name, want, cut), char *name, char *want,char *cut) |
Holger Hans Peter Freyther | b49f512 | 2011-11-11 21:36:15 +0800 | [diff] [blame] | 58 | maxlen = strlen(name) + 1 + strlen(want) + strlen(cut); |
| 59 | p = strcpy(emalloc(maxlen), name); |
| 60 | |
| 61 | - if (s = suffix(p, cut)) strcpy(s, want); |
| 62 | + if ((s = suffix(p, cut))) strcpy(s, want); |
| 63 | else if (*want && !suffix(p, want)) strcat(p, want); |
| 64 | |
| 65 | return p; |
Fabio Berton | efa5849 | 2015-10-26 13:22:07 -0200 | [diff] [blame] | 66 | @@ -386,7 +386,7 @@ static void update_times P0() |
Holger Hans Peter Freyther | b49f512 | 2011-11-11 21:36:15 +0800 | [diff] [blame] | 67 | ut[0] = instat.st_atime; |
| 68 | ut[1] = instat.st_mtime; |
| 69 | |
| 70 | - (void) utime(outname, ut); |
| 71 | + (void) utime(outname, (struct utimbuf *)ut); |
| 72 | |
| 73 | #endif /* UTIMBUF */ |
| 74 | } |
Fabio Berton | efa5849 | 2015-10-26 13:22:07 -0200 | [diff] [blame] | 75 | @@ -416,7 +416,7 @@ static int okay_as_input P3((name,f,st), char* name, FILE* f, struct stat * st) |
Holger Hans Peter Freyther | b49f512 | 2011-11-11 21:36:15 +0800 | [diff] [blame] | 76 | } |
| 77 | if (st->st_nlink > 1 && !f_cat && !f_precious) { |
| 78 | fprintf(stderr, |
| 79 | - "%s: \"%s\" has %s other link%s -- unchanged.\n", |
| 80 | + "%s: \"%s\" has %d other link%s -- unchanged.\n", |
| 81 | progname,name,st->st_nlink - 1,"s" + (st->st_nlink<=2)); |
| 82 | return 0; |
| 83 | } |
Fabio Berton | efa5849 | 2015-10-26 13:22:07 -0200 | [diff] [blame] | 84 | @@ -585,8 +585,8 @@ static int process_decode P0() |
Holger Hans Peter Freyther | b49f512 | 2011-11-11 21:36:15 +0800 | [diff] [blame] | 85 | |
| 86 | if (cc != sizeof(s)) { |
| 87 | if (cc >= 0) fprintf(stderr, |
| 88 | - "%s: incomplete frame (%d byte%s missing) from %s\n", |
| 89 | - progname, sizeof(s) - cc, |
| 90 | + "%s: incomplete frame (%ld byte%s missing) from %s\n", |
| 91 | + progname, (long) sizeof(s) - cc, |
| 92 | "s" + (sizeof(s) - cc == 1), |
| 93 | inname ? inname : "stdin" ); |
| 94 | gsm_destroy(r); |
Fabio Berton | efa5849 | 2015-10-26 13:22:07 -0200 | [diff] [blame] | 95 | @@ -624,8 +624,6 @@ static int process_decode P0() |
Holger Hans Peter Freyther | b49f512 | 2011-11-11 21:36:15 +0800 | [diff] [blame] | 96 | |
| 97 | static int process P1((name), char * name) |
| 98 | { |
| 99 | - int step = 0; |
| 100 | - |
| 101 | out = (FILE *)0; |
| 102 | in = (FILE *)0; |
| 103 | |
Fabio Berton | efa5849 | 2015-10-26 13:22:07 -0200 | [diff] [blame] | 104 | @@ -779,7 +777,6 @@ int main P2((ac, av), int ac, char **av) |
Holger Hans Peter Freyther | b49f512 | 2011-11-11 21:36:15 +0800 | [diff] [blame] | 105 | case 'h': help(); exit(0); |
| 106 | |
| 107 | default: |
| 108 | - usage: |
| 109 | fprintf(stderr, |
| 110 | "Usage: %s [-fcpdhvuaslFC] [files...] (-h for help)\n", |
| 111 | progname); |
Fabio Berton | efa5849 | 2015-10-26 13:22:07 -0200 | [diff] [blame] | 112 | -- |
| 113 | 2.1.4 |
| 114 | |