blob: 126d4ff5a0f23cba2dab69c0bb7f54b1c68259be [file] [log] [blame]
Fabio Bertonefa58492015-10-26 13:22:07 -02001Upstream-Status: Inappropriate [configuration]
2
3Subject: [PATCH 5/5] Change compiler warnings
4Organization: O.S. Systems Software LTDA.
5
6Signed-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
12diff --git a/src/debug.c b/src/debug.c
13index 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 Freytherb49f5122011-11-11 21:36:15 +080017 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 Bertonefa58492015-10-26 13:22:07 -020025@@ -63,14 +63,14 @@ void gsm_debug_longword P2( (name, value),
Holger Hans Peter Freytherb49f5122011-11-11 21:36:15 +080026 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 Bertonefa58492015-10-26 13:22:07 -020042diff --git a/src/toast.c b/src/toast.c
43index 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 Freytherb49f5122011-11-11 21:36:15 +080047 {
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 Bertonefa58492015-10-26 13:22:07 -020057@@ -270,7 +270,7 @@ static char* normalname P3((name, want, cut), char *name, char *want,char *cut)
Holger Hans Peter Freytherb49f5122011-11-11 21:36:15 +080058 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 Bertonefa58492015-10-26 13:22:07 -020066@@ -386,7 +386,7 @@ static void update_times P0()
Holger Hans Peter Freytherb49f5122011-11-11 21:36:15 +080067 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 Bertonefa58492015-10-26 13:22:07 -020075@@ -416,7 +416,7 @@ static int okay_as_input P3((name,f,st), char* name, FILE* f, struct stat * st)
Holger Hans Peter Freytherb49f5122011-11-11 21:36:15 +080076 }
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 Bertonefa58492015-10-26 13:22:07 -020084@@ -585,8 +585,8 @@ static int process_decode P0()
Holger Hans Peter Freytherb49f5122011-11-11 21:36:15 +080085
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 Bertonefa58492015-10-26 13:22:07 -020095@@ -624,8 +624,6 @@ static int process_decode P0()
Holger Hans Peter Freytherb49f5122011-11-11 21:36:15 +080096
97 static int process P1((name), char * name)
98 {
99- int step = 0;
100-
101 out = (FILE *)0;
102 in = (FILE *)0;
103
Fabio Bertonefa58492015-10-26 13:22:07 -0200104@@ -779,7 +777,6 @@ int main P2((ac, av), int ac, char **av)
Holger Hans Peter Freytherb49f5122011-11-11 21:36:15 +0800105 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 Bertonefa58492015-10-26 13:22:07 -0200112--
1132.1.4
114