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
4949 ENUM_ITEM(SYNTH_,PINKNOISE )
5050 ENUM_ITEM(SYNTH_,BROWNNOISE)
5151 ENUM_ITEM(SYNTH_,EXP )
52− {0}};
52+ {0, 0}};
5353
5454 enum_item const combine_type[] = {
5555 ENUM_ITEM(SYNTH_,CREATE)
5656 ENUM_ITEM(SYNTH_,MIX )
5757 ENUM_ITEM(SYNTH_,AMOD )
5858 ENUM_ITEM(SYNTH_,FMOD )
59− {0}};
59+ {0, 0}};
6060
6161 /* do not ask me for the colored noise, i copied the
6262 * algorithm somewhere...
@@ -97,7 +97,7 @@ typedef struct{ · 34 unmodified lines
9797 } PinkNoise;
9898
9999 /* Setup PinkNoise structure for N rows of generators. */
100−void InitializePinkNoise( PinkNoise *pink, int numRows )
100+static void InitializePinkNoise( PinkNoise *pink, int numRows )
101101 {
102102 int i;
103103 long pmax;
@@ -112,7 +112,7 @@ void InitializePinkNoise( PinkNoise *pink, int numRows ) · 8 unmodified lines
112112 }
113113
114114 /* Generate Pink noise values between -1.0 and +1.0 */
115−float GeneratePinkNoise( PinkNoise *pink )
115+static float GeneratePinkNoise( PinkNoise *pink )
116116 {
117117 long newRandom;
118118 long sum;
@@ -238,7 +238,7 @@ static void parmcopy(synth_t sy, int s, int d){ · 119 unmodified lines
238238 * Don't do initialization now.
239239 * The 'info' fields are not yet filled in.
240240 */
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)
242242 {
243243 int argn;
244244 char *hlp;
@@ -372,7 +372,7 @@ int st_synth_getopts(eff_t effp, int n, char **argv) · 127 unmodified lines
372372 * Prepare processing.
373373 * Do all initializations.
374374 */
375−int st_synth_start(eff_t effp)
375+static int st_synth_start(eff_t effp)
376376 {
377377 int i;
378378 int c;
@@ -664,7 +664,7 @@ static st_sample_t do_synth(st_sample_t iv, synth_t synth, int c){ · 285 unmodified lines
664664 /*
665665 * Processed signed long samples from ibuf to obuf.
666666 */
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,
668668 st_size_t *isamp, st_size_t *osamp)
669669 {
670670 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
701701 return result;
702702 }
703703
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−
724704 static st_effect_t st_synth_effect = {
725705 "synth",
726706 "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
741721 st_synth_getopts,
742722 st_synth_start,
743723 st_synth_flow,
744− st_synth_drain,
745− st_synth_stop
724+ st_effect_nothing_drain,
725+ st_effect_nothing
746726 };
747727
748728 const 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