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

Unified · Split

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

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