From 8a0d671e1a77c58142d0cbe82f40ee64bcae2be5 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 15 Jan 2017 22:08:35 +0800 Subject: A little code refactoring. --- core/qmpmidiread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/qmpmidiread.cpp') 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() { -- cgit v1.2.3