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

Unified · Split

src/polyphas.c+13−13
@@ -80,7 +80,7 @@ static int win_type = 0; · 79 unmodified lines
8080 static int win_width = 1024;
8181 static Float cutoff = 0.95;
8282
83−int st_poly_getopts(eff_t effp, int n, char **argv)
83+static int st_poly_getopts(eff_t effp UNUSED, int n, char **argv)
8484 {
8585 /* 0: nuttall
8686 1: hamming */
@@ -179,9 +179,9 @@ static int prime(int n, int *q0) · 92 unmodified lines
179179 return (q-q0);
180180 }
181181
182−static int permute(int *m, int *l, int ct, int ct1, int amalg)
182+static int permute(int *m, int *l, int ct, int ct1, size_t amalg)
183183 {
184− int k, n;
184+ size_t k, n;
185185 int *p;
186186 int *q;
187187
@@ -221,7 +221,7 @@ static int permute(int *m, int *l, int ct, int ct1, int amalg) · 33 unmodified lines
221221 static int optimize_factors(int numer, int denom, int *l1, int *l2)
222222 {
223223 int f_min,c_min,u_min,ct1,ct2;
224− int amalg;
224+ size_t amalg;
225225 int k;
226226 static int m1[MF],m2[MF];
227227 static int b1[MF],b2[MF];
@@ -239,7 +239,7 @@ static int optimize_factors(int numer, int denom, int *l1, int *l2) · 11 unmodified lines
239239 ct1 = prime(numer,l1);
240240 ct2 = prime(denom,l2);
241241
242− for (amalg = max(9,l2[0]); amalg<= 9+l2[ct2-1]; amalg++) {
242+ for (amalg = max(9,l2[0]); amalg <= (size_t)(9+l2[ct2-1]); amalg++) {
243243 for (k = 0; k<100000; k++) {
244244 int u,u1,u2,j,f,cost;
245245 cost = 0;
@@ -369,7 +369,7 @@ static void fir_design(Float *buffer, int length, Float cutoff) · 123 unmodified lines
369369
370370 #define RIBLEN 2048
371371
372−int st_poly_start(eff_t effp)
372+static int st_poly_start(eff_t effp)
373373 {
374374 poly_t rate = (poly_t) effp->priv;
375375 static int l1[MF], l2[MF];
@@ -523,7 +523,7 @@ static void update_hist(Float *hist, int hist_size, int in_size) · 147 unmodified lines
523523
524524 }
525525
526−int st_poly_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf,
526+static int st_poly_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf,
527527 st_size_t *isamp, st_size_t *osamp)
528528 {
529529 poly_t rate = (poly_t) effp->priv;
@@ -534,7 +534,7 @@ int st_poly_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, · 4 unmodified lines
534534 s0 = rate->stage[0]; /* the first stage */
535535 s1 = rate->stage[rate->total]; /* the 'last' stage is output buffer */
536536 {
537− int in_size, gap, k;
537+ st_size_t in_size, gap, k;
538538
539539 in_size = *isamp;
540540 gap = s0->size - s0->held; /* space available in this 'input' buffer */
@@ -558,7 +558,7 @@ int st_poly_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, · 17 unmodified lines
558558 }
559559
560560 if (s0->held == s0->size && s1->held == 0) {
561− int k;
561+ st_size_t k;
562562 /* input buffer full, output buffer empty, so do process */
563563
564564 for(k=0; k<rate->total; k++) {
@@ -587,7 +587,7 @@ int st_poly_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, · 22 unmodified lines
587587 st_size_t out_size;
588588 st_size_t oskip;
589589 Float *out_buf;
590− int k;
590+ st_size_t k;
591591
592592 oskip = rate->oskip;
593593 out_size = s1->held;
@@ -626,7 +626,7 @@ int st_poly_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, · 32 unmodified lines
626626 /*
627627 * Process tail of input samples.
628628 */
629−int st_poly_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp)
629+static int st_poly_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp)
630630 {
631631 st_size_t in_size;
632632 /* Call "flow" with NULL input. */
@@ -638,11 +638,11 @@ int st_poly_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp) · 5 unmodified lines
638638 * Do anything required when you stop reading samples.
639639 * Don't close input file!
640640 */
641−int st_poly_stop(eff_t effp)
641+static int st_poly_stop(eff_t effp)
642642 {
643643 poly_t rate = (poly_t) effp->priv;
644644 polystage *s;
645− int k;
645+ st_size_t k;
646646
647647 for(k = 0; k <= rate->total; k++) {
648648 s = rate->stage[k];

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