aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-07-17 00:15:52 +0000
committerEric Wong <normalperson@yhbt.net>2006-07-17 00:15:52 +0000
commit368034e1995e8cb27b96f98df0fe07542f446023 (patch)
tree657a082d61c0b19a2b4cabea4502742ee6c66937 /src
parent232dcf4b9456e44f6829229671c04a781d0f353b (diff)
downloadmpd-368034e1995e8cb27b96f98df0fe07542f446023.tar.gz
mpd-368034e1995e8cb27b96f98df0fe07542f446023.tar.xz
mpd-368034e1995e8cb27b96f98df0fe07542f446023.zip
sparse: replace 0 (integer) usage with NULL where appropriate
Probably pedantic, but yes, might as well in case we run into strange platforms where NULL is something strange. git-svn-id: https://svn.musicpd.org/mpd/trunk@4380 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/audioOutputs/audioOutput_alsa.c9
-rw-r--r--src/playerData.c4
-rw-r--r--src/signal_check.c3
3 files changed, 9 insertions, 7 deletions
diff --git a/src/audioOutputs/audioOutput_alsa.c b/src/audioOutputs/audioOutput_alsa.c
index 51531c5f0..351647ace 100644
--- a/src/audioOutputs/audioOutput_alsa.c
+++ b/src/audioOutputs/audioOutput_alsa.c
@@ -208,7 +208,7 @@ static int alsa_openDevice(AudioOutput * audioOutput)
audioFormat->channels = channels;
err = snd_pcm_hw_params_set_rate_near(ad->pcmHandle, hwparams,
- &sampleRate, 0);
+ &sampleRate, NULL);
if(err < 0 || sampleRate == 0) {
ERROR("Alsa device \"%s\" does not support %i Hz audio\n",
ad->device, (int)audioFormat->sampleRate);
@@ -218,14 +218,14 @@ static int alsa_openDevice(AudioOutput * audioOutput)
cmd = "snd_pcm_hw_params_set_buffer_time_near";
err = snd_pcm_hw_params_set_buffer_time_near(ad->pcmHandle, hwparams,
- &ad->buffer_time, 0);
+ &ad->buffer_time, NULL);
if(err < 0) goto error;
if (!ad->period_time && sampleRate > 0)
ad->period_time = 1000000 * MPD_ALSA_SAMPLE_XFER / sampleRate;
cmd = "snd_pcm_hw_params_set_period_time_near";
err = snd_pcm_hw_params_set_period_time_near(ad->pcmHandle, hwparams,
- &ad->period_time, 0);
+ &ad->period_time, NULL);
if(err < 0) goto error;
cmd = "snd_pcm_hw_params";
@@ -237,7 +237,8 @@ static int alsa_openDevice(AudioOutput * audioOutput)
if(err < 0) goto error;
cmd = "snd_pcm_hw_params_get_period_size";
- err = snd_pcm_hw_params_get_period_size(hwparams, &alsa_period_size, 0);
+ err = snd_pcm_hw_params_get_period_size(hwparams, &alsa_period_size,
+ NULL);
if(err < 0) goto error;
ad->canPause = snd_pcm_hw_params_can_pause(hwparams);
diff --git a/src/playerData.c b/src/playerData.c
index 84763225a..ec5d5d315 100644
--- a/src/playerData.c
+++ b/src/playerData.c
@@ -99,7 +99,7 @@ void initPlayerData(void) {
ERROR("problems shmat'ing\n");
exit(EXIT_FAILURE);
}
- if (shmctl(shmid, IPC_RMID, 0)<0) {
+ if (shmctl(shmid, IPC_RMID, NULL)<0) {
ERROR("problems shmctl'ing\n");
exit(EXIT_FAILURE);
}
@@ -115,7 +115,7 @@ void initPlayerData(void) {
ERROR("problems shmat'ing\n");
exit(EXIT_FAILURE);
}
- if (shmctl(shmid, IPC_RMID, 0)<0) {
+ if (shmctl(shmid, IPC_RMID, NULL)<0) {
ERROR("problems shmctl'ing\n");
exit(EXIT_FAILURE);
}
diff --git a/src/signal_check.c b/src/signal_check.c
index c06525350..ab6ffce74 100644
--- a/src/signal_check.c
+++ b/src/signal_check.c
@@ -20,6 +20,7 @@
#include "signal_check.h"
#include <errno.h>
+#include <stddef.h>
volatile sig_atomic_t __caught_signals[NSIG];
@@ -33,7 +34,7 @@ static void __set_signal_handler(int sig, void (* handler)(int))
struct sigaction act;
act.sa_flags = 0;
act.sa_handler = handler;
- while(sigaction(sig, &act, 0) && errno==EINTR);
+ while(sigaction(sig, &act, NULL) && errno==EINTR);
}
void signal_handle(int sig)