From 5edfa9038a27125524cb35ef335299f14b1ee850 Mon Sep 17 00:00:00 2001 From: Timo Korvola Date: Fri, 2 Mar 2018 21:34:37 +0200 Subject: [PATCH] Add declarations. Add enough function prototypes to get rid of warnings. Fix errors caused by calls actually not matching definitions. --- src/common/frotz.h | 9 +++++++++ src/common/sound.c | 5 +---- src/dumb/dumb_blorb.c | 4 ++-- src/dumb/dumb_blorb.h | 2 +- src/dumb/dumb_input.c | 2 ++ src/sdl/sf_frotz.h | 28 ++++++++++++++++++++++++---- src/sdl/sf_video.c | 2 +- 7 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/common/frotz.h b/src/common/frotz.h index b465d79..b2f8e6b 100644 --- a/src/common/frotz.h +++ b/src/common/frotz.h @@ -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); diff --git a/src/common/sound.c b/src/common/sound.c index e5e29e7..2998734 100644 --- a/src/common/sound.c +++ b/src/common/sound.c @@ -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; diff --git a/src/dumb/dumb_blorb.c b/src/dumb/dumb_blorb.c index 6f058cf..329ebbb 100644 --- a/src/dumb/dumb_blorb.c +++ b/src/dumb/dumb_blorb.c @@ -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)); diff --git a/src/dumb/dumb_blorb.h b/src/dumb/dumb_blorb.h index 0c52c55..cf9e074 100644 --- a/src/dumb/dumb_blorb.h +++ b/src/dumb/dumb_blorb.h @@ -21,7 +21,7 @@ typedef struct sampledata_struct { */ typedef struct { bb_result_t bbres; - ulong type; + unsigned long type; FILE *fp; } myresource; diff --git a/src/dumb/dumb_input.c b/src/dumb/dumb_input.c index fb78cda..10e36cd 100644 --- a/src/dumb/dumb_input.c +++ b/src/dumb/dumb_input.c @@ -21,6 +21,8 @@ #include "dumb_frotz.h" +#include + f_setup_t f_setup; static char runtime_usage[] = diff --git a/src/sdl/sf_frotz.h b/src/sdl/sf_frotz.h index ee88a2d..e7ccac9 100644 --- a/src/sdl/sf_frotz.h +++ b/src/sdl/sf_frotz.h @@ -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 diff --git a/src/sdl/sf_video.c b/src/sdl/sf_video.c index a21ef10..4ff8229 100644 --- a/src/sdl/sf_video.c +++ b/src/sdl/sf_video.c @@ -850,7 +850,7 @@ zchar os_read_line(int max, zchar *buf, int timeout, int width, int continued) { if (pos == (int)mywcslen(buf)) { - zword extension[10], *s; + zchar extension[10], *s; completion(buf,extension); // Add the completion to the input stream -- 2.34.1