History

Fix read and write return types: now st_size_t, like the size inputs.

To support this change, turn on lots more compiler warnings, and fix all the warnings generated.

rrt committed 19 years ago

Commit 4d743c41 parent ce1f8f393 files · +875 −1236Browse files

Showing the changes to src/oss.c (1 of 93 files). Show all

Unified · Split

src/oss.c+5−5
@@ -51,7 +51,7 @@ static int ossdspinit(ft_t ft) · 50 unmodified lines
5151 if (ft->info.size == ST_SIZE_BYTE) {
5252 sampletype = AFMT_U8;
5353 samplesize = 8;
54− if (ft->info.encoding == -1)
54+ if (ft->info.encoding == ST_ENCODING_UNKNOWN)
5555 ft->info.encoding = ST_ENCODING_UNSIGNED;
5656 if (ft->info.encoding != ST_ENCODING_UNSIGNED) {
5757 st_report("OSS driver only supports unsigned with bytes");
@@ -62,7 +62,7 @@ static int ossdspinit(ft_t ft) · 4 unmodified lines
6262 else if (ft->info.size == ST_SIZE_WORD) {
6363 sampletype = (ST_IS_BIGENDIAN) ? AFMT_S16_BE : AFMT_S16_LE;
6464 samplesize = 16;
65− if (ft->info.encoding == -1)
65+ if (ft->info.encoding == ST_ENCODING_UNKNOWN)
6666 ft->info.encoding = ST_ENCODING_SIGN2;
6767 if (ft->info.encoding != ST_ENCODING_SIGN2) {
6868 st_report("OSS driver only supports signed with words");
@@ -79,7 +79,7 @@ static int ossdspinit(ft_t ft) · 10 unmodified lines
7979 st_report("Forcing to signed linear word");
8080 }
8181
82− if (ft->info.channels == -1) ft->info.channels = 1;
82+ if (ft->info.channels == 0) ft->info.channels = 1;
8383 else if (ft->info.channels > 2) ft->info.channels = 2;
8484
8585 if (ioctl(fileno(ft->fp), SNDCTL_DSP_RESET, 0) < 0)
@@ -204,14 +204,14 @@ static int ossdspinit(ft_t ft) · 118 unmodified lines
204204 * size and encoding of samples,
205205 * mono/stereo/quad.
206206 */
207−int st_ossdspstartread(ft_t ft)
207+static int st_ossdspstartread(ft_t ft)
208208 {
209209 int rc;
210210 rc = ossdspinit(ft);
211211 return rc;
212212 }
213213
214−int st_ossdspstartwrite(ft_t ft)
214+static int st_ossdspstartwrite(ft_t ft)
215215 {
216216 return ossdspinit(ft);
217217 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t