From 8a87b663edee6dad6c711a03815f655ecbe9c19b Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Sat, 18 Feb 2012 12:06:48 +0100 Subject: [PATCH] midi plugin: make local functions static where possible Change-Id: I702755529f98015586b5b9592ced75cf7591880c --- apps/plugins/midi/guspat.c | 8 ++++---- apps/plugins/midi/midifile.c | 3 ++- apps/plugins/midi/midiplay.c | 2 +- apps/plugins/midi/midiutil.c | 2 +- apps/plugins/midi/sequencer.c | 1 + apps/plugins/midi/sequencer.h | 1 - apps/plugins/midi/synth.c | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/plugins/midi/guspat.c b/apps/plugins/midi/guspat.c index ea0ca92518..d8854b84b7 100644 --- a/apps/plugins/midi/guspat.c +++ b/apps/plugins/midi/guspat.c @@ -37,12 +37,12 @@ const uint32_t gustable[]= 4186073, 4434930, 4698645, 4978041, 5274051, 5587663, 5919922, 6271939, 6644889, 7040015, 7458636, 7902150 }; -unsigned int readWord(int file) +static unsigned int readWord(int file) { return (readChar(file)<<0) | (readChar(file)<<8); // | (readChar(file)<<8) | (readChar(file)<<0); } -unsigned int readDWord(int file) +static unsigned int readDWord(int file) { return (readChar(file)<<0) | (readChar(file)<<8) | (readChar(file)<<16) | (readChar(file)<<24); } @@ -50,7 +50,7 @@ unsigned int readDWord(int file) int curr_waveform; struct GWaveform waveforms[256] IBSS_ATTR; -struct GWaveform * loadWaveform(int file) +static struct GWaveform * loadWaveform(int file) { struct GWaveform * wav = &waveforms[curr_waveform++]; rb->memset(wav, 0, sizeof(struct GWaveform)); @@ -137,7 +137,7 @@ struct GWaveform * loadWaveform(int file) return wav; } -int selectWaveform(struct GPatch * pat, int midiNote) +static int selectWaveform(struct GPatch * pat, int midiNote) { /* We divide by 100 here because everyone's freq formula is slightly different */ unsigned int tabFreq = gustable[midiNote]/100; /* Comparison */ diff --git a/apps/plugins/midi/midifile.c b/apps/plugins/midi/midifile.c index 536a7bbea1..86544fd944 100644 --- a/apps/plugins/midi/midifile.c +++ b/apps/plugins/midi/midifile.c @@ -20,6 +20,7 @@ ****************************************************************************/ #include "plugin.h" #include "midiutil.h" +#include "midifile.h" struct Track * readTrack(int file); int readID(int file); @@ -125,7 +126,7 @@ struct MIDIfile * loadFile(const char * filename) int rStatus = 0; /* Returns 0 if done, 1 if keep going */ -int readEvent(int file, void * dest) +static int readEvent(int file, void * dest) { struct Event dummy; struct Event * ev = (struct Event *) dest; diff --git a/apps/plugins/midi/midiplay.c b/apps/plugins/midi/midiplay.c index 6ef3439ffd..40b4f1c83c 100644 --- a/apps/plugins/midi/midiplay.c +++ b/apps/plugins/midi/midiplay.c @@ -319,7 +319,7 @@ static inline void synthbuf(void) samples_in_buf = BUF_SIZE-i; } -void get_more(unsigned char** start, size_t* size) +static void get_more(unsigned char** start, size_t* size) { #ifndef SYNC if(lastswap != swap) diff --git a/apps/plugins/midi/midiutil.c b/apps/plugins/midi/midiutil.c index f4950408ab..bfac1d5244 100644 --- a/apps/plugins/midi/midiutil.c +++ b/apps/plugins/midi/midiutil.c @@ -37,7 +37,7 @@ struct GPatch * drumSet[128]; struct SynthObject voices[MAX_VOICES] IBSS_ATTR; -void *alloc(int size) +static void *alloc(int size) { static char *offset = NULL; static size_t totalSize = 0; diff --git a/apps/plugins/midi/sequencer.c b/apps/plugins/midi/sequencer.c index be26fdd532..e860dbd2dd 100644 --- a/apps/plugins/midi/sequencer.c +++ b/apps/plugins/midi/sequencer.c @@ -22,6 +22,7 @@ #include "midiutil.h" #include "guspat.h" #include "synth.h" +#include "sequencer.h" long tempo = 375000; diff --git a/apps/plugins/midi/sequencer.h b/apps/plugins/midi/sequencer.h index 0e49747029..9e3c72bc6e 100644 --- a/apps/plugins/midi/sequencer.h +++ b/apps/plugins/midi/sequencer.h @@ -22,7 +22,6 @@ int tick(void); /* used by beatbox */ -void pressNote(int ch, int note, int vol); void rewindFile(void); void seekForward(int nSec); diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c index 663565ecdb..e95dd7cec9 100644 --- a/apps/plugins/midi/synth.c +++ b/apps/plugins/midi/synth.c @@ -23,7 +23,7 @@ #include "midiutil.h" #include "synth.h" -void readTextBlock(int file, char * buf) +static void readTextBlock(int file, char * buf) { char c = 0; do