From: <sag...@us...> - 2013-09-29 00:30:32
|
Revision: 2798 http://sourceforge.net/p/modplug/code/2798 Author: saga-games Date: 2013-09-29 00:30:26 +0000 (Sun, 29 Sep 2013) Log Message: ----------- [Ref] Small cleanups Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_flt.cpp trunk/OpenMPT/unarchiver/ungzip.cpp trunk/OpenMPT/unarchiver/unlha.cpp trunk/OpenMPT/unarchiver/unlha.h Modified: trunk/OpenMPT/soundlib/Snd_flt.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_flt.cpp 2013-09-29 00:29:55 UTC (rev 2797) +++ trunk/OpenMPT/soundlib/Snd_flt.cpp 2013-09-29 00:30:26 UTC (rev 2798) @@ -48,9 +48,9 @@ if(!GetModFlag(MSF_OLDVOLSWING)) { - pChn->nCutOff = (BYTE)cutoff; + pChn->nCutOff = (uint8)cutoff; pChn->nCutSwing = 0; - pChn->nResonance = (BYTE)resonance; + pChn->nResonance = (uint8)resonance; pChn->nResSwing = 0; } @@ -62,7 +62,7 @@ // Filtering is only ever done in IT if either cutoff is not full or if resonance is set. if(IsCompatibleMode(TRK_IMPULSETRACKER) && resonance == 0 && computedCutoff >= 254) { - if(pChn->rowCommand.IsNote() && !(pChn->dwFlags & CHN_PORTAMENTO) && !pChn->nMasterChn && m_SongFlags[SONG_FIRSTTICK]) + if(pChn->rowCommand.IsNote() && !pChn->dwFlags[CHN_PORTAMENTO] && !pChn->nMasterChn && m_SongFlags[SONG_FIRSTTICK]) { // Z7F next to a note disables the filter, however in other cases this should not happen. // Test cases: filter-reset.it, filter-reset-carry.it, filter-nna.it Modified: trunk/OpenMPT/unarchiver/ungzip.cpp =================================================================== --- trunk/OpenMPT/unarchiver/ungzip.cpp 2013-09-29 00:29:55 UTC (rev 2797) +++ trunk/OpenMPT/unarchiver/ungzip.cpp 2013-09-29 00:30:26 UTC (rev 2798) @@ -33,13 +33,13 @@ bool CGzipArchive::IsArchive() const //---------------------------------- { - if(inFile.GetLength() <= (sizeof(GZheader) + sizeof(GZtrailer))) + // Check header data + file size + if(header.magic1 != GZ_HMAGIC1 || header.magic2 != GZ_HMAGIC2 || header.method != GZ_HMDEFLATE || (header.flags & GZ_FRESERVED) != 0 + || inFile.GetLength() <= sizeof(GZheader) + sizeof(GZtrailer)) { return false; } - - // Check header data - return (header.magic1 == GZ_HMAGIC1 && header.magic2 == GZ_HMAGIC2 && header.method == GZ_HMDEFLATE && (header.flags & GZ_FRESERVED) == 0); + return true; } Modified: trunk/OpenMPT/unarchiver/unlha.cpp =================================================================== --- trunk/OpenMPT/unarchiver/unlha.cpp 2013-09-29 00:29:55 UTC (rev 2797) +++ trunk/OpenMPT/unarchiver/unlha.cpp 2013-09-29 00:30:26 UTC (rev 2798) @@ -1,8 +1,14 @@ +/* + * unlha.cpp + * --------- + * Purpose: Implementation file for extracting modules from .lha archives, making use of lhasa + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ #include "stdafx.h" - #include "unlha.h" - #include "lhasa.h" @@ -28,19 +34,21 @@ return 0; } -static void LHAcloseFileReader(void * /*handle*/ ) +static void LHAcloseFileReader(void * /*handle*/) { - //FileReader *f = reinterpret_cast<FileReader*>(handle); } -static LHAInputStreamType vtable = { +static LHAInputStreamType vtable = +{ LHAreadFileReader, LHAskipFileReader, LHAcloseFileReader }; -static inline std::string get_extension( std::string filename ) { - if ( filename.find_last_of( "." ) != std::string::npos ) { +static inline std::string get_extension( std::string filename ) +{ + if ( filename.find_last_of( "." ) != std::string::npos ) + { return filename.substr( filename.find_last_of( "." ) + 1 ); } return ""; Modified: trunk/OpenMPT/unarchiver/unlha.h =================================================================== --- trunk/OpenMPT/unarchiver/unlha.h 2013-09-29 00:29:55 UTC (rev 2797) +++ trunk/OpenMPT/unarchiver/unlha.h 2013-09-29 00:30:26 UTC (rev 2798) @@ -1,6 +1,13 @@ +/* + * unlha.h + * ------- + * Purpose: Header file for .lha loader + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ -#ifndef UNLHA32_LIB_H -#define UNLHA32_LIB_H +#pragma once #include "../soundlib/FileReader.h" @@ -27,5 +34,3 @@ bool ExtractFile(); bool ExtractFile(const std::vector<const char *> &extensions); }; - -#endif // UNLHA32_LIB_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |