Add declarations.
authorTimo Korvola <tkorvola@iki.fi>
Fri, 2 Mar 2018 19:34:37 +0000 (21:34 +0200)
committerDavid Griffith <dave@661.org>
Sun, 11 Mar 2018 11:48:50 +0000 (04:48 -0700)
Add enough function prototypes to get rid of warnings.  Fix errors
caused by calls actually not matching definitions.

src/common/frotz.h
src/common/sound.c
src/dumb/dumb_blorb.c
src/dumb/dumb_blorb.h
src/dumb/dumb_input.c
src/sdl/sf_frotz.h
src/sdl/sf_video.c

index b465d79f15b309099d8f7820acec9e7133a56262..b2f8e6b869c3339eaae89c8fd6ecd50be8e5c3df 100644 (file)
@@ -750,6 +750,15 @@ void       branch (bool);
 void   storeb (zword, zbyte);
 void   storew (zword, zword);
 
+void end_of_sound (zword routine);
+
+int completion (const zchar *buffer, zchar *result);
+
+bool is_terminator (zchar);
+void read_string (int max, zchar *buffer);
+bool read_yes_or_no (const char *);
+
+void screen_new_line (void);
 
        /*** returns the current window ***/
 Zwindow * curwinrec( void);
index e5e29e740f516990efbf68033a142713b9e0af9f..2998734bda90c412da253ceecff29bd0b754de39 100644 (file)
@@ -31,8 +31,6 @@
 
 extern int direct_call (zword);
 
-static zword routine = 0;
-
 static int next_sample = 0;
 static int next_volume = 0;
 
@@ -76,7 +74,6 @@ static void start_sample (int number, int volume, int repeats, zword eos)
 
     os_start_sample (number, volume, repeats, eos);
 
-    routine = eos;
     playing = TRUE;
 
 }/* start_sample */
@@ -109,7 +106,7 @@ static void start_next_sample (void)
  * interrupt (which requires extremely careful programming).
  *
  */
-void end_of_sound (void)
+void end_of_sound (zword routine)
 {
 #if defined(DJGPP) && defined(SOUND_SUPPORT)
     end_of_sound_flag = 0;
index 6f058cf25d46ee1bd8173100a6ef0cc3b68cf8a3..329ebbb0d180c34176b5d425f311185bc9e83684 100644 (file)
@@ -79,7 +79,7 @@ bb_err_t dumb_blorb_init(char *filename)
 
        mystring = malloc(len2 * sizeof(char) + 1);
         strncpy(mystring, filename, len1 * sizeof(char));
-       p = rindex(mystring, '.');
+       p = strrchr(mystring, '.');
        if (p != NULL)
            *p = '\0';
 
@@ -91,7 +91,7 @@ bb_err_t dumb_blorb_init(char *filename)
 
        /* Check if foo.blb is there. */
         if ((blorb_fp = fopen(mystring, "rb")) == NULL) {
-           p = rindex(mystring, '.');
+           p = strrchr(mystring, '.');
            if (p != NULL)
                *p = '\0';
             strncat(mystring, EXT_BLORB3, len2 * sizeof(char));
index 0c52c5580fbce46adb483a6bba501516233d1687..cf9e074cdcf9dfe53c949d553b3d25a3a845b9e2 100644 (file)
@@ -21,7 +21,7 @@ typedef struct sampledata_struct {
  */
 typedef struct {
     bb_result_t bbres;
-    ulong type;
+    unsigned long type;
     FILE *fp;
 } myresource;
 
index fb78cda8f45f3768d95e792ca814b1f9a0f00e47..10e36cdbcaf1a19637cd196cce962ecc9cb75c44 100644 (file)
@@ -21,6 +21,8 @@
 
 #include "dumb_frotz.h"
 
+#include <string.h>
+
 f_setup_t f_setup;
 
 static char runtime_usage[] =
index ee88a2ddf8cc9509b96fea1889b2778e169a7dc1..e7ccac91afa585347747d1f653e404db6f6c36b7 100644 (file)
@@ -158,7 +158,7 @@ typedef struct {
   bool foreDefault, backDefault, backTransparent;
   } SF_textsetting;
 
-SF_textsetting * sf_curtextsetting();
+SF_textsetting * sf_curtextsetting(void);
 
 void sf_writeglyph( SF_glyph *g);
 
@@ -177,9 +177,11 @@ int sf_GetColourIndex( ulong colour);
 
 void sf_initvideo( int w, int h, int full);
 
-int sf_initsound();
+int sf_initsound(void);
 
-void sf_cleanup_all();
+void sf_initfonts(void);
+
+void sf_cleanup_all(void);
 void sf_regcleanfunc( void *f, const char *nam);
 #define CLEANREG( f) sf_regcleanfunc( (void *)f, #f)
 
@@ -193,7 +195,7 @@ enum { IDS_BLORB_GLULX, IDS_BLORB_NOEXEC, IDS_MORE, IDS_HIT_KEY_EXIT, IDS_TITLE,
  IDS_RECORD_FILTER, IDS_RECORD_TITLE, IDS_PLAYBACK_TITLE,
  IDS_AUX_FILTER, IDS_SAVE_AUX_TITLE, IDS_LOAD_AUX_TITLE };
 
-bool sf_IsInfocomV6();
+bool sf_IsInfocomV6(void);
 
 ulong sf_blend( int a, ulong s, ulong d);
 
@@ -217,6 +219,24 @@ int sf_user_fdialog( bool exist, const char *def, const char *filt, const char *
 extern int (*sf_osdialog)( bool ex, const char *def, const char *filt, const char *tit, char **res,
        ulong *sbuf, int sbp, int ew, int eh, int isfull);
 
+void sf_checksound(void);
+
+void sf_installhandlers(void);
+
+void sf_pushtextsettings(void);
+void sf_poptextsettings(void);
+
+void sf_chline( int x, int y, ulong c, int n);
+void sf_cvline( int x, int y, ulong c, int n);
+void sf_flushdisplay(void);
+void sf_getclip( int *x, int *y, int *w, int *h);
+void sf_rect( unsigned long color, int x, int y, int w, int h);
+void sf_setclip( int x, int y, int w, int h);
+void sf_wpixel( int x, int y, ulong c);
+
+void sf_InitProfile( const char *fn);
+void sf_FinishProfile(void);
+
 #ifdef WIN32
 #define OS_PATHSEP ';'
 #else
index a21ef10022b917fce3643eda62f4ae8c454b1ac7..4ff8229dea679a2474203d580abebfb326bde898 100644 (file)
@@ -850,7 +850,7 @@ zchar os_read_line(int max, zchar *buf, int timeout, int width, int continued)
                        {\r
                        if (pos == (int)mywcslen(buf))\r
                                {\r
-                               zword extension[10], *s;\r
+                               zchar extension[10], *s;\r
                                completion(buf,extension);\r
 \r
                                        // Add the completion to the input stream\r