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

Unified · Split

src/equalizer.c+20−20
@@ -55,17 +55,17 @@ static st_effect_t st_equalizer_effect; · 54 unmodified lines
5555
5656 /* Filter parameters */
5757 typedef struct filterparams {
58− float rate; // Sample rate
59− float Q; // Q-factor
60− float cfreq; // Central frequency (Hz)
61− float gain; // Gain (dB)
62− double x[3]; // In where x[2] <=> x[ n - 2 ]
63− double y[3]; // Out
64− double b[3]; // From this point, equation constants...
58+ float rate; /* Sample rate */
59+ float Q; /* Q-factor */
60+ float cfreq; /* Central frequency (Hz) */
61+ float gain; /* Gain (dB) */
62+ double x[3]; /* In where x[2] <=> x[ n - 2 ] */
63+ double y[3]; /* Out */
64+ double b[3]; /* From this point, equation constants... */
6565 double a[3];
6666 } *equalizer_t;
6767
68−int st_equalizer_getopts(eff_t effp, int n, char **argv)
68+static int st_equalizer_getopts(eff_t effp, int n, char **argv)
6969 {
7070 equalizer_t eq = (equalizer_t) effp->priv;
7171 int i;
@@ -81,20 +81,20 @@ int st_equalizer_getopts(eff_t effp, int n, char **argv) · 9 unmodified lines
8181 sscanf(argv[i++], "%f", &eq->Q);
8282 sscanf(argv[i++], "%f", &eq->gain);
8383
84− // TODO: Would be nice to validate the params..
84+ /* FIXME: Would be nice to validate the params.. */
8585
8686 return (ST_SUCCESS);
8787 }
8888
89−// Set the filter constants
90−int st_equalizer_start(eff_t effp)
89+/* Set the filter constants */
90+static int st_equalizer_start(eff_t effp)
9191 {
9292 equalizer_t eq = (equalizer_t) effp->priv;
9393 double w0;
9494 double amp;
9595 double alpha;
9696
97− // Sample rate
97+ /* Sample rate */
9898 eq->rate = effp->ininfo.rate;
9999
100100 w0 = 2*M_PI*eq->cfreq/eq->rate;
@@ -109,7 +109,7 @@ int st_equalizer_start(eff_t effp) · 8 unmodified lines
109109 st_debug("amp: %f", amp);
110110 st_debug("alpha: %f", alpha);
111111
112− // Initialisation
112+ /* Initialisation */
113113 eq->b[0] = 1 + alpha*amp;
114114 eq->b[1] = -2*cos(w0);
115115 eq->b[2] = 1 - alpha*amp;
@@ -117,12 +117,12 @@ int st_equalizer_start(eff_t effp) · 1 unmodified line
117117 eq->a[1] = -2*cos(w0);
118118 eq->a[2] = 1 - alpha/amp;
119119
120− eq->x[0] = 0; // x[n]
121− eq->x[1] = 0; // x[n-1]
122− eq->x[2] = 0; // x[n-2]
123− eq->y[0] = 0; // y[n]
124− eq->y[1] = 0; // y[n-1]
125− eq->y[2] = 0; // y[n-2]
120+ eq->x[0] = 0; /* x[n] */
121+ eq->x[1] = 0; /* x[n-1] */
122+ eq->x[2] = 0; /* x[n-2] */
123+ eq->y[0] = 0; /* y[n] */
124+ eq->y[1] = 0; /* y[n-1] */
125+ eq->y[2] = 0; /* y[n-2] */
126126
127127 if (effp->globalinfo.octave_plot_effect)
128128 {
@@ -147,7 +147,7 @@ int st_equalizer_start(eff_t effp) · 18 unmodified lines
147147 return (ST_SUCCESS);
148148 }
149149
150−int st_equalizer_flow(eff_t effp, const st_sample_t *ibuf,
150+static int st_equalizer_flow(eff_t effp, const st_sample_t *ibuf,
151151 st_sample_t *obuf, st_size_t *isamp,
152152 st_size_t *osamp)
153153 {

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