Package: jzip / 210r20001005d-2

compiler-warnings Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
Fix various compiler warnings.

Most of these by Michael Stroucken <stroucki@debian.org>, with
some added by Niko Tyni <ntyni@iki.fi>.

Adapted to quilt by Niko Tyni <ntyni@iki.fi>
Index: jzip-210r20001005/unixio.c
===================================================================
--- jzip-210r20001005.orig/unixio.c	2000-10-05 17:08:10.000000000 +0300
+++ jzip-210r20001005/unixio.c	2006-07-14 00:28:27.000000000 +0300
@@ -101,8 +101,10 @@
 static int wait_for_char(  );
 static int read_key( int );
 static void set_cbreak_mode( int );
+#if 0
 static void rundown(  );
 static void sig_rundown(  );
+#endif
 void get_prev_command(  );
 void get_next_command(  );
 void get_first_command(  );
@@ -126,6 +128,7 @@
 extern char *tgetstr(  );
 extern char *tgoto(  );
 extern void tputs(  );
+extern char *tgetflag(  );
 
 void outc( int c )
 {
@@ -756,9 +759,6 @@
 
 int input_line( int buflen, char *buffer, int timeout, int *read_size )
 {
-   struct timeval tv;
-   struct timezone tz;
-
    int c, col;
    int init_char_pos, curr_char_pos;
    int loop, tail_col;
@@ -1023,8 +1023,6 @@
  */
 int input_character( int timeout )
 {
-   struct timeval tv;
-   struct timezone tz;
    int c;
 
    fflush( stdout );
@@ -1078,7 +1076,7 @@
 
 static int read_key( int mode )
 {
-   int c;
+   int c = 0;
 
    if ( mode == PLAIN )
    {
@@ -1162,9 +1160,11 @@
    if ( mode )
    {
 
+#if 0
 /*        signal (SIGINT, sig_rundown);
         signal (SIGTERM, sig_rundown);
 	*/
+#endif
    }
 
    if ( mode )
@@ -1230,6 +1230,7 @@
 
 }                               /* set_cbreak_mode */
 
+#if 0
 static void rundown(  )
 {
    unload_cache(  );
@@ -1245,6 +1246,7 @@
    close_script(  );
    sig_reset_screen(  );
 }                               /* rundown */
+#endif
 
 #if defined HARD_COLORS
 
@@ -1256,7 +1258,7 @@
  */
 void set_colours( zword_t foreground, zword_t background )
 {
-   int fg, bg;
+   int fg = 0, bg = 0;
    static int bgset = 0;
 
    int fg_colour_map[] = { 30, 31, 32, 33, 34, 35, 36, 37 };
Index: jzip-210r20001005/fileio.c
===================================================================
--- jzip-210r20001005.orig/fileio.c	2000-10-05 17:08:10.000000000 +0300
+++ jzip-210r20001005/fileio.c	2006-07-14 00:28:27.000000000 +0300
@@ -51,9 +51,9 @@
 #ifndef USE_ZLIB
 static char gfpbuffer[BUFSIZ];  
 #endif
-#endif 
 static char sfpbuffer[BUFSIZ];  
 static char rfpbuffer[BUFSIZ];  
+#endif
 
 char save_name[Z_FILENAME_MAX + Z_PATHNAME_MAX + 1] = "story.sav";
 char script_name[Z_FILENAME_MAX + Z_PATHNAME_MAX + 1] = "story.scr";
@@ -186,6 +186,8 @@
    char *path, *p;
    char tmp[Z_FILENAME_MAX + Z_PATHNAME_MAX + 1];
 
+   path = p = 0;
+
    if ( !STANDALONE_FLAG )
    {
       story_offset = 0;
Index: jzip-210r20001005/input.c
===================================================================
--- jzip-210r20001005.orig/input.c	2000-10-05 17:08:10.000000000 +0300
+++ jzip-210r20001005/input.c	2006-07-14 00:30:14.000000000 +0300
@@ -300,7 +300,7 @@
    int slen;
    char *str_end;
    char *cbuf, *tbuf, *tp;
-   const char *cp, *token;
+   const char *cp, *token=NULL;
    char punctuation[16];
    zword_t word;
 
@@ -357,7 +357,7 @@
       /* Skip to next token */
 
       cp = next_token( cp, str_end, &token, &token_length, punctuation );
-      if ( token_length )
+      if ( token_length ) {
 
          /* If still space in token buffer then store word */
 
@@ -391,6 +391,7 @@
             output_string( "Too many words typed, discarding: " );
             output_line( token );
          }
+      }
    }
    while ( token_length );
 
Index: jzip-210r20001005/osdepend.c
===================================================================
--- jzip-210r20001005.orig/osdepend.c	2006-07-14 00:28:27.000000000 +0300
+++ jzip-210r20001005/osdepend.c	2006-07-14 00:28:27.000000000 +0300
@@ -32,6 +32,10 @@
  *
  */
 
+#ifdef HAVE_GETOPT
+#include <getopt.h>
+#endif
+
 #include "ztypes.h"
 #include "jzexe.h"
 
@@ -85,9 +89,10 @@
 #if !defined(AMIGA)
 
 /* getopt linkages */
-
+#if !defined(POSIX)
 extern int optind;
 extern const char *optarg;
+#endif /* !defined(POSIX) */
 extern ZINT16 default_fg, default_bg;
 
 #endif /* !defined(AMIGA) */
Index: jzip-210r20001005/memory.c
===================================================================
--- jzip-210r20001005.orig/memory.c	2000-10-05 17:08:10.000000000 +0300
+++ jzip-210r20001005/memory.c	2006-07-14 00:28:27.000000000 +0300
@@ -263,7 +263,7 @@
 zbyte_t read_data_byte( unsigned long *addr )
 {
    unsigned int page_number, page_offset;
-   zbyte_t value;
+   zbyte_t value=0;
 
    /* Check if byte is in non-paged cache */
 
Index: jzip-210r20001005/jzexe.c
===================================================================
--- jzip-210r20001005.orig/jzexe.c	2000-10-05 17:08:10.000000000 +0300
+++ jzip-210r20001005/jzexe.c	2006-07-14 00:29:04.000000000 +0300
@@ -142,6 +142,7 @@
    }
    fprintf( stderr, "Couldn't find magic string." );
    abort_program( 1 );
+   return 0; /* should not return */
 }
 
 /*
@@ -266,10 +267,9 @@
 void create_executable( char *story, char *jzip )
 {
    FILE *in, *out;
-   long p, length, pos;
+   long length, pos;
    char fn[NAME_LENGTH + 4];
    char *ext;
-   int ok;
 
    strcpy( in_name, "" );
    strcpy( out_name, "" );
@@ -366,7 +366,7 @@
 a story file that can be played with JZip or any other interpreter.\n\
 Note that the extension '.exe' of the game file must be given.\n"
 
-void main( int argc, char **argv )
+int main( int argc, char **argv )
 {
    buf = ( unsigned char * ) malloc( BUFSIZE * sizeof ( unsigned char ) );
 
Index: jzip-210r20001005/property.c
===================================================================
--- jzip-210r20001005.orig/property.c	2000-10-05 17:08:10.000000000 +0300
+++ jzip-210r20001005/property.c	2006-07-14 00:28:27.000000000 +0300
@@ -138,7 +138,7 @@
    {
       prop_addr++;
       /* Only load first property if it is a byte sized property */
-      if ( h_type <= V3 && !( value & 0xe0 ) || h_type >= V4 && !( value & 0xc0 ) )
+      if ( ( h_type <= V3 && !( value & 0xe0 )) || (h_type >= V4 && !( value & 0xc0 )) )
       {
          bprop_val = get_byte( prop_addr );
          wprop_val = bprop_val;
@@ -205,7 +205,7 @@
 
    prop_addr++;
 
-   if ( h_type <= V3 && !( value & 0xe0 ) || h_type >= V4 && !( value & 0xc0 ) )
+   if ( (h_type <= V3 && !( value & 0xe0 )) || (h_type >= V4 && !( value & 0xc0 )) )
    {
       set_byte( prop_addr, ( zbyte_t ) setvalue );
    }
Index: jzip-210r20001005/ckifzs.c
===================================================================
--- jzip-210r20001005.orig/ckifzs.c	2000-10-05 17:08:10.000000000 +0300
+++ jzip-210r20001005/ckifzs.c	2006-07-14 00:28:27.000000000 +0300
@@ -231,7 +231,9 @@
       }
       else if ( !strncmp( id, "CMem", 4 ) )
       {
+#if defined SHORT_DUMP || defined LONG_DUMP
          unsigned long ul1, ul2; 
+#endif
 
          printf( " (compressed memory)" ); 
 #if defined SHORT_DUMP          
@@ -459,7 +461,7 @@
                      }          
                      cklen -= 4;
                      filelen -= 4; 
-                     printf( "  %d bytes of data", cklen ); 
+                     printf( "  %ld bytes of data", cklen ); 
                   }             
                }                
             }                   
