From 06e39db305c7f9dd00b00a2f0a99a0f584978e37 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Sun, 25 Jul 2021 20:55:10 +0300 Subject: [PATCH] sanitize whitespace. --- configure.ac | 4 ++-- src/commands.c | 2 +- src/info.c | 5 +---- src/main.c | 7 +++---- src/options.c | 7 ++++--- src/sound.h | 10 +++++----- src/sound_aiff.c | 4 ++-- src/sound_alsa.c | 10 +++++----- src/sound_beos.cpp | 22 ++++------------------ src/sound_coreaudio.c | 9 ++++----- src/sound_null.c | 2 +- src/sound_oss.c | 3 +-- src/sound_pulseaudio.c | 1 - src/sound_sndio.c | 1 - src/sound_win32.c | 10 +++++----- 15 files changed, 38 insertions(+), 59 deletions(-) diff --git a/configure.ac b/configure.ac index 64db985..8eac470 100644 --- a/configure.ac +++ b/configure.ac @@ -257,13 +257,13 @@ XMP_TRY_COMPILE(whether compiler understands -Wall, ac_cv_c_flag_w_all, -Wall,[ int main(){}], - CFLAGS="${CFLAGS} -Wall") + CFLAGS="${CFLAGS} -Wall") XMP_TRY_COMPILE(whether compiler understands -Wunused-result, ac_cv_c_flag_w_unused_result, -Wunused-result,[ int main(){}], - CFLAGS="${CFLAGS} -Wno-unused-result") + CFLAGS="${CFLAGS} -Wno-unused-result") AC_CHECK_FUNCS(kill getopt_long usleep select) AC_CONFIG_FILES([Makefile src/Makefile]) diff --git a/src/commands.c b/src/commands.c index 00359cc..613a2e0 100644 --- a/src/commands.c +++ b/src/commands.c @@ -130,7 +130,7 @@ void read_command(xmp_context handle, struct xmp_module_info *mi, struct control { int cmd; - cmd = read_key(); + cmd = read_key(); if (cmd <= 0) return; diff --git a/src/info.c b/src/info.c index 41560bc..2b67027 100644 --- a/src/info.c +++ b/src/info.c @@ -193,7 +193,7 @@ void info_frame(struct xmp_module_info *mi, struct xmp_frame_info *fi, struct co } if (reprint || fi->pos != ord || fi->bpm != bpm || fi->speed != spd) { - report("\rSpeed[%02X] BPM[%02X] Pos[%02X/%02X] " + report("\rSpeed[%02X] BPM[%02X] Pos[%02X/%02X] " "Pat[%02X/%02X] Row[ / ] Chn[ / ] 0:00:00.0", fi->speed, fi->bpm, fi->pos, mi->mod->len - 1, @@ -271,7 +271,6 @@ void info_ins_smp(struct xmp_module_info *mi) if (j == 0) { report("[ ] ----- ----- ----- --- ---- --- ---\n"); } - } } @@ -321,7 +320,6 @@ void info_instruments(struct xmp_module_info *mi) if (j == 0) { report("[ ] -- -- ---- --- --- --\n"); } - } } @@ -369,4 +367,3 @@ void info_comment(struct xmp_module_info *mi) } report("\n\n"); } - diff --git a/src/main.c b/src/main.c index b90d562..151c5ac 100644 --- a/src/main.c +++ b/src/main.c @@ -407,7 +407,7 @@ int main(int argc, char **argv) load_error(argv[0], argv[optind], val); if (skipprev) { - optind -= 2; + optind -= 2; if (optind < (first - 1)) { optind += 2; skipprev = 0; @@ -512,7 +512,7 @@ int main(int argc, char **argv) info_comment(&mi); } } - + /* Play sequence */ refresh_status = 1; @@ -562,11 +562,10 @@ int main(int argc, char **argv) refresh_status = 1; } - switch (control.cur_info) { case 'X': { char buf[80]; - get_mixer_type(control.mixer_type, &opt, buf, 80); + get_mixer_type(control.mixer_type, &opt, buf, 80); info_message("Mixer type: %s", buf); control.cur_info = 0; break; } diff --git a/src/options.c b/src/options.c index a9362d2..9439418 100644 --- a/src/options.c +++ b/src/options.c @@ -222,7 +222,6 @@ void get_options(int argc, char **argv, struct options *options) } options->player_mode = -1; } - break; case 'F': options->dsp &= ~XMP_DSP_LOWPASS; @@ -293,9 +292,11 @@ void get_options(int argc, char **argv, struct options *options) options->driver_id = "file"; } break; - /* case OPT_FX9BUG: + /* + case OPT_FX9BUG: options->fx9bug = 1; - break; */ + break; + */ case 'P': options->mix = strtoul(optarg, NULL, 0); if (options->mix < 0) diff --git a/src/sound.h b/src/sound.h index 4a03c87..bae3cd6 100644 --- a/src/sound.h +++ b/src/sound.h @@ -11,12 +11,12 @@ struct sound_driver { char *description; const char *const *help; int (*init)(struct options *); - void (*deinit)(void); + void (*deinit)(void); void (*play)(void *, int); - void (*flush)(void); - void (*pause)(void); - void (*resume)(void); - struct list_head list; + void (*flush)(void); + void (*pause)(void); + void (*resume)(void); + struct list_head list; }; #define parm_init(p) { char *token; for (; *(p); (p)++) { \ diff --git a/src/sound_aiff.c b/src/sound_aiff.c index fe96ef4..35ee1d4 100644 --- a/src/sound_aiff.c +++ b/src/sound_aiff.c @@ -4,8 +4,8 @@ * This file is part of the Extended Module Player and is distributed * under the terms of the GNU General Public License. See the COPYING * file for more information. - */ - + */ + #include #include #include diff --git a/src/sound_alsa.c b/src/sound_alsa.c index 4defb06..78e64aa 100644 --- a/src/sound_alsa.c +++ b/src/sound_alsa.c @@ -49,7 +49,7 @@ static int init(struct options *options) snd_pcm_hw_params_alloca(&hwparams); snd_pcm_hw_params_any(pcm_handle, hwparams); snd_pcm_hw_params_set_access(pcm_handle, hwparams, - SND_PCM_ACCESS_RW_INTERLEAVED); + SND_PCM_ACCESS_RW_INTERLEAVED); snd_pcm_hw_params_set_format(pcm_handle, hwparams, fmt); snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &rate, 0); snd_pcm_hw_params_set_channels_near(pcm_handle, hwparams, &channels); @@ -59,7 +59,7 @@ static int init(struct options *options) if ((ret = snd_pcm_hw_params(pcm_handle, hwparams)) < 0) { fprintf(stderr, "Unable to set ALSA output parameters: %s\n", - snd_strerror(ret)); + snd_strerror(ret)); return -1; } @@ -68,7 +68,7 @@ static int init(struct options *options) snd_strerror(ret)); return -1; } - + if (channels == 1) { format |= XMP_FORMAT_MONO; } else { @@ -77,7 +77,7 @@ static int init(struct options *options) options->rate = rate; options->format = format; - + return 0; } @@ -125,5 +125,5 @@ struct sound_driver sound_alsa = { play, flush, onpause, - onresume + onresume }; diff --git a/src/sound_beos.cpp b/src/sound_beos.cpp index bf94ce5..f81f8cc 100644 --- a/src/sound_beos.cpp +++ b/src/sound_beos.cpp @@ -22,12 +22,6 @@ extern "C" { static media_raw_audio_format fmt; static BSoundPlayer *player; - -/* - * CoreAudio helpers from mplayer/libao - * The player fills a ring buffer, BSP retrieves data from the buffer - */ - static int paused; static uint8 *buffer; static int buffer_len; @@ -127,23 +121,17 @@ static int read_buffer(unsigned char *data, int len) return len; } -/* - * end of CoreAudio helpers - */ - - void render_proc(void *theCookie, void *buffer, size_t req, const media_raw_audio_format &format) -{ - size_t amt; +{ + size_t amt; while ((amt = buf_used()) < req) snooze(100000); - read_buffer((unsigned char *)buffer, req); + read_buffer((unsigned char *)buffer, req); } - static int init(struct options *options) { char **parm = options->driver_parm; @@ -170,13 +158,12 @@ static int init(struct options *options) buf_read_pos = 0; buf_write_pos = 0; paused = 1; - + player = new BSoundPlayer(&fmt, "xmp output", render_proc); return 0; } - static void play(void *b, int i) { int j = 0; @@ -219,4 +206,3 @@ static void onpause(void) static void onresume(void) { } - diff --git a/src/sound_coreaudio.c b/src/sound_coreaudio.c index 9e11088..3ef640f 100644 --- a/src/sound_coreaudio.c +++ b/src/sound_coreaudio.c @@ -117,14 +117,13 @@ OSStatus render_proc(void *inRefCon, read_buffer((unsigned char *)ioData->mBuffers[0].mData, amt); ioData->mBuffers[0].mDataByteSize = amt; - return noErr; + return noErr; } /* * end of CoreAudio helpers */ - static int init(struct options *options) { AudioStreamBasicDescription ad; @@ -208,7 +207,7 @@ static int init(struct options *options) kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &rc, sizeof(rc)))) goto err2; - + return 0; err2: @@ -248,7 +247,7 @@ static void play(void *b, int i) static void deinit(void) { - AudioOutputUnitStop(au); + AudioOutputUnitStop(au); AudioUnitUninitialize(au); AudioComponentInstanceDispose(au); free(buffer); @@ -260,7 +259,7 @@ static void flush(void) static void onpause(void) { - AudioOutputUnitStop(au); + AudioOutputUnitStop(au); } static void onresume(void) diff --git a/src/sound_null.c b/src/sound_null.c index baf8d03..5c9cc2d 100644 --- a/src/sound_null.c +++ b/src/sound_null.c @@ -44,5 +44,5 @@ struct sound_driver sound_null = { play, flush, onpause, - onresume + onresume }; diff --git a/src/sound_oss.c b/src/sound_oss.c index 4aff622..d38b7c7 100644 --- a/src/sound_oss.c +++ b/src/sound_oss.c @@ -116,7 +116,7 @@ static int init(struct options *options) fragnum = 16; /* default number of fragments */ i = 1024; /* default size of fragment */ - + parm_init(parm); chkparm2("frag", "%d,%d", &fragnum, &i); chkparm1("dev", dev_audio[0] = token); @@ -210,4 +210,3 @@ struct sound_driver sound_oss = { onpause, onresume }; - diff --git a/src/sound_pulseaudio.c b/src/sound_pulseaudio.c index c325cd8..395a235 100644 --- a/src/sound_pulseaudio.c +++ b/src/sound_pulseaudio.c @@ -82,7 +82,6 @@ static void onresume(void) { } - struct sound_driver sound_pulseaudio = { "pulseaudio", "PulseAudio sound output", diff --git a/src/sound_sndio.c b/src/sound_sndio.c index ea51b55..9de5357 100644 --- a/src/sound_sndio.c +++ b/src/sound_sndio.c @@ -48,7 +48,6 @@ static int init(struct options *options) options->format &= ~XMP_FORMAT_UNSIGNED; } - askpar = par; if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) { fprintf(stderr, "%s: failed to set parameters\n", __func__); diff --git a/src/sound_win32.c b/src/sound_win32.c index 69e8866..f637057 100644 --- a/src/sound_win32.c +++ b/src/sound_win32.c @@ -66,7 +66,7 @@ static void CALLBACK wave_callback(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance DWORD_PTR dwParam1, DWORD_PTR dwParam2) { if (uMsg == WOM_DONE) { - freebuffer++; + freebuffer++; freebuffer %= num_buffers; } } @@ -79,7 +79,7 @@ static int init(struct options *options) int i; num_buffers = 10; - + parm_init(parm); chkparm1("buffers", num_buffers = strtoul(token, NULL, 0)); parm_end(); @@ -130,11 +130,11 @@ static void play(void *b, int len) while ((nextbuffer + 1) % num_buffers == freebuffer) Sleep(10); - header[nextbuffer].dwBufferLength = len; + header[nextbuffer].dwBufferLength = len; waveOutPrepareHeader(hwaveout, &header[nextbuffer], sizeof(WAVEHDR)); - waveOutWrite(hwaveout, &header[nextbuffer], sizeof(WAVEHDR)); + waveOutWrite(hwaveout, &header[nextbuffer], sizeof(WAVEHDR)); - nextbuffer++; + nextbuffer++; nextbuffer %= num_buffers; }