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/sphere.c (1 of 93 files). Show all

Unified · Split

src/sphere.c+9−11
@@ -1,8 +1,6 @@
11 /*
22 * NIST Sphere file format handler.
3− */
4−
5−/*
3+ *
64 * August 7, 2000
75 *
86 * Copyright (C) 2000 Chris Bagwell (cbagwell@sprynet.com)
@@ -28,7 +26,7 @@ typedef struct spherestuff { · 19 unmodified lines
2826 * size and encoding of samples,
2927 * mono/stereo/quad.
3028 */
31−int st_spherestartread(ft_t ft)
29+static int st_spherestartread(ft_t ft)
3230 {
3331 sphere_t sphere = (sphere_t) ft->priv;
3432 int rc;
@@ -85,7 +83,7 @@ int st_spherestartread(ft_t ft) · 50 unmodified lines
8583 ft->info.size = i;
8684 }
8785 if (strncmp(buf, "channel_count", 13) == 0 &&
88− ft->info.channels == -1)
86+ ft->info.channels == 0)
8987 {
9088 sscanf(buf, "%63s %15s %d", fldname, fldtype, &i);
9189 ft->info.channels = i;
@@ -96,7 +94,7 @@ int st_spherestartread(ft_t ft) · 4 unmodified lines
9694 /* Only bother looking for ulaw flag. All others
9795 * should be caught below by default PCM check
9896 */
99− if (ft->info.encoding == -1 &&
97+ if (ft->info.encoding == ST_ENCODING_UNKNOWN &&
10098 strncmp(fldsval,"ulaw",4) == 0)
10199 {
102100 ft->info.encoding = ST_ENCODING_ULAW;
@@ -146,7 +144,7 @@ int st_spherestartread(ft_t ft) · 43 unmodified lines
146144 * This means encoding is signed if size = word or
147145 * unsigned if size = byte.
148146 */
149− if (ft->info.encoding == -1)
147+ if (ft->info.encoding == ST_ENCODING_UNKNOWN)
150148 {
151149 if (ft->info.size == 1)
152150 ft->info.encoding = ST_ENCODING_UNSIGNED;
@@ -190,7 +188,7 @@ int st_spherestartread(ft_t ft) · 37 unmodified lines
190188 * Return number of samples read.
191189 */
192190
193−st_ssize_t st_sphereread(ft_t ft, st_sample_t *buf, st_size_t len)
191+static st_size_t st_sphereread(ft_t ft, st_sample_t *buf, st_size_t len)
194192 {
195193 sphere_t sphere = (sphere_t) ft->priv;
196194
@@ -204,7 +202,7 @@ st_ssize_t st_sphereread(ft_t ft, st_sample_t *buf, st_size_t len) · 7 unmodified lines
204202 return st_rawread(ft, buf, len);
205203 }
206204
207−int st_spherestartwrite(ft_t ft)
205+static int st_spherestartwrite(ft_t ft)
208206 {
209207 int rc;
210208 int x;
@@ -243,7 +241,7 @@ int st_spherestartwrite(ft_t ft) · 32 unmodified lines
243241
244242 }
245243
246−st_ssize_t st_spherewrite(ft_t ft, const st_sample_t *buf, st_size_t len)
244+static st_size_t st_spherewrite(ft_t ft, const st_sample_t *buf, st_size_t len)
247245 {
248246 sphere_t sphere = (sphere_t) ft->priv;
249247
@@ -251,7 +249,7 @@ st_ssize_t st_spherewrite(ft_t ft, const st_sample_t *buf, st_size_t len) · 1 unmodified line
251249 return st_rawwrite(ft, buf, len);
252250 }
253251
254−int st_spherestopwrite(ft_t ft)
252+static int st_spherestopwrite(ft_t ft)
255253 {
256254 int rc;
257255 char buf[128];

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