1 From 37eb730a452f0ded2ed1c174feb438e3df041581 Mon Sep 17 00:00:00 2001
2 From: Miklos Szeredi <mszeredi@suse.cz>
3 Date: Fri, 11 Nov 2011 14:19:32 +0100
4 Subject: [PATCH] fix compiler warnings
8 osspd.c | 75 ++++++++++++++++++++++++++++++----------------------
9 2 files changed, 44 insertions(+), 34 deletions(-)
11 diff --git a/ossp-padsp.c b/ossp-padsp.c
12 index 1871f5b..3143960 100644
15 @@ -972,16 +972,13 @@ static void do_mmap_read(size_t bytes)
17 static void stream_rw_callback(pa_stream *s, size_t length, void *userdata)
22 if (s == stream[PLAY]) {
24 size = pa_stream_writable_size(s);
27 } else if (s == stream[REC]) {
29 size = pa_stream_readable_size(s);
32 diff --git a/osspd.c b/osspd.c
33 index df1cfc4..4be1ad5 100644
36 @@ -469,15 +469,6 @@ static int ioctl_prep_uarg(fuse_req_t req, void *in, size_t in_sz, void *out,
40 -#define IOCTL_RETURN(result, outp) do { \
41 - if ((outp) != NULL) \
42 - fuse_reply_ioctl(req, result, (outp), sizeof(*(outp))); \
44 - fuse_reply_ioctl(req, result, NULL, 0); \
49 /***************************************************************************
50 * Mixer implementation
52 @@ -709,7 +700,8 @@ static void mixer_simple_ioctl(fuse_req_t req, struct ossp_mixer *mixer,
53 strncpy(info.id, id, sizeof(info.id) - 1);
54 strncpy(info.name, name, sizeof(info.name) - 1);
55 info.modify_counter = mixer->modify_counter;
56 - IOCTL_RETURN(0, &info);
57 + fuse_reply_ioctl(req, 0, &info, sizeof(info));
61 case SOUND_OLD_MIXER_INFO: {
62 @@ -718,7 +710,8 @@ static void mixer_simple_ioctl(fuse_req_t req, struct ossp_mixer *mixer,
63 PREP_UARG(NULL, &info);
64 strncpy(info.id, id, sizeof(info.id) - 1);
65 strncpy(info.name, name, sizeof(info.name) - 1);
66 - IOCTL_RETURN(0, &info);
67 + fuse_reply_ioctl(req, 0, &info, sizeof(info));
72 @@ -737,16 +730,16 @@ static void mixer_simple_ioctl(fuse_req_t req, struct ossp_mixer *mixer,
76 - IOCTL_RETURN(0, &i);
77 + fuse_reply_ioctl(req, 0, &i, sizeof(i));
80 case SOUND_MIXER_WRITE_RECSRC:
81 - IOCTL_RETURN(0, NULL);
82 + fuse_reply_ioctl(req, 0, NULL, 0);
92 static void mixer_do_ioctl(fuse_req_t req, struct ossp_mixer *mixer,
93 @@ -787,7 +780,8 @@ static void mixer_do_ioctl(fuse_req_t req, struct ossp_mixer *mixer,
97 - IOCTL_RETURN(0, &i);
98 + fuse_reply_ioctl(req, 0, &i, sizeof(i));
102 init_mixer_cmd(&mxcmd, mixer);
103 @@ -837,7 +831,12 @@ static void mixer_do_ioctl(fuse_req_t req, struct ossp_mixer *mixer,
104 finish_mixer_cmd(&mxcmd);
107 - IOCTL_RETURN(0, out_bufsz ? &mxcmd.rvol : NULL);
109 + fuse_reply_ioctl(req, 0, &mxcmd.rvol, sizeof(mxcmd.rvol));
111 + fuse_reply_ioctl(req, 0, NULL, 0);
116 fuse_reply_err(req, -rc);
117 @@ -1510,7 +1509,8 @@ static void dsp_ioctl(fuse_req_t req, int signed_cmd, void *uarg,
119 i = SNDRV_OSS_VERSION;
121 - IOCTL_RETURN(0, &i);
122 + fuse_reply_ioctl(req, 0, &i, sizeof(i));
125 case SNDCTL_DSP_GETCAPS:
126 i = DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER |
127 @@ -1519,12 +1519,14 @@ static void dsp_ioctl(fuse_req_t req, int signed_cmd, void *uarg,
131 - IOCTL_RETURN(0, &i);
132 + fuse_reply_ioctl(req, 0, &i, sizeof(i));
135 case SNDCTL_DSP_NONBLOCK:
138 - IOCTL_RETURN(0, NULL);
139 + fuse_reply_ioctl(req, 0, NULL, 0);
142 case SNDCTL_DSP_RESET: op = OSSP_DSP_RESET; goto nd;
143 case SNDCTL_DSP_SYNC: op = OSSP_DSP_SYNC; goto nd;
144 @@ -1533,7 +1535,8 @@ static void dsp_ioctl(fuse_req_t req, int signed_cmd, void *uarg,
145 ret = exec_simple_cmd(&dsps->os, op, NULL, NULL);
148 - IOCTL_RETURN(0, NULL);
149 + fuse_reply_ioctl(req, 0, NULL, 0);
152 case SOUND_PCM_READ_RATE: op = OSSP_DSP_GET_RATE; goto ri;
153 case SOUND_PCM_READ_BITS: op = OSSP_DSP_GET_FORMAT; goto ri;
154 @@ -1546,7 +1549,8 @@ static void dsp_ioctl(fuse_req_t req, int signed_cmd, void *uarg,
155 ret = exec_simple_cmd(&dsps->os, op, NULL, &i);
158 - IOCTL_RETURN(0, &i);
159 + fuse_reply_ioctl(req, 0, &i, sizeof(i));
162 case SNDCTL_DSP_SPEED: op = OSSP_DSP_SET_RATE; goto wi;
163 case SNDCTL_DSP_SETFMT: op = OSSP_DSP_SET_FORMAT; goto wi;
164 @@ -1557,7 +1561,8 @@ static void dsp_ioctl(fuse_req_t req, int signed_cmd, void *uarg,
165 ret = exec_simple_cmd(&dsps->os, op, &i, &i);
168 - IOCTL_RETURN(0, &i);
169 + fuse_reply_ioctl(req, 0, &i, sizeof(i));
172 case SNDCTL_DSP_STEREO:
174 @@ -1566,7 +1571,8 @@ static void dsp_ioctl(fuse_req_t req, int signed_cmd, void *uarg,
178 - IOCTL_RETURN(0, &i);
179 + fuse_reply_ioctl(req, 0, &i, sizeof(i));
182 case SNDCTL_DSP_SETFRAGMENT:
184 @@ -1574,7 +1580,8 @@ static void dsp_ioctl(fuse_req_t req, int signed_cmd, void *uarg,
185 OSSP_DSP_SET_FRAGMENT, &i, NULL);
188 - IOCTL_RETURN(0, NULL);
189 + fuse_reply_ioctl(req, 0, NULL, 0);
192 case SNDCTL_DSP_SETTRIGGER:
194 @@ -1582,7 +1589,8 @@ static void dsp_ioctl(fuse_req_t req, int signed_cmd, void *uarg,
195 OSSP_DSP_SET_TRIGGER, &i, NULL);
198 - IOCTL_RETURN(0, NULL);
199 + fuse_reply_ioctl(req, 0, NULL, 0);
202 case SNDCTL_DSP_GETOSPACE:
203 case SNDCTL_DSP_GETISPACE: {
204 @@ -1603,7 +1611,8 @@ static void dsp_ioctl(fuse_req_t req, int signed_cmd, void *uarg,
205 ret = exec_simple_cmd(&dsps->os, op, NULL, &info);
208 - IOCTL_RETURN(0, &info);
209 + fuse_reply_ioctl(req, 0, &info, sizeof(info));
213 case SNDCTL_DSP_GETOPTR:
214 @@ -1616,14 +1625,16 @@ static void dsp_ioctl(fuse_req_t req, int signed_cmd, void *uarg,
215 ret = exec_simple_cmd(&dsps->os, op, NULL, &info);
218 - IOCTL_RETURN(0, &info);
219 + fuse_reply_ioctl(req, 0, &info, sizeof(info));
223 case SNDCTL_DSP_GETODELAY:
226 ret = exec_simple_cmd(&dsps->os, OSSP_DSP_GET_ODELAY, NULL, &i);
227 - IOCTL_RETURN(ret, &i); /* always copy out result, 0 on err */
228 + fuse_reply_ioctl(req, ret, &i, sizeof(i)); /* always copy out result, 0 on err */
231 case SOUND_PCM_WRITE_FILTER:
232 case SOUND_PCM_READ_FILTER:
233 @@ -1638,14 +1649,16 @@ static void dsp_ioctl(fuse_req_t req, int signed_cmd, void *uarg,
234 case SNDCTL_DSP_SETSYNCRO:
235 case SNDCTL_DSP_SETDUPLEX:
236 case SNDCTL_DSP_PROFILE:
237 - IOCTL_RETURN(0, NULL);
238 + fuse_reply_ioctl(req, 0, NULL, 0);
242 warn_os(os, "unknown ioctl 0x%x", cmd);
246 - assert(0); /* control shouldn't reach here */
250 fuse_reply_err(req, -ret);