Skip to content

Commit

Permalink
whitespace cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
abrasive committed Oct 21, 2013
1 parent 0514806 commit 82518dc
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void audio_ls_outputs(void) {
printf("Available audio outputs:\n");
for (out=outputs; *out; out++)
printf(" %s%s\n", (*out)->name, out==outputs ? " (default)" : "");

for (out=outputs; *out; out++) {
printf("\n");
printf("Options for output %s:\n", (*out)->name);
Expand Down
18 changes: 9 additions & 9 deletions audio_alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static void help(void) {

static int init(int argc, char **argv) {
int hardware_mixer = 0;

optind = 1; // optind=0 is equivalent to optind=1 plus special behaviour
argv--; // so we shift the arguments to satisfy getopt()
argc++;
Expand Down Expand Up @@ -106,20 +106,20 @@ static int init(int argc, char **argv) {
die("Invalid audio option -%c specified", opt);
}
}

if (optind < argc)
die("Invalid audio argument: %s", argv[optind]);

if (!hardware_mixer)
return 0;

if (alsa_mix_dev == NULL)
alsa_mix_dev = alsa_out_dev;
audio_alsa.volume = &volume;

int ret = 0;
long alsa_mix_maxv;

snd_mixer_selem_id_alloca(&alsa_mix_sid);
snd_mixer_selem_id_set_index(alsa_mix_sid, alsa_mix_index);
snd_mixer_selem_id_set_name(alsa_mix_sid, alsa_mix_ctrl);
Expand All @@ -139,7 +139,7 @@ static int init(int argc, char **argv) {
die ("Failed to find mixer element");
snd_mixer_selem_get_playback_volume_range (alsa_mix_elem, &alsa_mix_minv, &alsa_mix_maxv);
alsa_mix_range = alsa_mix_maxv - alsa_mix_minv;

return 0;
}

Expand All @@ -153,13 +153,13 @@ static void deinit(void) {
static void start(int sample_rate) {
if (sample_rate != 44100)
die("Unexpected sample rate!");

int ret, dir = 0;
snd_pcm_uframes_t frames = 64;
ret = snd_pcm_open(&alsa_handle, alsa_out_dev, SND_PCM_STREAM_PLAYBACK, 0);
if (ret < 0)
die("Alsa initialization failed: unable to open pcm device: %s\n", snd_strerror(ret));

snd_pcm_hw_params_alloca(&alsa_params);
snd_pcm_hw_params_any(alsa_handle, alsa_params);
snd_pcm_hw_params_set_access(alsa_handle, alsa_params, SND_PCM_ACCESS_RW_INTERLEAVED);
Expand Down
4 changes: 2 additions & 2 deletions audio_pulse.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static int init(int argc, char **argv) {
char *pa_server = NULL;
char *pa_sink = NULL;
char *pa_appname = config.apname;

optind = 1; // optind=0 is equivalent to optind=1 plus special behaviour
argv--; // so we shift the arguments to satisfy getopt()
argc++;
Expand All @@ -74,7 +74,7 @@ static int init(int argc, char **argv) {
}

if (optind < argc)
die("Invalid audio argument: %s", argv[optind]);
die("Invalid audio argument: %s", argv[optind]);

static const pa_sample_spec ss = {
.format = PA_SAMPLE_S16LE,
Expand Down
6 changes: 3 additions & 3 deletions common.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ int debuglev = 0;

void die(char *format, ...) {
fprintf(stderr, "FATAL: ");

va_list args;
va_start(args, format);

vfprintf(stderr, format, args);
if (config.daemonise)
daemon_fail(format, args); // Send error message to parent

va_end(args);

fprintf(stderr, "\n");
shairport_shutdown(1);
}
Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ do_pkg_config ALSA alsa CONFIG_ALSA
do_pkg_config Avahi\ client avahi-client CONFIG_AVAHI

if [ `uname` = 'OpenBSD' ]; then
echo "OpenBSD machine, use sndio"
echo "OpenBSD machine, use sndio"
export_config CONFIG_SNDIO
LDFLAGS="${LDFLAGS} -lsndio"
LDFLAGS="${LDFLAGS} -lsndio"
fi

check_header getopt.h CONFIG_HAVE_GETOPT_H
Expand Down
2 changes: 1 addition & 1 deletion daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void daemon_ready() {
write(daemon_pipe[1], &ok, 1);
close(daemon_pipe[1]);
daemon_pipe[1] = -1;
}
}

void daemon_fail(const char *format, va_list arg) {
// Are we still initializing ?
Expand Down
2 changes: 1 addition & 1 deletion shairport.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int parse_options(int argc, char **argv) {
setenv("POSIXLY_CORRECT", "", 1);

static struct option long_options[] = {
{"help", no_argument, NULL, 'h'},
{"help", no_argument, NULL, 'h'},
{"daemon", no_argument, NULL, 'd'},
{"pidfile", required_argument, NULL, 'P'},
{"log", required_argument, NULL, 'l'},
Expand Down
Loading

0 comments on commit 82518dc

Please sign in to comment.