To support this change, turn on lots more compiler warnings, and fix all the warnings generated.
Showing the changes to src/synth.c (1 of 93 files). Show all
Unified · Split
| @@ -49,14 +49,14 @@ enum_item const synth_type[] = { · 48 unmodified lines | ||
| 49 | 49 | ENUM_ITEM(SYNTH_,PINKNOISE ) |
| 50 | 50 | ENUM_ITEM(SYNTH_,BROWNNOISE) |
| 51 | 51 | ENUM_ITEM(SYNTH_,EXP ) |
| 52 | − {0}}; | |
| 52 | + {0, 0}}; | |
| 53 | 53 | |
| 54 | 54 | enum_item const combine_type[] = { |
| 55 | 55 | ENUM_ITEM(SYNTH_,CREATE) |
| 56 | 56 | ENUM_ITEM(SYNTH_,MIX ) |
| 57 | 57 | ENUM_ITEM(SYNTH_,AMOD ) |
| 58 | 58 | ENUM_ITEM(SYNTH_,FMOD ) |
| 59 | − {0}}; | |
| 59 | + {0, 0}}; | |
| 60 | 60 | |
| 61 | 61 | /* do not ask me for the colored noise, i copied the |
| 62 | 62 | * algorithm somewhere... |
| @@ -97,7 +97,7 @@ typedef struct{ · 34 unmodified lines | ||
| 97 | 97 | } PinkNoise; |
| 98 | 98 | |
| 99 | 99 | /* Setup PinkNoise structure for N rows of generators. */ |
| 100 | −void InitializePinkNoise( PinkNoise *pink, int numRows ) | |
| 100 | +static void InitializePinkNoise( PinkNoise *pink, int numRows ) | |
| 101 | 101 | { |
| 102 | 102 | int i; |
| 103 | 103 | long pmax; |
| @@ -112,7 +112,7 @@ void InitializePinkNoise( PinkNoise *pink, int numRows ) · 8 unmodified lines | ||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /* Generate Pink noise values between -1.0 and +1.0 */ |
| 115 | −float GeneratePinkNoise( PinkNoise *pink ) | |
| 115 | +static float GeneratePinkNoise( PinkNoise *pink ) | |
| 116 | 116 | { |
| 117 | 117 | long newRandom; |
| 118 | 118 | long sum; |
| @@ -238,7 +238,7 @@ static void parmcopy(synth_t sy, int s, int d){ · 119 unmodified lines | ||
| 238 | 238 | * Don't do initialization now. |
| 239 | 239 | * The 'info' fields are not yet filled in. |
| 240 | 240 | */ |
| 241 | −int st_synth_getopts(eff_t effp, int n, char **argv) | |
| 241 | +static int st_synth_getopts(eff_t effp, int n, char **argv) | |
| 242 | 242 | { |
| 243 | 243 | int argn; |
| 244 | 244 | char *hlp; |
| @@ -372,7 +372,7 @@ int st_synth_getopts(eff_t effp, int n, char **argv) · 127 unmodified lines | ||
| 372 | 372 | * Prepare processing. |
| 373 | 373 | * Do all initializations. |
| 374 | 374 | */ |
| 375 | −int st_synth_start(eff_t effp) | |
| 375 | +static int st_synth_start(eff_t effp) | |
| 376 | 376 | { |
| 377 | 377 | int i; |
| 378 | 378 | int c; |
| @@ -664,7 +664,7 @@ static st_sample_t do_synth(st_sample_t iv, synth_t synth, int c){ · 285 unmodified lines | ||
| 664 | 664 | /* |
| 665 | 665 | * Processed signed long samples from ibuf to obuf. |
| 666 | 666 | */ |
| 667 | −int st_synth_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, | |
| 667 | +static int st_synth_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, | |
| 668 | 668 | st_size_t *isamp, st_size_t *osamp) |
| 669 | 669 | { |
| 670 | 670 | synth_t synth = (synth_t) effp->priv; |
| @@ -701,26 +701,6 @@ int st_synth_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, · 30 unmodified lines | ||
| 701 | 701 | return result; |
| 702 | 702 | } |
| 703 | 703 | |
| 704 | −/* | |
| 705 | − * Drain out remaining samples if the effect generates any. | |
| 706 | − */ | |
| 707 | − | |
| 708 | −int st_synth_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp) | |
| 709 | −{ | |
| 710 | − *osamp = 0; | |
| 711 | − return ST_EOF; | |
| 712 | −} | |
| 713 | − | |
| 714 | −/* | |
| 715 | − * Do anything required when you stop reading samples. | |
| 716 | − * (free allocated memory, etc.) | |
| 717 | − */ | |
| 718 | −int st_synth_stop(eff_t effp) | |
| 719 | −{ | |
| 720 | − /* nothing to do */ | |
| 721 | − return (ST_SUCCESS); | |
| 722 | −} | |
| 723 | − | |
| 724 | 704 | static st_effect_t st_synth_effect = { |
| 725 | 705 | "synth", |
| 726 | 706 | "Usage: synth [len] {[type] [combine] [freq[-freq2]] [off] [ph] [p1] [p2] [p3]}\n" |
| @@ -741,8 +721,8 @@ static st_effect_t st_synth_effect = { · 14 unmodified lines | ||
| 741 | 721 | st_synth_getopts, |
| 742 | 722 | st_synth_start, |
| 743 | 723 | st_synth_flow, |
| 744 | − st_synth_drain, | |
| 745 | − st_synth_stop | |
| 724 | + st_effect_nothing_drain, | |
| 725 | + st_effect_nothing | |
| 746 | 726 | }; |
| 747 | 727 | |
| 748 | 728 | const st_effect_t *st_synth_effect_fn(void) |