diff options
author | Eugene Sandulenko | 2009-02-27 12:59:02 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2009-02-27 12:59:02 +0000 |
commit | d53c75fc8f816a150db1e160b29f25b8ba6df25c (patch) | |
tree | c044a65cc7bb2beb2b3ba278ebd202dfa5335b7d /engines/sci/sfx | |
parent | 4042eb8259cbd06f9516b2460508e230ec46dd8c (diff) | |
download | scummvm-rg350-d53c75fc8f816a150db1e160b29f25b8ba6df25c.tar.gz scummvm-rg350-d53c75fc8f816a150db1e160b29f25b8ba6df25c.tar.bz2 scummvm-rg350-d53c75fc8f816a150db1e160b29f25b8ba6df25c.zip |
Fix code formatting
svn-id: r38930
Diffstat (limited to 'engines/sci/sfx')
-rw-r--r-- | engines/sci/sfx/core.cpp | 3 | ||||
-rw-r--r-- | engines/sci/sfx/device/alsa-midi.cpp | 24 | ||||
-rw-r--r-- | engines/sci/sfx/device/camd-midi.cpp | 18 | ||||
-rw-r--r-- | engines/sci/sfx/device/unixraw-midi.cpp | 18 | ||||
-rw-r--r-- | engines/sci/sfx/iterator.cpp | 3 | ||||
-rw-r--r-- | engines/sci/sfx/mixer.h | 2 | ||||
-rw-r--r-- | engines/sci/sfx/mixer/soft.cpp | 5 | ||||
-rw-r--r-- | engines/sci/sfx/mixer/test.cpp | 9 | ||||
-rw-r--r-- | engines/sci/sfx/player/realtime.cpp | 39 | ||||
-rw-r--r-- | engines/sci/sfx/seq/gm.cpp | 27 | ||||
-rw-r--r-- | engines/sci/sfx/seq/instrument-map.cpp | 51 | ||||
-rw-r--r-- | engines/sci/sfx/seq/instrument-map.h | 18 | ||||
-rw-r--r-- | engines/sci/sfx/seq/map-mt32-to-gm.cpp | 30 | ||||
-rw-r--r-- | engines/sci/sfx/seq/oss-adlib.cpp | 30 | ||||
-rw-r--r-- | engines/sci/sfx/softseq/fluidsynth.cpp | 39 | ||||
-rw-r--r-- | engines/sci/sfx/softseq/opl2.cpp | 3 | ||||
-rw-r--r-- | engines/sci/sfx/test-iterator.cpp | 39 | ||||
-rw-r--r-- | engines/sci/sfx/timetest.cpp | 3 |
18 files changed, 121 insertions, 240 deletions
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp index 77f0a0c17a..40061d3e23 100644 --- a/engines/sci/sfx/core.cpp +++ b/engines/sci/sfx/core.cpp @@ -159,8 +159,7 @@ static int is_playing(sfx_state_t *self, song_t *song) { return 0; } -static void -_sfx_set_song_status(sfx_state_t *self, song_t *song, int status) { +static void _sfx_set_song_status(sfx_state_t *self, song_t *song, int status) { switch (status) { case SOUND_STATUS_STOPPED: diff --git a/engines/sci/sfx/device/alsa-midi.cpp b/engines/sci/sfx/device/alsa-midi.cpp index 2528ed1aa3..cc4037b020 100644 --- a/engines/sci/sfx/device/alsa-midi.cpp +++ b/engines/sci/sfx/device/alsa-midi.cpp @@ -43,8 +43,7 @@ static int subport_nr = 0; static const char *seq_name = "default"; -static void -_set_tempo(void) { +static void _set_tempo(void) { int resolution = 60; int tempo = 1; snd_seq_queue_tempo_t *queue_tempo; @@ -72,8 +71,7 @@ _set_tempo(void) { } -static int -am_subscribe_to_ports(void) { +static int am_subscribe_to_ports(void) { if ((port_out = snd_seq_connect_to(seq, port_out, port_nr, subport_nr)) < 0) { fprintf(stderr, "[SFX] Could not connect to ALSA sequencer port: %s\n", snd_strerror(port_out)); return SFX_ERROR; @@ -82,8 +80,7 @@ am_subscribe_to_ports(void) { } -static int -aminit(midi_writer_t *self) { +static int aminit(midi_writer_t *self) { int err; snd_midi_event_new(4096, &parser); @@ -124,14 +121,12 @@ aminit(midi_writer_t *self) { return SFX_OK; } -static int -amsetopt(midi_writer_t *self, char *name, char *value) { +static int amsetopt(midi_writer_t *self, char *name, char *value) { return SFX_ERROR; } -static int -amwrite(midi_writer_t *self, unsigned char *buf, int len) { +static int amwrite(midi_writer_t *self, unsigned char *buf, int len) { snd_seq_event_t evt; #if 0 @@ -170,13 +165,11 @@ amwrite(midi_writer_t *self, unsigned char *buf, int len) { return SFX_OK; } -static void -amdelay(midi_writer_t *self, int ticks) { +static void amdelay(midi_writer_t *self, int ticks) { delta += ticks; } -static void -amreset_timer(midi_writer_t *self) { +static void amreset_timer(midi_writer_t *self) { snd_seq_drain_output(seq); snd_seq_stop_queue(seq, queue, NULL); @@ -198,8 +191,7 @@ amreset_timer(midi_writer_t *self) { snd_seq_start_queue(seq, queue, NULL); } -static void -amclose(midi_writer_t *self) { +static void amclose(midi_writer_t *self) { snd_midi_event_free(parser); parser = NULL; } diff --git a/engines/sci/sfx/device/camd-midi.cpp b/engines/sci/sfx/device/camd-midi.cpp index d06324aaed..78be387d3c 100644 --- a/engines/sci/sfx/device/camd-midi.cpp +++ b/engines/sci/sfx/device/camd-midi.cpp @@ -61,8 +61,7 @@ static struct MidiNode *midi_node = NULL; return SFX_ERROR; \ } -static int -camd_init(midi_writer_t *self) { +static int camd_init(midi_writer_t *self) { sciprintf("[SFX] Initialising CAMD raw MIDI backend, v%s\n", SCI_CAMD_MIDI_VERSION); CamdBase = IExec->OpenLibrary("camd.library", 36L); @@ -86,15 +85,13 @@ camd_init(midi_writer_t *self) { return SFX_OK; } -static int -camd_set_option(midi_writer_t *self, char *name, char *value) { +static int camd_set_option(midi_writer_t *self, char *name, char *value) { return SFX_ERROR; } #define MAX_MIDI_LEN 3 -static int -camd_write(midi_writer_t *self, unsigned char *buffer, int len) { +static int camd_write(midi_writer_t *self, unsigned char *buffer, int len) { if (len == 0) return SFX_OK; @@ -123,16 +120,13 @@ camd_write(midi_writer_t *self, unsigned char *buffer, int len) { return SFX_OK; } -static void -camd_delay(midi_writer_t *self, int ticks) { +static void camd_delay(midi_writer_t *self, int ticks) { } -static void -camd_reset_timer(midi_writer_t *self) { +static void camd_reset_timer(midi_writer_t *self) { } -static void -camd_close(midi_writer_t *self) { +static void camd_close(midi_writer_t *self) { #ifdef NO_OP return; #endif diff --git a/engines/sci/sfx/device/unixraw-midi.cpp b/engines/sci/sfx/device/unixraw-midi.cpp index 501e154cb1..c6f393423c 100644 --- a/engines/sci/sfx/device/unixraw-midi.cpp +++ b/engines/sci/sfx/device/unixraw-midi.cpp @@ -41,8 +41,7 @@ namespace Sci { static int fd; static const char *devicename = "/dev/midi"; -static int -unixraw_init(midi_writer_t *self) { +static int unixraw_init(midi_writer_t *self) { sciprintf("[SFX] Initialising UNIX raw MIDI backend, v%s\n", SCI_UNIXRAW_MIDI_VERSION); fd = open(devicename, O_WRONLY | O_SYNC); @@ -55,13 +54,11 @@ unixraw_init(midi_writer_t *self) { return SFX_OK; } -static int -unixraw_set_option(midi_writer_t *self, char *name, char *value) { +static int unixraw_set_option(midi_writer_t *self, char *name, char *value) { return SFX_ERROR; } -static int -unixraw_write(midi_writer_t *self, unsigned char *buffer, int len) { +static int unixraw_write(midi_writer_t *self, unsigned char *buffer, int len) { if (write(fd, buffer, len) != len) { sciprintf("[SFX] MIDI write error\n"); return SFX_ERROR; @@ -69,16 +66,13 @@ unixraw_write(midi_writer_t *self, unsigned char *buffer, int len) { return SFX_OK; } -static void -unixraw_delay(midi_writer_t *self, int ticks) { +static void unixraw_delay(midi_writer_t *self, int ticks) { } -static void -unixraw_reset_timer(midi_writer_t *self) { +static void unixraw_reset_timer(midi_writer_t *self) { } -static void -unixraw_close(midi_writer_t *self) { +static void unixraw_close(midi_writer_t *self) { close(fd); } diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp index 8c6f82c62e..d738d1222e 100644 --- a/engines/sci/sfx/iterator.cpp +++ b/engines/sci/sfx/iterator.cpp @@ -1062,8 +1062,7 @@ static int _sci1_process_next_command(sci1_song_iterator_t *self, return retval; } -static song_iterator_t * - _sci1_handle_message(sci1_song_iterator_t *self, +static song_iterator_t *_sci1_handle_message(sci1_song_iterator_t *self, song_iterator_message_t msg) { if (msg.recipient == _SIMSG_BASE) { /* May extend this in the future */ switch (msg.type) { diff --git a/engines/sci/sfx/mixer.h b/engines/sci/sfx/mixer.h index aea58ce2c9..5f24482904 100644 --- a/engines/sci/sfx/mixer.h +++ b/engines/sci/sfx/mixer.h @@ -122,7 +122,7 @@ sfx_pcm_mixer_t *sfx_pcm_find_mixer(char *name); extern sfx_pcm_mixer_t *mixer; /* _THE_ global pcm mixer */ -sfx_pcm_mixer_t* getMixer(); +sfx_pcm_mixer_t *getMixer(); } // End of namespace Sci diff --git a/engines/sci/sfx/mixer/soft.cpp b/engines/sci/sfx/mixer/soft.cpp index 05812e7aaf..53e4d94399 100644 --- a/engines/sci/sfx/mixer/soft.cpp +++ b/engines/sci/sfx/mixer/soft.cpp @@ -352,12 +352,11 @@ static inline void mix_swap_buffers(sfx_pcm_mixer_t *self) { /* Swap buffers */ P->writebuf = tmp; } -static inline int mix_compute_buf_len(sfx_pcm_mixer_t *self, int *skip_frames) +static inline int mix_compute_buf_len(sfx_pcm_mixer_t *self, int *skip_frames) { /* Computes the number of frames we ought to write. It tries to minimise the number, ** in order to reduce latency. */ /* It sets 'skip_frames' to the number of frames to assume lost by latency, effectively ** skipping them. */ -{ int free_frames; int played_frames = 0; /* since the last call */ uint32 msecs; @@ -922,6 +921,6 @@ sfx_pcm_mixer_t sfx_pcm_mixer_soft_linear = { NULL }; -sfx_pcm_mixer_t* getMixer() { return &sfx_pcm_mixer_soft_linear; } +sfx_pcm_mixer_t *getMixer() { return &sfx_pcm_mixer_soft_linear; } } // End of namespace Sci diff --git a/engines/sci/sfx/mixer/test.cpp b/engines/sci/sfx/mixer/test.cpp index 52102ba81b..8d7f31e059 100644 --- a/engines/sci/sfx/mixer/test.cpp +++ b/engines/sci/sfx/mixer/test.cpp @@ -230,15 +230,13 @@ sample_feed_t sample_feeds[FEEDS_NR] = { #endif }; -void -feed_destroy(sfx_pcm_feed_t *self) { +void feed_destroy(sfx_pcm_feed_t *self) { int_struct *s = (int_struct *) self->internal; s->i = 0; /* reset */ } -int -feed_poll(sfx_pcm_feed_t *self, byte *dest, int size) { +int feed_poll(sfx_pcm_feed_t *self, byte *dest, int size) { int_struct *s = (int_struct *) self->internal; int sample_size = self->sample_size; sample_feed_t *data = &(sample_feeds[self->debug_nr]); @@ -292,8 +290,7 @@ extern FILE *con_file; #define DELAY usleep((rand() / (RAND_MAX / 250L))) -int -main(int argc, char **argv) { +int main(int argc, char **argv) { int dev_nr; mix = sfx_pcm_find_mixer(NULL); diff --git a/engines/sci/sfx/player/realtime.cpp b/engines/sci/sfx/player/realtime.cpp index 84b40ced53..03c2b9ed04 100644 --- a/engines/sci/sfx/player/realtime.cpp +++ b/engines/sci/sfx/player/realtime.cpp @@ -55,8 +55,7 @@ static int play_it_done = 0; static int play_writeahead = 0; static int play_moredelay = 0; -static void -play_song(song_iterator_t *it, uint32 *wakeup_time, int writeahead_time) { +static void play_song(song_iterator_t *it, uint32 *wakeup_time, int writeahead_time) { unsigned char buf[8]; int result; @@ -106,13 +105,11 @@ play_song(song_iterator_t *it, uint32 *wakeup_time, int writeahead_time) { } } -static void -rt_tell_synth(int buf_nr, byte *buf) { +static void rt_tell_synth(int buf_nr, byte *buf) { seq->event(buf[0], buf_nr - 1, buf + 1); } -static void -rt_timer_callback(void) { +static void rt_timer_callback(void) { if (play_it && !play_it_done) { if (!play_moredelay) { int delta = delta_time(play_last_time, g_system->getMillis()); @@ -131,8 +128,7 @@ rt_timer_callback(void) { } } -static resource_t * -find_patch(ResourceManager *resmgr, const char *seq_name, int patchfile) { +static resource_t *find_patch(ResourceManager *resmgr, const char *seq_name, int patchfile) { resource_t *res = NULL; if (patchfile != SFX_SEQ_PATCHFILE_NONE) { @@ -148,13 +144,11 @@ find_patch(ResourceManager *resmgr, const char *seq_name, int patchfile) { /* API implementation */ -static int -rt_set_option(char *name, char *value) { +static int rt_set_option(char *name, char *value) { return SFX_ERROR; } -static int -rt_init(ResourceManager *resmgr, int expected_latency) { +static int rt_init(ResourceManager *resmgr, int expected_latency) { resource_t *res = NULL, *res2 = NULL; void *seq_dev = NULL; @@ -194,8 +188,7 @@ rt_init(ResourceManager *resmgr, int expected_latency) { return SFX_OK; } -static int -rt_add_iterator(song_iterator_t *it, uint32 start_time) { +static int rt_add_iterator(song_iterator_t *it, uint32 start_time) { if (seq->reset_timer) /* Restart timer counting if possible */ seq->reset_timer(start_time); @@ -210,14 +203,12 @@ rt_add_iterator(song_iterator_t *it, uint32 start_time) { return SFX_OK; } -static int -rt_fade_out(void) { +static int rt_fade_out(void) { fprintf(stderr, __FILE__": Attempt to fade out- not implemented yet\n"); return SFX_ERROR; } -static int -rt_stop(void) { +static int rt_stop(void) { song_iterator_t *it = play_it; play_it = NULL; @@ -230,8 +221,7 @@ rt_stop(void) { return SFX_OK; } -static int -rt_send_iterator_message(song_iterator_message_t msg) { +static int rt_send_iterator_message(song_iterator_message_t msg) { if (!play_it) return SFX_ERROR; @@ -239,8 +229,7 @@ rt_send_iterator_message(song_iterator_message_t msg) { return SFX_OK; } -static int -rt_pause(void) { +static int rt_pause(void) { play_pause_started = g_system->getMillis(); /* Also, indicate that we haven't modified the time counter ** yet */ @@ -254,14 +243,12 @@ rt_pause(void) { return seq->allstop(); } -static int -rt_resume(void) { +static int rt_resume(void) { play_paused = 0; return SFX_OK; } -static int -rt_exit(void) { +static int rt_exit(void) { int retval = SFX_OK; if (seq->close()) { diff --git a/engines/sci/sfx/seq/gm.cpp b/engines/sci/sfx/seq/gm.cpp index 7daa2b9535..bd4a171ed5 100644 --- a/engines/sci/sfx/seq/gm.cpp +++ b/engines/sci/sfx/seq/gm.cpp @@ -32,8 +32,7 @@ namespace Sci { static midi_writer_t *writer = NULL; -static int -midi_gm_open(int patch_len, byte *data, int patch2_len, byte *data2, void *device) { +static int midi_gm_open(int patch_len, byte *data, int patch2_len, byte *data2, void *device) { sfx_instrument_map_t *instrument_map = sfx_instrument_map_load_sci(data, patch_len); if (!instrument_map) { @@ -52,13 +51,11 @@ midi_gm_open(int patch_len, byte *data, int patch2_len, byte *data2, void *devic return SFX_OK; } -static int -midi_gm_close(void) { +static int midi_gm_close(void) { return SFX_OK; } -static int -midi_gm_event(byte command, int argc, byte *argv) { +static int midi_gm_event(byte command, int argc, byte *argv) { byte data[4]; assert(argc < 4); @@ -70,15 +67,13 @@ midi_gm_event(byte command, int argc, byte *argv) { return SFX_OK; } -static int -midi_gm_delay(int ticks) { +static int midi_gm_delay(int ticks) { writer->delay(writer, ticks); return SFX_OK; } -static int -midi_gm_reset_timer(uint32 ts) { +static int midi_gm_reset_timer(uint32 ts) { writer->reset_timer(writer); return SFX_OK; @@ -86,8 +81,7 @@ midi_gm_reset_timer(uint32 ts) { #define MIDI_MASTER_VOLUME_LEN 8 -static int -midi_gm_volume(uint8 volume) { +static int midi_gm_volume(uint8 volume) { byte data[MIDI_MASTER_VOLUME_LEN] = { 0xf0, 0x7f, @@ -106,8 +100,7 @@ midi_gm_volume(uint8 volume) { return SFX_OK; } -static int -midi_gm_allstop(void) { +static int midi_gm_allstop(void) { byte data[3] = { 0xb0, 0x78, /* all sound off */ 0 @@ -125,8 +118,7 @@ midi_gm_allstop(void) { return SFX_OK; } -static int -midi_gm_reverb(int reverb) { +static int midi_gm_reverb(int reverb) { byte data[3] = { 0xb0, 91, /* set reverb */ reverb @@ -145,8 +137,7 @@ midi_gm_reverb(int reverb) { return SFX_OK; } -static int -midi_gm_set_option(char *x, char *y) { +static int midi_gm_set_option(char *x, char *y) { return SFX_ERROR; } diff --git a/engines/sci/sfx/seq/instrument-map.cpp b/engines/sci/sfx/seq/instrument-map.cpp index 07179fbaeb..35b2f9ff05 100644 --- a/engines/sci/sfx/seq/instrument-map.cpp +++ b/engines/sci/sfx/seq/instrument-map.cpp @@ -31,8 +31,7 @@ namespace Sci { -sfx_instrument_map_t * -sfx_instrument_map_new(int velocity_maps_nr) { +sfx_instrument_map_t *sfx_instrument_map_new(int velocity_maps_nr) { sfx_instrument_map_t *map = (sfx_instrument_map_t *)sci_malloc(sizeof(sfx_instrument_map_t)); int i; @@ -67,8 +66,7 @@ sfx_instrument_map_new(int velocity_maps_nr) { return map; } -void -sfx_instrument_map_free(sfx_instrument_map_t *map) { +void sfx_instrument_map_free(sfx_instrument_map_t *map) { if (!map) return; @@ -103,8 +101,7 @@ sfx_instrument_map_free(sfx_instrument_map_t *map) { #define PATCH_MIN_SIZE PATCH_INIT_DATA -static int -patch001_type0_length(byte *data, size_t length) { +static int patch001_type0_length(byte *data, size_t length) { unsigned int pos = 492 + 246 * data[491]; /* printf("timbres %d (post = %04x)\n",data[491], pos);*/ @@ -125,15 +122,13 @@ patch001_type0_length(byte *data, size_t length) { return 0; } -static int -patch001_type1_length(byte *data, size_t length) { +static int patch001_type1_length(byte *data, size_t length) { if ((length >= 1155) && (((data[1154] << 8) + data[1153] + 1155) == (int)length)) return 1; return 0; } -int -sfx_instrument_map_detect(byte *data, size_t length) { +int sfx_instrument_map_detect(byte *data, size_t length) { /* length test */ if (length < 1155) return SFX_MAP_MT32; @@ -149,8 +144,7 @@ sfx_instrument_map_detect(byte *data, size_t length) { } -sfx_instrument_map_t * -sfx_instrument_map_load_sci(byte *data, size_t size) { +sfx_instrument_map_t *sfx_instrument_map_load_sci(byte *data, size_t size) { sfx_instrument_map_t * map; int i, m; @@ -220,40 +214,34 @@ struct decorated_midi_writer_t : public midi_writer_t { }; -static void -init_decorated(struct _midi_writer *self_) { +static void init_decorated(struct _midi_writer *self_) { decorated_midi_writer_t *self = (decorated_midi_writer_t *) self_; self->writer->init(self->writer); } -static void -set_option_decorated(struct _midi_writer *self_, char *name, char *value) { +static void set_option_decorated(struct _midi_writer *self_, char *name, char *value) { decorated_midi_writer_t *self = (decorated_midi_writer_t *) self_; self->writer->set_option(self->writer, name, value); } -static void -delay_decorated(struct _midi_writer *self_, int ticks) { +static void delay_decorated(struct _midi_writer *self_, int ticks) { decorated_midi_writer_t *self = (decorated_midi_writer_t *) self_; self->writer->delay(self->writer, ticks); } -static void -flush_decorated(struct _midi_writer *self_) { +static void flush_decorated(struct _midi_writer *self_) { decorated_midi_writer_t *self = (decorated_midi_writer_t *) self_; if (self->writer->flush) self->writer->flush(self->writer); } -static void -reset_timer_decorated(struct _midi_writer *self_) { +static void reset_timer_decorated(struct _midi_writer *self_) { decorated_midi_writer_t *self = (decorated_midi_writer_t *) self_; self->writer->reset_timer(self->writer); } -static void -close_decorated(decorated_midi_writer_t *self) { +static void close_decorated(decorated_midi_writer_t *self) { sfx_instrument_map_free(self->map); self->map = NULL; self->writer->close(self->writer); @@ -264,16 +252,14 @@ close_decorated(decorated_midi_writer_t *self) { #define BOUND_127(x) (((x) < 0)? 0 : (((x) > 0x7f)? 0x7f : (x))) -static int -bound_hard_127(int i, const char *descr) { +static int bound_hard_127(int i, const char *descr) { int r = BOUND_127(i); if (r != i) fprintf(stderr, "[instrument-map] Hard-clipping %02x to %02x in %s\n", i, r, descr); return r; } -static int -set_bend_range(midi_writer_t *writer, int channel, int range) { +static int set_bend_range(midi_writer_t *writer, int channel, int range) { byte buf[3] = {0xb0, 0x65, 0x00}; buf[0] |= channel & 0xf; @@ -297,8 +283,7 @@ set_bend_range(midi_writer_t *writer, int channel, int range) { return SFX_OK; } -static int -write_decorated(decorated_midi_writer_t *self, byte *buf, int len) { +static int write_decorated(decorated_midi_writer_t *self, byte *buf, int len) { sfx_instrument_map_t *map = self->map; int op = *buf & 0xf0; int chan = *buf & 0x0f; @@ -423,8 +408,7 @@ write_decorated(decorated_midi_writer_t *self, byte *buf, int len) { #define MIDI_BYTES_PER_SECOND 3250 /* This seems to be the minimum guarantee by the standard */ #define MAX_PER_TICK (MIDI_BYTES_PER_SECOND / 60) /* After this, we ought to issue one tick of pause */ -static void -init(midi_writer_t *writer, byte *data, size_t len) { +static void init(midi_writer_t *writer, byte *data, size_t len) { size_t offset = 0; byte status = 0; @@ -489,8 +473,7 @@ init(midi_writer_t *writer, byte *data, size_t len) { #define NAME_SUFFIX "+instruments" -midi_writer_t * -sfx_mapped_writer(midi_writer_t *writer, sfx_instrument_map_t *map) { +midi_writer_t *sfx_mapped_writer(midi_writer_t *writer, sfx_instrument_map_t *map) { int i; decorated_midi_writer_t *retval; diff --git a/engines/sci/sfx/seq/instrument-map.h b/engines/sci/sfx/seq/instrument-map.h index 95233f9099..c223e68a33 100644 --- a/engines/sci/sfx/seq/instrument-map.h +++ b/engines/sci/sfx/seq/instrument-map.h @@ -75,21 +75,18 @@ struct sfx_instrument_map_t { byte *initialisation_block; /* Initial MIDI commands to set up the device */ }; -sfx_instrument_map_t * -sfx_instrument_map_new(int velocity_maps_nr); +sfx_instrument_map_t *sfx_instrument_map_new(int velocity_maps_nr); /* Constructs a new default-initialised velocity map ** Parameters: (int) velocity_maps_nr: Number of velocity maps to allocate ** Returns : (sfx_instrument_map *) an initialised instrument map */ -void -sfx_instrument_map_free(sfx_instrument_map_t *map); +void sfx_instrument_map_free(sfx_instrument_map_t *map); /* Deallocates an instrument map ** Parameters: (sfx_instrument_map *) map: The map to deallocate, or NULL for a no-op */ -sfx_instrument_map_t * -sfx_instrument_map_load_sci(byte *data, size_t length); +sfx_instrument_map_t *sfx_instrument_map_load_sci(byte *data, size_t length); /* Allocate and initialise an instrument map from SCI data ** Parameters: (byte *) Pointer to the data to initialise from ** (size_t) Number of bytes to expect within @@ -98,8 +95,7 @@ sfx_instrument_map_load_sci(byte *data, size_t length); ** If `data' is null, the function will return NULL quietly. */ -sfx_instrument_map_t * -sfx_instrument_map_mt32_to_gm(byte *data, size_t size); +sfx_instrument_map_t *sfx_instrument_map_mt32_to_gm(byte *data, size_t size); /* Allocate and initialise an instrument map from MT-32 patch data ** Parameters: (byte *) Pointer to the MT-32 patch data to initialise from ** (size_t) Number of bytes to expect within @@ -107,8 +103,7 @@ sfx_instrument_map_mt32_to_gm(byte *data, size_t size); ** If `data' is null or invalid, the function will return a default MT-32 to GM map. */ -int -sfx_instrument_map_detect(byte *data, size_t size); +int sfx_instrument_map_detect(byte *data, size_t size); /* Detects the type of patch data ** Parameters: (byte *) Pointer to the patch data ** (size_t) Number of bytes to expect within @@ -116,8 +111,7 @@ sfx_instrument_map_detect(byte *data, size_t size); ** or SFX_MAP_UNKNOWN for unknown. */ -midi_writer_t * -sfx_mapped_writer(midi_writer_t *writer, sfx_instrument_map_t *map); +midi_writer_t *sfx_mapped_writer(midi_writer_t *writer, sfx_instrument_map_t *map); /* Wrap a midi_writer_t into an instrument map ** Parameters: (midi_writer_t *) writer: The writer to wrap ** (sfx_instrument_map_t *) map: The map to apply to all commands going into the writer, or NULL diff --git a/engines/sci/sfx/seq/map-mt32-to-gm.cpp b/engines/sci/sfx/seq/map-mt32-to-gm.cpp index 777409d694..8c909905e1 100644 --- a/engines/sci/sfx/seq/map-mt32-to-gm.cpp +++ b/engines/sci/sfx/seq/map-mt32-to-gm.cpp @@ -32,8 +32,7 @@ namespace Sci { #define DEBUG_MT32_TO_GM -static const char -*GM_Instrument_Names[] = { +static const char *GM_Instrument_Names[] = { /*000*/ "Acoustic Grand Piano", /*001*/ "Bright Acoustic Piano", /*002*/ "Electric Grand Piano", @@ -165,8 +164,7 @@ static const char }; /* The GM Percussion map is downwards compatible to the MT32 map, which is used in SCI */ -static const char -*GM_Percussion_Names[] = { +static const char *GM_Percussion_Names[] = { /*00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*20*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -398,8 +396,7 @@ static struct { /*29*/ {"OpenHiHat2", SFX_MAPPED_TO_RHYTHM, 43} }; -static int8 -MT32_PresetRhythmKeymap[] = { +static int8 MT32_PresetRhythmKeymap[] = { SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, SFX_UNMAPPED, @@ -560,8 +557,7 @@ static struct { {0, 0, 0} }; -static int8 -lookup_instrument(const char *iname) { +static int8 lookup_instrument(const char *iname) { int i = 0; while (MT32_MemoryTimbreMaps[i].name) { @@ -572,8 +568,7 @@ lookup_instrument(const char *iname) { return SFX_UNMAPPED; } -static int8 -lookup_rhythm_key(const char *iname) { +static int8 lookup_rhythm_key(const char *iname) { int i = 0; while (MT32_MemoryTimbreMaps[i].name) { @@ -584,8 +579,7 @@ lookup_rhythm_key(const char *iname) { return SFX_UNMAPPED; } -static void -print_map(int sci, int ins, int rhythm, int mt32) { +static void print_map(int sci, int ins, int rhythm, int mt32) { #ifdef DEBUG_MT32_TO_GM if (ins == SFX_UNMAPPED || (ins == SFX_MAPPED_TO_RHYTHM && rhythm == SFX_UNMAPPED)) { sciprintf("[MT32-to-GM] No mapping available for [%i] `%s' (%i)\n", @@ -606,8 +600,7 @@ print_map(int sci, int ins, int rhythm, int mt32) { #endif } -static void -print_map_mem(int sci, int ins, int rhythm, char *mt32) { +static void print_map_mem(int sci, int ins, int rhythm, char *mt32) { #ifdef DEBUG_MT32_TO_GM char name[11]; @@ -631,8 +624,7 @@ print_map_mem(int sci, int ins, int rhythm, char *mt32) { #endif } -static void -print_map_rhythm(int sci, int ins, int rhythm, int mt32) { +static void print_map_rhythm(int sci, int ins, int rhythm, int mt32) { #ifdef DEBUG_MT32_TO_GM if (ins == SFX_UNMAPPED || (ins == SFX_MAPPED_TO_RHYTHM && rhythm == SFX_UNMAPPED)) { sciprintf("[MT32-to-GM] No mapping available for [%i] `%s' [R] (%i)\n", @@ -653,8 +645,7 @@ print_map_rhythm(int sci, int ins, int rhythm, int mt32) { #endif } -static void -print_map_rhythm_mem(int sci, int rhythm, char *mt32) { +static void print_map_rhythm_mem(int sci, int rhythm, char *mt32) { #ifdef DEBUG_MT32_TO_GM char name[11]; @@ -672,8 +663,7 @@ print_map_rhythm_mem(int sci, int rhythm, char *mt32) { #endif } -sfx_instrument_map_t * -sfx_instrument_map_mt32_to_gm(byte *data, size_t size) { +sfx_instrument_map_t *sfx_instrument_map_mt32_to_gm(byte *data, size_t size) { int memtimbres, patches; uint8 group, number, keyshift, finetune, bender_range; uint8 *patchpointer; diff --git a/engines/sci/sfx/seq/oss-adlib.cpp b/engines/sci/sfx/seq/oss-adlib.cpp index 2222544781..9285fd5a2c 100644 --- a/engines/sci/sfx/seq/oss-adlib.cpp +++ b/engines/sci/sfx/seq/oss-adlib.cpp @@ -143,8 +143,7 @@ int adlib_kill_one_note(int chn) { return oldest; } -static void -adlib_start_note(int chn, int note, int velocity) { +static void adlib_start_note(int chn, int note, int velocity) { int free; struct timeval now; @@ -174,8 +173,7 @@ adlib_start_note(int chn, int note, int velocity) { SEQ_DUMPBUF(); } -static int -midi_adlib_open(int data_length, byte *data_ptr, int data2_length, +static int midi_adlib_open(int data_length, byte *data_ptr, int data2_length, byte *data2_ptr, void *seq) { int nrdevs, i, n; struct synth_info info; @@ -237,15 +235,13 @@ midi_adlib_open(int data_length, byte *data_ptr, int data2_length, } -static int -midi_adlib_close(void) { +static int midi_adlib_close(void) { SEQ_DUMPBUF(); return close(seqfd); } -static int -midi_adlib_allstop(void) { +static int midi_adlib_allstop(void) { int i; for (i = 0; i < ADLIB_VOICES ; i++) { if (oper_chn[i] == 255) @@ -257,14 +253,12 @@ midi_adlib_allstop(void) { return 0; } -static int -midi_adlib_reverb(int param) { +static int midi_adlib_reverb(int param) { printf("reverb NYI %04x \n", param); return 0; } -static inline int -midi_adlib_event1(uint8 command, uint8 note, uint8 velocity) { +static inline int midi_adlib_event1(uint8 command, uint8 note, uint8 velocity) { uint8 channel, oper; channel = command & 0x0f; @@ -297,8 +291,7 @@ midi_adlib_event1(uint8 command, uint8 note, uint8 velocity) { return 0; } -static inline int -midi_adlib_event2(uint8 command, uint8 param) { +static inline int midi_adlib_event2(uint8 command, uint8 param) { uint8 channel; uint8 oper; @@ -320,22 +313,19 @@ midi_adlib_event2(uint8 command, uint8 param) { return 0; } -static int -midi_adlib_event(byte command, int argc, byte *argv) { +static int midi_adlib_event(byte command, int argc, byte *argv) { if (argc > 1) return midi_adlib_event1(command, argv[0], argv[1]); else return midi_adlib_event2(command, argv[0]); } -static int -midi_adlib_delay(int ticks) { +static int midi_adlib_delay(int ticks) { SEQ_DELTA_TIME(ticks); return SFX_OK; } -static int -midi_adlib_set_option(char *name, char *value) { +static int midi_adlib_set_option(char *name, char *value) { return SFX_ERROR; /* No options are supported at this time */ } diff --git a/engines/sci/sfx/softseq/fluidsynth.cpp b/engines/sci/sfx/softseq/fluidsynth.cpp index ab73c381bd..9450ab55de 100644 --- a/engines/sci/sfx/softseq/fluidsynth.cpp +++ b/engines/sci/sfx/softseq/fluidsynth.cpp @@ -50,18 +50,15 @@ static int rpn[16]; /* MIDI writer */ -static int -fluidsynth_midi_init(struct _midi_writer *self) { +static int fluidsynth_midi_init(struct _midi_writer *self) { return SFX_OK; } -static int -fluidsynth_midi_set_option(struct _midi_writer *self, char *name, char *value) { +static int fluidsynth_midi_set_option(struct _midi_writer *self, char *name, char *value) { return SFX_ERROR; } -static int -fluidsynth_midi_write(struct _midi_writer *self, unsigned char *buf, int len) { +static int fluidsynth_midi_write(struct _midi_writer *self, unsigned char *buf, int len) { if (buf[0] == 0xf0) sciprintf("FluidSynth: Skipping sysex message.\n"); else if (len == 2) { @@ -124,16 +121,13 @@ fluidsynth_midi_write(struct _midi_writer *self, unsigned char *buf, int len) { return SFX_OK; } -static void -fluidsynth_midi_delay(struct _midi_writer *self, int ticks) { +static void fluidsynth_midi_delay(struct _midi_writer *self, int ticks) { } -static void -fluidsynth_midi_reset_timer(struct _midi_writer *self) { +static void fluidsynth_midi_reset_timer(struct _midi_writer *self) { } -static void -fluidsynth_midi_close(struct _midi_writer *self) { +static void fluidsynth_midi_close(struct _midi_writer *self) { } static midi_writer_t midi_writer_fluidsynth = { @@ -149,13 +143,11 @@ static midi_writer_t midi_writer_fluidsynth = { /* Software sequencer */ -static void -fluidsynth_poll(sfx_softseq_t *self, byte *dest, int count) { +static void fluidsynth_poll(sfx_softseq_t *self, byte *dest, int count) { fluid_synth_write_s16(synth, count, dest, 0, 2, dest + 2, 0, 2); } -static int -fluidsynth_init(sfx_softseq_t *self, byte *data_ptr, int data_length, +static int fluidsynth_init(sfx_softseq_t *self, byte *data_ptr, int data_length, byte *data2_ptr, int data2_length) { int sfont_id; double min, max; @@ -198,31 +190,26 @@ fluidsynth_init(sfx_softseq_t *self, byte *data_ptr, int data_length, return SFX_OK; } -static void -fluidsynth_exit(sfx_softseq_t *self) { +static void fluidsynth_exit(sfx_softseq_t *self) { delete_fluid_synth(synth); delete_fluid_settings(settings); } -static void -fluidsynth_allstop(sfx_softseq_t *self) { +static void fluidsynth_allstop(sfx_softseq_t *self) { if (gmseq->allstop) gmseq->allstop(); } -static void -fluidsynth_volume(sfx_softseq_t *self, int volume) { +static void fluidsynth_volume(sfx_softseq_t *self, int volume) { if (gmseq->volume) gmseq->volume(volume); } -static int -fluidsynth_set_option(sfx_softseq_t *self, const char *name, const char *value) { +static int fluidsynth_set_option(sfx_softseq_t *self, const char *name, const char *value) { return SFX_ERROR; } -static void -fluidsynth_event(sfx_softseq_t *self, byte cmd, int argc, byte *argv) { +static void fluidsynth_event(sfx_softseq_t *self, byte cmd, int argc, byte *argv) { gmseq->event(cmd, argc, argv); } diff --git a/engines/sci/sfx/softseq/opl2.cpp b/engines/sci/sfx/softseq/opl2.cpp index fa1fc54a0e..cd6db5f03c 100644 --- a/engines/sci/sfx/softseq/opl2.cpp +++ b/engines/sci/sfx/softseq/opl2.cpp @@ -170,8 +170,7 @@ static inline int opl_write(int a, int v) { } /* -static inline uint8 opl_read (int a) -{ +static inline uint8 opl_read (int a) { OPLWrite (ym3812_L, 0x388, a); return OPLRead (ym3812_L, 0x389); } diff --git a/engines/sci/sfx/test-iterator.cpp b/engines/sci/sfx/test-iterator.cpp index 939d8ff8d6..37c602bf35 100644 --- a/engines/sci/sfx/test-iterator.cpp +++ b/engines/sci/sfx/test-iterator.cpp @@ -37,8 +37,7 @@ using namespace Sci; int errors = 0; -void -error(char *fmt, ...) { +void error(char *fmt, ...) { va_list ap; fprintf(stderr, "[ERROR] "); @@ -61,8 +60,7 @@ struct simple_it_struct { int cues_nr; } simple_iterator; -int -simple_it_next(song_iterator_t *_self, unsigned char *buf, int *result) { +int simple_it_next(song_iterator_t *_self, unsigned char *buf, int *result) { struct simple_it_struct *self = (struct simple_it_struct *) _self; if (self->lifetime_remaining == -1) { @@ -106,23 +104,19 @@ simple_it_next(song_iterator_t *_self, unsigned char *buf, int *result) { } } -sfx_pcm_feed_t * -simple_it_pcm_feed(song_iterator_t *_self) { +sfx_pcm_feed_t *simple_it_pcm_feed(song_iterator_t *_self) { error("No PCM feed!\n"); return NULL; } -void -simple_it_init(song_iterator_t *_self) { +void simple_it_init(song_iterator_t *_self) { } -song_iterator_t * -simple_it_handle_message(song_iterator_t *_self, song_iterator_message_t msg) { +song_iterator_t *simple_it_handle_message(song_iterator_t *_self, song_iterator_message_t msg) { return NULL; } -void -simple_it_cleanup(song_iterator_t *_self) { +void simple_it_cleanup(song_iterator_t *_self) { } /* Initialises the simple iterator. @@ -131,8 +125,7 @@ simple_it_cleanup(song_iterator_t *_self) { ** (int) cues_nr: Number of cues in ``cues'' ** The first cue is emitted after cues[0] ticks, and it is 1. After cues[1] additional ticks ** the next cue is emitted, and so on. */ -song_iterator_t * -setup_simple_iterator(int delay, char *cues, int cues_nr) { +song_iterator_t *setup_simple_iterator(int delay, char *cues, int cues_nr) { simple_iterator.lifetime_remaining = delay; simple_iterator.cues = cues; simple_iterator.cue_counter = 0; @@ -161,8 +154,7 @@ setup_simple_iterator(int delay, char *cues, int cues_nr) { #define ASSERT_RESULT(n) ASSERT(result == n) #define ASSERT_CUE(n) ASSERT_NEXT(SI_ABSOLUTE_CUE); ASSERT_RESULT(n) -void -test_simple_it() { +void test_simple_it() { song_iterator_t *it; song_iterator_t *simple_it = (song_iterator_t *) & simple_iterator; unsigned char data[4]; @@ -193,8 +185,7 @@ test_simple_it() { puts("[TEST] Test OK."); } -void -test_fastforward() { +void test_fastforward() { song_iterator_t *it; song_iterator_t *simple_it = (song_iterator_t *) & simple_iterator; song_iterator_t *ff_it; @@ -297,8 +288,7 @@ static unsigned char simple_song[SIMPLE_SONG_SIZE] = { ASSERT(data[1] == arg0); \ ASSERT(data[2] == arg1); -void -test_iterator_sci0() { +void test_iterator_sci0() { song_iterator_t *it = songit_new(simple_song, SIMPLE_SONG_SIZE, SCI_SONG_ITERATOR_TYPE_SCI0, 0l); unsigned char data[4]; int result; @@ -322,8 +312,7 @@ test_iterator_sci0() { -void -test_iterator_sci0_loop() { +void test_iterator_sci0_loop() { song_iterator_t *it = songit_new(simple_song, SIMPLE_SONG_SIZE, SCI_SONG_ITERATOR_TYPE_SCI0, 0l); unsigned char data[4]; int result; @@ -379,8 +368,7 @@ unsigned char loop_song[LOOP_SONG_SIZE] = { }; -void -test_iterator_sci0_mark_loop() { +void test_iterator_sci0_mark_loop() { song_iterator_t *it = songit_new(loop_song, LOOP_SONG_SIZE, SCI_SONG_ITERATOR_TYPE_SCI0, 0l); unsigned char data[4]; int result; @@ -424,8 +412,7 @@ test_iterator_sci0_mark_loop() { -int -main(int argc, char **argv) { +int main(int argc, char **argv) { test_simple_it(); test_fastforward(); test_iterator_sci0(); diff --git a/engines/sci/sfx/timetest.cpp b/engines/sci/sfx/timetest.cpp index 9b50e247b0..c7f9222213 100644 --- a/engines/sci/sfx/timetest.cpp +++ b/engines/sci/sfx/timetest.cpp @@ -31,8 +31,7 @@ using namespace Sci; sfx_timestamp_t a, b, c; -int -main(int argc, char **argv) { +int main(int argc, char **argv) { int i; a = sfx_new_timestamp(10, 0, 1000); b = sfx_new_timestamp(10, 1000, 1000); |