@@ -472,7 +474,6 @@
          if ( cklen >= 1 )      
          {                      
             unsigned long l;    
-            unsigned char uch1; 
 
             fputs( "    ", stdout ); 
             for ( l = 0; l < cklen; ++l ) 
@@ -490,7 +491,6 @@
          if ( cklen >= 1 )      
          {                      
             unsigned long l;    
-            unsigned char uch1; 
 
             fputs( "    ", stdout ); 
             for ( l = 0; l < cklen; ++l ) 
@@ -508,7 +508,6 @@
          if ( cklen >= 1 )      
          {                      
             unsigned long l;    
-            unsigned char uch1; 
 
             fputs( "    ", stdout ); 
             for ( l = 0; l < cklen; ++l ) 
@@ -526,7 +525,6 @@
          if ( cklen >= 1 )      
          {                      
             unsigned long l;    
-            unsigned char uch1; 
 
             fputs( "    ", stdout ); 
             for ( l = 0; l < cklen; ++l ) 
@@ -540,11 +538,11 @@
       }
       else if ( !strncmp( id, "    ", 4 ) )
       {
-         printf( " (%d-byte filler)\n", cklen ); 
+         printf( " (%ld-byte filler)\n", cklen ); 
       }
       else
       {
-         printf( "\n*** Unknown %d-byte chunk type found.\n", cklen ); 
+         printf( "\n*** Unknown %ld-byte chunk type found.\n", cklen ); 
          ++errors;
       }
       filelen -= 8;