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;
