bb_resdesc_t *resources;
bb_resdesc_t **ressorted;
- if (len != numres*12+4)
+ if (len != (unsigned int) numres*12+4)
return bb_err_Format; /* bad length field */
resources = (bb_resdesc_t *)malloc(numres * sizeof(bb_resdesc_t));
if (len) {
bb_aux_pict_t *aux = (bb_aux_pict_t *)malloc(len * sizeof(bb_aux_pict_t));
- for (jx=0; jx<len; jx++, ptr += 7) {
+ for (jx=0; (unsigned int) jx<len; jx++, ptr += 7) {
bb_result_t res;
err = bb_load_resource(map, bb_method_DontLoad, &res,
if (len) {
bb_aux_sound_t *aux = (bb_aux_sound_t *)malloc(len * sizeof(bb_aux_sound_t));
- for (jx=0; jx<len; jx++, ptr += 2) {
+ for (jx=0; (unsigned int) jx<len; jx++, ptr += 2) {
bb_result_t res;
err = bb_load_resource(map, bb_method_DontLoad, &res,
} else {
- long pc;
- zword release;
- zword addr;
- int i;
+// long pc;
+// zword release;
+// zword addr;
+// int i;
/* Get the file name */
} else {
- long pc;
- zword addr;
- zword nsp, nfp;
- int skip;
- int i;
+// long pc;
+// zword addr;
+// zword nsp, nfp;
+// int skip;
+// int i;
/* Get the file name */
int default_driver;
ao_device *device;
ao_sample_format format;
+ int samplecount;
int i;
+ arg = arg; /* Keep -Wall quiet */
+
ao_initialize();
default_driver = ao_default_driver_id();
for (i = 0; i < BUFFSIZE; i++) {
bleepbuffer[i] += musicbuffer[i];
}
- floattopcm16(shortbuffer, bleepbuffer, MAX(musicsamples, bleepsamples));
- ao_play(device, (char *) shortbuffer, MAX(musicsamples, bleepsamples) * sizeof(short));
+ samplecount = musicsamples > bleepsamples ? musicsamples : bleepsamples;
+ floattopcm16(shortbuffer, bleepbuffer, samplecount);
+ ao_play(device, (char *) shortbuffer, samplecount * sizeof(short));
}
if (!bleep_playing && !music_playing) {
*/
void *playaiff(EFFECT *raw_effect)
{
- long filestart;
+// long filestart;
int volcount;
int volfactor;
sf_info.format = 0;
bleepnum = myeffect.number;
- filestart = ftell(myeffect.fp);
+// filestart = ftell(myeffect.fp);
lseek(fileno(myeffect.fp), myeffect.result.data.startpos, SEEK_SET);
sndfile = sf_open_fd(fileno(myeffect.fp), SFM_READ, &sf_info, 0);
int current_section;
short *shortbuffer;
- long filestart;
+// long filestart;
int volcount;
int volfactor;
EFFECT myeffect = *raw_effect;
- filestart = ftell(myeffect.fp);
+// filestart = ftell(myeffect.fp);
fseek(myeffect.fp, myeffect.result.data.startpos, SEEK_SET);
if (ov_open_callbacks(myeffect.fp, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) < 0) {
bb_result_t blorb_res;
bb_map_t *blorb_map;
-/* uint32 *findchunk(uint32 *data, char *chunkID, int length); */
-static char *findchunk(char *pstart, char *fourcc, int n);
-static unsigned short ReadShort(const unsigned char *bytes);
-static unsigned long ReadLong(const unsigned char *bytes);
-static double ReadExtended(const unsigned char *bytes);
+// uint32 *findchunk(uint32 *data, char *chunkID, int length);
+// static char *findchunk(char *pstart, char *fourcc, int n);
+// static unsigned short ReadShort(const unsigned char *bytes);
+// static unsigned long ReadLong(const unsigned char *bytes);
+// static double ReadExtended(const unsigned char *bytes);
static int isblorb(FILE *);
#define UnsignedToFloat(u) (((double)((long)(u - 2147483647L - 1))) + 2147483648.0)
return 1;
}
-
+#ifdef CRAP
static char *findchunk(char *data, char *string, int length)
{
char *mydata = data+12;
return NULL;
}
-
static unsigned short ReadShort(const unsigned char *bytes)
{
return (unsigned short)(
((unsigned short)(bytes[1] & 0xFF)));
}
-
static unsigned long ReadLong(const unsigned char *bytes)
{
return (unsigned long)(
((unsigned long)(bytes[3] & 0xFF)));
}
-
static double ReadExtended(const unsigned char *bytes)
{
double f;
return -f;
return f;
}
+#endif
extern f_setup_t f_setup;
extern u_setup_t u_setup;
-
/*** Blorb related stuff ***/
extern bb_err_t blorb_err;
extern bb_map_t *blorb_map;
static int getbool(char *);
static int getcolor(char *);
static int geterrmode(char *);
-static void redraw(void);
-static FILE *pathopen(const char *, const char *, const char *, char *);
+/* static void redraw(void); */
+/* static FILE *pathopen(const char *, const char *, const char *, char *); */
/*
*/
void os_restart_game (int stage)
{
+ stage = stage; /* Keep -Wall quiet */
}
}
+#ifdef CRAP
/*
* pathopen
*
}
return NULL;
} /* FILE *pathopen() */
+#endif
/*
{
FILE *fp;
- int num, num2;
+ size_t num, num2;
char varname[LINELEN + 1];
char value[LINELEN + 1];
explaination for this. Because of this trouble, this function currently
does nothing.
*/
+ sig = sig; /* Keep -Wall quiet */
}
void sigint_handler(int dummy)
{
signal(SIGINT, sigint_handler);
+ dummy = dummy;
os_stop_sample(0);
scrollok(stdscr, TRUE); scroll(stdscr);
exit(1);
}
-
+/*
void redraw(void)
{
- /* not implemented */
}
-
+*/
void os_init_setup(void)
{
history_view = prev;
return 0;
}
- } while (strlen( *history_view) > maxlen
+ } while (strlen( *history_view) > (size_t) maxlen
|| (searchlen != 0 && strncmp( (char *)str, *history_view, searchlen)));
strcpy((char *)str + searchlen, *history_view + searchlen);
return 1;
history_view = prev;
return 0;
}
- } while (strlen( *history_view) > maxlen
+ } while (strlen( *history_view) > (size_t) maxlen
|| (searchlen != 0 && strncmp( (char *)str, *history_view, searchlen)));
strcpy((char *)str + searchlen, *history_view + searchlen);
return 1;
int os_read_file_name (char *file_name, const char *default_name, int flag)
{
-
int saved_replay = istream_replay;
int saved_record = ostream_record;
+ flag = flag; /*Keep -Wall quiet */
+
/* Turn off playback and recording temporarily */
istream_replay = 0;
basename = strrchr(f_setup.story_name, '/');
if (basename) basename++; else basename = f_setup.story_name;
dotpos = strrchr(basename, '.');
- namelen = (dotpos ? dotpos - basename : strlen(basename));
+ namelen = (dotpos ? dotpos - basename : (int) strlen(basename));
sprintf(filename, "%.*sgraphics/%.*s.mg1",
(int)(basename - f_setup.story_name), f_setup.story_name, namelen, basename);
{
int y, x, i, j;
+ win = win; /* Keep -Wall quiet */
+
/* Catch the most common situation and do things the easy way */
if ((top == 1) && (bottom == h_screen_rows) &&
(left == 1) && (right == h_screen_cols)) {
*/
void os_set_font (int new_font)
{
-
/* Not implemented */
+ new_font = new_font; /* Keep -Wall quiet */
}/* os_set_font */