aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidiread.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2017-01-15 22:08:35 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2017-01-15 22:08:35 +0800
commit8a0d671e1a77c58142d0cbe82f40ee64bcae2be5 (patch)
treecb7ce958d02f2bb9e00581a56c28120800521a93 /core/qmpmidiread.cpp
parentb7842ae90b28618affdad6977c9c814aa573a3fe (diff)
downloadQMidiPlayer-8a0d671e1a77c58142d0cbe82f40ee64bcae2be5.tar.xz
A little code refactoring.
Diffstat (limited to 'core/qmpmidiread.cpp')
-rw-r--r--core/qmpmidiread.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/qmpmidiread.cpp b/core/qmpmidiread.cpp
index 58a9786..a8bdabb 100644
--- a/core/qmpmidiread.cpp
+++ b/core/qmpmidiread.cpp
@@ -209,7 +209,7 @@ int CMidiFile::chunkReader(int hdrXp)
char hdr[6];
if(!fgets(hdr,5,f))error(1,"E: Unexpected EOF.");
if(hdrXp)
- if(strncmp(hdr,"MThd",4)){error(1,"E: Wrong MIDI header.");throw;}
+ if(strncmp(hdr,"MThd",4)){error(1,"E: Wrong MIDI header.");throw 1;}
else return headerChunkReader(),0;
else
if(strncmp(hdr,"MTrk",4))
@@ -243,7 +243,7 @@ CMidiFile::CMidiFile(const char* fn,CMidiPlayer* par)
std::sort(eventList.begin(),eventList.end(),cmp);
par->maxtk=eventList[eventList.size()-1]->time;
}
- catch(int){fprintf(stderr,"E: %s is not a supported file.\n",fn);valid=0;}
+ catch(int&){fprintf(stderr,"E: %s is not a supported file.\n",fn);valid=0;}
}
CMidiFile::~CMidiFile()
{