sanitize whitespace.

master
Ozkan Sezer 5 years ago
parent 8752414fa8
commit 06e39db305
  1. 4
      configure.ac
  2. 2
      src/commands.c
  3. 5
      src/info.c
  4. 7
      src/main.c
  5. 7
      src/options.c
  6. 10
      src/sound.h
  7. 4
      src/sound_aiff.c
  8. 10
      src/sound_alsa.c
  9. 22
      src/sound_beos.cpp
  10. 9
      src/sound_coreaudio.c
  11. 2
      src/sound_null.c
  12. 3
      src/sound_oss.c
  13. 1
      src/sound_pulseaudio.c
  14. 1
      src/sound_sndio.c
  15. 10
      src/sound_win32.c

@ -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])

@ -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;

@ -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");
}

@ -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; }

@ -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)

@ -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)++) { \

@ -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 <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>

@ -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
};

@ -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)
{
}

@ -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)

@ -44,5 +44,5 @@ struct sound_driver sound_null = {
play,
flush,
onpause,
onresume
onresume
};

@ -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
};

@ -82,7 +82,6 @@ static void onresume(void)
{
}
struct sound_driver sound_pulseaudio = {
"pulseaudio",
"PulseAudio sound output",

@ -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__);

@ -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;
}

Loading…
Cancel
Save