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
51 if (ft->info.size == ST_SIZE_BYTE) {51 if (ft->info.size == ST_SIZE_BYTE) {
52 sampletype = AFMT_U8;52 sampletype = AFMT_U8;
53 samplesize = 8;53 samplesize = 8;
54 if (ft->info.encoding == -1)54 if (ft->info.encoding == ST_ENCODING_UNKNOWN)
55 ft->info.encoding = ST_ENCODING_UNSIGNED;55 ft->info.encoding = ST_ENCODING_UNSIGNED;
56 if (ft->info.encoding != ST_ENCODING_UNSIGNED) {56 if (ft->info.encoding != ST_ENCODING_UNSIGNED) {
57 st_report("OSS driver only supports unsigned with bytes");57 st_report("OSS driver only supports unsigned with bytes");
@@ -62,7 +62,7 @@ static int ossdspinit(ft_t ft) · 4 unmodified lines
62 else if (ft->info.size == ST_SIZE_WORD) {62 else if (ft->info.size == ST_SIZE_WORD) {
63 sampletype = (ST_IS_BIGENDIAN) ? AFMT_S16_BE : AFMT_S16_LE;63 sampletype = (ST_IS_BIGENDIAN) ? AFMT_S16_BE : AFMT_S16_LE;
64 samplesize = 16;64 samplesize = 16;
65 if (ft->info.encoding == -1)65 if (ft->info.encoding == ST_ENCODING_UNKNOWN)
66 ft->info.encoding = ST_ENCODING_SIGN2;66 ft->info.encoding = ST_ENCODING_SIGN2;
67 if (ft->info.encoding != ST_ENCODING_SIGN2) {67 if (ft->info.encoding != ST_ENCODING_SIGN2) {
68 st_report("OSS driver only supports signed with words");68 st_report("OSS driver only supports signed with words");
@@ -79,7 +79,7 @@ static int ossdspinit(ft_t ft) · 10 unmodified lines
79 st_report("Forcing to signed linear word");79 st_report("Forcing to signed linear word");
80 }80 }
81 81
82 if (ft->info.channels == -1) ft->info.channels = 1;82 if (ft->info.channels == 0) ft->info.channels = 1;
83 else if (ft->info.channels > 2) ft->info.channels = 2;83 else if (ft->info.channels > 2) ft->info.channels = 2;
84 84
85 if (ioctl(fileno(ft->fp), SNDCTL_DSP_RESET, 0) < 0)85 if (ioctl(fileno(ft->fp), SNDCTL_DSP_RESET, 0) < 0)
@@ -204,14 +204,14 @@ static int ossdspinit(ft_t ft) · 118 unmodified lines
204 * size and encoding of samples,204 * size and encoding of samples,
205 * mono/stereo/quad.205 * mono/stereo/quad.
206 */206 */
207int st_ossdspstartread(ft_t ft)207static int st_ossdspstartread(ft_t ft)
208{208{
209 int rc;209 int rc;
210 rc = ossdspinit(ft);210 rc = ossdspinit(ft);
211 return rc;211 return rc;
212}212}
213 213
214int st_ossdspstartwrite(ft_t ft)214static int st_ossdspstartwrite(ft_t ft)
215{215{
216 return ossdspinit(ft);216 return ossdspinit(ft);
217}217}

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