Skip to content

Commit 0779f8d

Browse files
authored
fix some -Wzero-as-null-pointer-constant warnings. (#68)
1 parent 3dfc326 commit 0779f8d

File tree

2 files changed

+48
-51
lines changed

2 files changed

+48
-51
lines changed

src/options.c

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -125,49 +125,49 @@ static void usage(char *s, struct options *options)
125125
}
126126

127127
static const struct option lopt[] = {
128-
{ "amiga", 0, 0, 'A' },
129-
{ "amplify", 1, 0, 'a' },
130-
{ "bits", 1, 0, 'b' },
131-
{ "driver", 1, 0, 'd' },
132-
{ "default-pan", 1, 0, 'p' },
133-
{ "fix-sample-loops", 0, 0, OPT_FIXLOOP },
134-
{ "frequency", 1, 0, 'f' },
135-
{ "help", 0, 0, 'h' },
136-
{ "instrument-path", 1, 0, 'I' },
137-
{ "interpolation", 1, 0, 'i' },
138-
{ "list-formats", 0, 0, 'L' },
139-
{ "loop", 0, 0, 'l' },
140-
{ "loop-all", 0, 0, OPT_LOOPALL },
141-
{ "loop-until", 1, 0, 'U' },
142-
{ "mixer-voices", 1, 0, OPT_NUMVOICES },
143-
{ "mono", 0, 0, 'm' },
144-
{ "mute", 1, 0, 'M' },
145-
{ "null", 0, 0, 'N' },
146-
{ "nocmd", 0, 0, OPT_NOCMD },
147-
{ "norc", 0, 0, OPT_NORC },
148-
{ "nofilter", 0, 0, 'F' },
149-
/* { "offset-bug-emulation",0, 0, OPT_FX9BUG }, */
150-
{ "output-file", 1, 0, 'o' },
151-
{ "pan", 1, 0, 'P' },
152-
{ "player-mode", 1, 0, 'e' },
153-
{ "probe-only", 0, 0, OPT_PROBEONLY },
154-
{ "load-only", 0, 0, OPT_LOADONLY },
155-
{ "quiet", 0, 0, 'q' },
156-
{ "random", 0, 0, 'R' },
157-
{ "reverse", 0, 0, 'r' },
158-
{ "show-comment", 0, 0, 'C' },
159-
{ "solo", 1, 0, 'S' },
160-
{ "start", 1, 0, 's' },
161-
{ "stdout", 0, 0, 'c' },
162-
{ "tempo", 1, 0, 'T' },
163-
{ "time", 1, 0, 't' },
164-
{ "unsigned", 0, 0, 'u' },
165-
{ "vblank", 0, 0, OPT_VBLANK },
166-
{ "version", 0, 0, 'V' },
167-
{ "verbose", 0, 0, 'v' },
168-
{ "all-sequences", 1, 0, 'Z' },
169-
{ "sequence", 1, 0, 'z' },
170-
{ NULL, 0, 0, 0 }
128+
{ "amiga", 0, NULL, 'A' },
129+
{ "amplify", 1, NULL, 'a' },
130+
{ "bits", 1, NULL, 'b' },
131+
{ "driver", 1, NULL, 'd' },
132+
{ "default-pan", 1, NULL, 'p' },
133+
{ "fix-sample-loops", 0, NULL, OPT_FIXLOOP },
134+
{ "frequency", 1, NULL, 'f' },
135+
{ "help", 0, NULL, 'h' },
136+
{ "instrument-path", 1, NULL, 'I' },
137+
{ "interpolation", 1, NULL, 'i' },
138+
{ "list-formats", 0, NULL, 'L' },
139+
{ "loop", 0, NULL, 'l' },
140+
{ "loop-all", 0, NULL, OPT_LOOPALL },
141+
{ "loop-until", 1, NULL, 'U' },
142+
{ "mixer-voices", 1, NULL, OPT_NUMVOICES },
143+
{ "mono", 0, NULL, 'm' },
144+
{ "mute", 1, NULL, 'M' },
145+
{ "null", 0, NULL, 'N' },
146+
{ "nocmd", 0, NULL, OPT_NOCMD },
147+
{ "norc", 0, NULL, OPT_NORC },
148+
{ "nofilter", 0, NULL, 'F' },
149+
/* { "offset-bug-emulation",0, NULL, OPT_FX9BUG }, */
150+
{ "output-file", 1, NULL, 'o' },
151+
{ "pan", 1, NULL, 'P' },
152+
{ "player-mode", 1, NULL, 'e' },
153+
{ "probe-only", 0, NULL, OPT_PROBEONLY },
154+
{ "load-only", 0, NULL, OPT_LOADONLY },
155+
{ "quiet", 0, NULL, 'q' },
156+
{ "random", 0, NULL, 'R' },
157+
{ "reverse", 0, NULL, 'r' },
158+
{ "show-comment", 0, NULL, 'C' },
159+
{ "solo", 1, NULL, 'S' },
160+
{ "start", 1, NULL, 's' },
161+
{ "stdout", 0, NULL, 'c' },
162+
{ "tempo", 1, NULL, 'T' },
163+
{ "time", 1, NULL, 't' },
164+
{ "unsigned", 0, NULL, 'u' },
165+
{ "vblank", 0, NULL, OPT_VBLANK },
166+
{ "version", 0, NULL, 'V' },
167+
{ "verbose", 0, NULL, 'v' },
168+
{ "all-sequences", 1, NULL, 'Z' },
169+
{ "sequence", 1, NULL, 'z' },
170+
{ NULL, 0, NULL, 0 }
171171
};
172172

173173

src/sound_alsa.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,19 @@ static int init(struct options *options)
5252
snd_pcm_hw_params_set_access(pcm_handle, hwparams,
5353
SND_PCM_ACCESS_RW_INTERLEAVED);
5454
snd_pcm_hw_params_set_format(pcm_handle, hwparams, fmt);
55-
snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &rate, 0);
55+
snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &rate, NULL);
5656
snd_pcm_hw_params_set_channels_near(pcm_handle, hwparams, &channels);
57-
snd_pcm_hw_params_set_buffer_time_near(pcm_handle, hwparams, &btime, 0);
58-
snd_pcm_hw_params_set_period_time_near(pcm_handle, hwparams, &ptime, 0);
57+
snd_pcm_hw_params_set_buffer_time_near(pcm_handle, hwparams, &btime, NULL);
58+
snd_pcm_hw_params_set_period_time_near(pcm_handle, hwparams, &ptime, NULL);
5959
snd_pcm_nonblock(pcm_handle, 0);
6060

6161
if ((ret = snd_pcm_hw_params(pcm_handle, hwparams)) < 0) {
62-
fprintf(stderr, "Unable to set ALSA output parameters: %s\n",
63-
snd_strerror(ret));
62+
fprintf(stderr, "Unable to set ALSA output parameters: %s\n", snd_strerror(ret));
6463
return -1;
6564
}
6665

6766
if ((ret = snd_pcm_prepare(pcm_handle)) < 0) {
68-
fprintf(stderr, "Unable to prepare ALSA: %s\n",
69-
snd_strerror(ret));
67+
fprintf(stderr, "Unable to prepare ALSA: %s\n", snd_strerror(ret));
7068
return -1;
7169
}
7270

@@ -132,4 +130,3 @@ const struct sound_driver sound_alsa = {
132130
onpause,
133131
onresume
134132
};
135-

0 commit comments

Comments
 (0)