summaryrefslogtreecommitdiff
path: root/src/midifile.c
diff options
context:
space:
mode:
authorFabian Greffrath2015-05-08 08:43:19 +0200
committerFabian Greffrath2015-05-08 08:43:19 +0200
commit2e8f6da6fdf0eb71e58d2cdaad24e5b0a332f675 (patch)
treeb38530dc38b13e3dc5286c64889bed5ec0e2f3d8 /src/midifile.c
parent14c50f0200a382dd5be45b9dca74b6d5e4d89730 (diff)
downloadchocolate-doom-2e8f6da6fdf0eb71e58d2cdaad24e5b0a332f675.tar.gz
chocolate-doom-2e8f6da6fdf0eb71e58d2cdaad24e5b0a332f675.tar.bz2
chocolate-doom-2e8f6da6fdf0eb71e58d2cdaad24e5b0a332f675.zip
warnings: fix ".. may be used uninitialized in this function" warnings
Actually, it was already impossible for the reported variables to be used uninitialized, because they were all assigned a value by calling ReadByte() and the function would return if that failed. However, the compiler couldn't know about this fact, so we do him the favor and initialized them to 0.
Diffstat (limited to 'src/midifile.c')
-rw-r--r--src/midifile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/midifile.c b/src/midifile.c
index 92ffd803..1ab4ecdb 100644
--- a/src/midifile.c
+++ b/src/midifile.c
@@ -130,7 +130,7 @@ static boolean ReadByte(byte *result, FILE *stream)
static boolean ReadVariableLength(unsigned int *result, FILE *stream)
{
int i;
- byte b;
+ byte b = 0;
*result = 0;
@@ -203,7 +203,7 @@ static boolean ReadChannelEvent(midi_event_t *event,
byte event_type, boolean two_param,
FILE *stream)
{
- byte b;
+ byte b = 0;
// Set basics:
@@ -269,7 +269,7 @@ static boolean ReadSysExEvent(midi_event_t *event, int event_type,
static boolean ReadMetaEvent(midi_event_t *event, FILE *stream)
{
- byte b;
+ byte b = 0;
event->event_type = MIDI_EVENT_META;
@@ -308,7 +308,7 @@ static boolean ReadMetaEvent(midi_event_t *event, FILE *stream)
static boolean ReadEvent(midi_event_t *event, unsigned int *last_event_type,
FILE *stream)
{
- byte event_type;
+ byte event_type = 0;
if (!ReadVariableLength(&event->delta_time, stream))
{