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

Unified · Split

src/filter.c+9−9
@@ -54,7 +54,7 @@ static void FiltWin(filter_t f, long Nx); · 53 unmodified lines
5454 /*
5555 * Process options
5656 */
57−int st_filter_getopts(eff_t effp, int n, char **argv)
57+static int st_filter_getopts(eff_t effp, int n, char **argv)
5858 {
5959 filter_t f = (filter_t) effp->priv;
6060
@@ -104,7 +104,7 @@ int st_filter_getopts(eff_t effp, int n, char **argv) · 43 unmodified lines
104104 /*
105105 * Prepare processing.
106106 */
107−int st_filter_start(eff_t effp)
107+static int st_filter_start(eff_t effp)
108108 {
109109 filter_t f = (filter_t) effp->priv;
110110 double *Fp0, *Fp1;
@@ -114,7 +114,7 @@ int st_filter_start(eff_t effp) · 3 unmodified lines
114114 f->rate = effp->ininfo.rate;
115115
116116 /* adjust upper frequency to Nyquist if necessary */
117− if (f->freq1 > f->rate/2 || f->freq1 <= 0)
117+ if (f->freq1 > (st_sample_t)f->rate/2 || f->freq1 <= 0)
118118 f->freq1 = f->rate/2;
119119
120120 if ((f->freq0 < 0) || (f->freq0 > f->freq1))
@@ -126,7 +126,7 @@ int st_filter_start(eff_t effp) · 5 unmodified lines
126126
127127 Xh = f->Nwin/2;
128128 Fp0 = (double *) malloc(sizeof(double) * (Xh + 2)) + 1;
129− if (f->freq0 > f->rate/200) {
129+ if (f->freq0 > (st_sample_t)f->rate/200) {
130130 Xh0 = makeFilter(Fp0, Xh, 2.0*(double)f->freq0/f->rate, f->beta, 1, 0);
131131 if (Xh0 <= 1)
132132 {
@@ -138,7 +138,7 @@ int st_filter_start(eff_t effp) · 5 unmodified lines
138138 }
139139 Fp1 = (double *) malloc(sizeof(double) * (Xh + 2)) + 1;
140140 /* need Fp[-1] and Fp[Xh] for makeFilter */
141− if (f->freq1 < f->rate/2) {
141+ if (f->freq1 < (st_sample_t)f->rate/2) {
142142 Xh1 = makeFilter(Fp1, Xh, 2.0*(double)f->freq1/f->rate, f->beta, 1, 0);
143143 if (Xh1 <= 1)
144144 {
@@ -182,11 +182,11 @@ int st_filter_start(eff_t effp) · 37 unmodified lines
182182 * Processed signed long samples from ibuf to obuf.
183183 * Return number of samples processed.
184184 */
185−int st_filter_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf,
185+static int st_filter_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf,
186186 st_size_t *isamp, st_size_t *osamp)
187187 {
188188 filter_t f = (filter_t) effp->priv;
189− long i, Nx, Nproc;
189+ st_size_t i, Nx, Nproc;
190190
191191 /* constrain amount we actually process */
192192 /* st_debug("Xh %d, Xt %d, isamp %d, ",f->Xh, f->Xt, *isamp); */
@@ -234,7 +234,7 @@ int st_filter_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, · 41 unmodified lines
234234 /*
235235 * Process tail of input samples.
236236 */
237−int st_filter_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp)
237+static int st_filter_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp)
238238 {
239239 filter_t f = (filter_t) effp->priv;
240240 long isamp_res, osamp_res;
@@ -271,7 +271,7 @@ int st_filter_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp) · 30 unmodified lines
271271 * Do anything required when you stop reading samples.
272272 * Don't close input file!
273273 */
274−int st_filter_stop(eff_t effp)
274+static int st_filter_stop(eff_t effp)
275275 {
276276 filter_t f = (filter_t) effp->priv;
277277

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