Some -Wall fixes.
authorDavid Griffith <dave@661.org>
Wed, 22 Apr 2015 08:29:25 +0000 (01:29 -0700)
committerDavid Griffith <dave@661.org>
Wed, 22 Apr 2015 08:29:25 +0000 (01:29 -0700)
src/common/screen.c
src/curses/ux_blorb.c
src/curses/ux_blorb.h
src/curses/ux_frotz.h
src/curses/ux_init.c
src/curses/ux_input.c
src/curses/ux_pic.c
src/curses/ux_resource.c

index 0de4de9c6981a5bdeb3857d1a763064df076cec8..328dfbb6c8ba7d03949282d7784bd890da9bb974 100644 (file)
@@ -1754,7 +1754,7 @@ zword get_window_font (zword win)
 {
     zword font = wp[win].font;
 
-    if (font == TEXT_FONT)
+    if (font == TEXT_FONT) {
 
         if (h_version != V6) {
 
@@ -1769,6 +1769,7 @@ zword get_window_font (zword win)
                 font = FIXED_WIDTH_FONT;
 
         }
+    }
 
     return font;
 
index 23d914c940c2c9d3d0575bb38677ec79b3bd7919..21baa9060a44ba8d9a8c5c0b75b6497b29d8281d 100644 (file)
@@ -141,12 +141,12 @@ bb_err_t ux_blorb_init(char *filename)
 }
 
 /*
- * ux_stop_blorb
+ * ux_blorb_stop
  *
  * Basically just close the Blorb file.
  *
  */
-void ux_stop_blorb(void)
+void ux_blorb_stop(void)
 {
     if (blorb_fp != NULL)
        fclose(blorb_fp);
index ffde5aae21d3cdb0ad95ae803f91bd45a44dc637..95a7aa6cc7505ab440bc766c24241f6112c1ef57 100644 (file)
@@ -26,6 +26,5 @@ typedef struct {
 } myresource;
 
 
-
-
-
+bb_err_t ux_blorb_init(char *);
+void ux_blorb_stop(void);
index 632ae6b3f269d165e1d5bc7ce8980a9323385f94..bd155d8f9f427c6e5e3eb767cd0acf6ba7de5231 100644 (file)
 #include "../blorb/blorblow.h"
 #include "ux_setup.h"
 
+#ifndef rindex
+    #define rindex strrchr
+#endif
+
 #define MASTER_CONFIG          "frotz.conf"
 #define USER_CONFIG            ".frotzrc"
 
index 9d82ffd3877ad33277270b6b9074630dff372583..075e36816323030d3535cff02472861a321958c9 100644 (file)
@@ -103,7 +103,7 @@ void os_fatal (const char *s, ...)
        os_display_string((zchar *)"\n");
        new_line();
        os_reset_screen();
-       ux_stop_blorb();
+       ux_blorb_stop();
        exit(1);
     }
 
@@ -146,7 +146,7 @@ void os_fatal (const char *s, ...)
 
 void os_process_arguments (int argc, char *argv[])
 {
-    int c, i;
+    int c;
     char *p = NULL;
     char *home;
     char configfile[FILENAME_MAX + 1];
index c872e0e8ad832f4e826d053cbdfbfa4e4e36f215..441e00ac5725d5cac9bad02b425078416430b31f 100644 (file)
@@ -79,6 +79,7 @@ static void unix_set_global_timeout(int timeout)
           global_timeout.tv_usec -= 1000000;
         }
     }
+    return;
 }
 
 /* This returns the number of milliseconds until the input timeout
@@ -272,6 +273,8 @@ static void unix_add_to_history(zchar *str)
     strcpy( *history_next, (char *)str);
     RING_INC( history_next, history_buffer, history_end);
     history_view = history_next; /* Reset user frame after each line */
+
+    return;
 }
 
 /*
@@ -347,6 +350,8 @@ static void scrnmove(int dest, int src, int n)
       }
     }
     move(y, x);
+
+    return;
 }
 
 /*
@@ -363,6 +368,8 @@ static void scrnset(int start, int c, int n)
     while (n--)
        mvaddch(y, start + n, c);
     move(y, x);
+
+    return;
 }
 
 /*
@@ -642,7 +649,7 @@ int os_read_file_name (char *file_name, const char *default_name, int flag)
 zword os_read_mouse (void)
 {
        /* INCOMPLETE */
-
+    return 0;
 } /* os_read_mouse */
 
 
@@ -675,6 +682,7 @@ void *memmove(void *s, void *t, size_t n)
                p += n; q += n;
                while (n--) *--p = *--q;
        }
+       return;
 }
 
 #endif /* NO_MEMMOVE */
index 451a6204c3b3ecb1edc8a2f5f2d4530c52109dac..0bae85c6fc0452681b294640f8ca31fd90ca8254 100644 (file)
@@ -41,7 +41,6 @@
 #define PIC_HEADER_HEIGHT 4
 
 static void safe_mvaddch(int, int, int);
-static void save_scrnset(int, int, int, int);
 
 static struct {
   int z_num;
@@ -72,7 +71,7 @@ static int round_div(int x, int y)
        int quotient = x / y;
        int dblremain = (x % y) << 1;
 
-       if ((dblremain > y) || (dblremain == y) && (quotient & 1))
+       if ((dblremain > y) || ((dblremain == y) && (quotient & 1)))
                quotient++;
        return quotient;
 }
@@ -97,7 +96,7 @@ bool unix_init_pictures (void)
   dotpos = strrchr(basename, '.');
   namelen = (dotpos ? dotpos - basename : strlen(basename));
   sprintf(filename, "%.*sgraphics/%.*s.mg1",
-          basename - f_setup.story_name, f_setup.story_name, namelen, basename);
+          (int)(basename - f_setup.story_name), f_setup.story_name, namelen, basename);
 
   do {
     int i, entry_size, flags, x_scale, y_scale;
@@ -126,7 +125,6 @@ bool unix_init_pictures (void)
     /* Copy and scale.  */
     for (i = 1; i <= num_pictures; i++) {
       unsigned char *p = raw_info + entry_size * (i - 1);
-      int height, width;
       pict_info[i].z_num = lookupw(p, PIC_HEADER_NUMBER);
       pict_info[i].orig_height = lookupw(p, PIC_HEADER_HEIGHT);
       pict_info[i].orig_width = lookupw(p, PIC_HEADER_WIDTH);
index bbb6a3e93bb4c8c4ecded30086a696ceed3ddf45..10cdcb15b81d8ac80673a02893175757f54555a3 100644 (file)
@@ -54,8 +54,10 @@ int ux_getresource( int num, int ispic, int method, myresource * res)
 int ux_freeresource(myresource *res)
 {
     if (res == NULL)
-       return;
+       return 0;
 
     if (blorb_map != NULL)
        return bb_unload_chunk(blorb_map, res->bbres.chunknum);
+
+    return 0;
 }