Ticket #3740: ape_reader.gcc4.patch
File ape_reader.gcc4.patch, 7.5 KB (added by , 16 years ago) |
---|
-
MAClib/CircleBuffer.h
17 17 int MaxGet(); 18 18 19 19 // direct writing 20 inline unsigned char * CCircleBuffer::GetDirectWritePointer()20 inline unsigned char * GetDirectWritePointer() 21 21 { 22 22 // return a pointer to the tail -- note that it will always be safe to write 23 23 // at least m_nMaxDirectWriteBytes since we use an end cap region 24 24 return &m_pBuffer[m_nTail]; 25 25 } 26 26 27 inline void CCircleBuffer::UpdateAfterDirectWrite(int nBytes)27 inline void UpdateAfterDirectWrite(int nBytes) 28 28 { 29 29 // update the tail 30 30 m_nTail += nBytes; -
MAClib/APETag.cpp
5 5 #include "IO.h" 6 6 #include IO_HEADER_FILE 7 7 8 #include <algorithm> 9 8 10 /***************************************************************************************** 9 11 CAPETagField 10 12 *****************************************************************************************/ … … 16 18 memcpy(m_spFieldNameUTF16, pFieldName, (wcslen(pFieldName) + 1) * sizeof(str_utf16)); 17 19 18 20 // data (we'll always allocate two extra bytes and memset to 0 so we're safely NULL terminated) 19 m_nFieldValueBytes = max(nFieldBytes, 0);21 m_nFieldValueBytes = std::max(nFieldBytes, 0); 20 22 m_spFieldValue.Assign(new char [m_nFieldValueBytes + 2], TRUE); 21 23 memset(m_spFieldValue, 0, m_nFieldValueBytes + 2); 22 24 if (m_nFieldValueBytes > 0) -
MAClib/UnBitArray.cpp
3 3 #include "UnBitArray.h" 4 4 #include "BitArray.h" 5 5 6 #include <algorithm> 7 6 8 const uint32 POWERS_OF_TWO_MINUS_ONE_REVERSED[33] = {4294967295,2147483647,1073741823,536870911,268435455,134217727,67108863,33554431,16777215,8388607,4194303,2097151,1048575,524287,262143,131071,65535,32767,16383,8191,4095,2047,1023,511,255,127,63,31,15,7,3,1,0}; 7 9 8 10 const uint32 K_SUM_MIN_BOUNDARY[32] = {0,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,2147483648,0,0,0,0}; … … 108 110 if (m_nVersion >= 3990) 109 111 { 110 112 // figure the pivot value 111 int nPivotValue = max(BitArrayState.nKSum / 32, 1);113 int nPivotValue = std::max(BitArrayState.nKSum / 32, 1UL); 112 114 113 115 // get the overflow 114 116 int nOverflow = 0; -
MAClib/SmartPtr.h
86 86 87 87 #ifdef _MSC_VER 88 88 #pragma warning(pop) 89 #endif _MSC_VER89 #endif //_MSC_VER 90 90 91 91 #endif // #ifndef APE_SMARTPTR_H -
MAClib/APESimple.cpp
9 9 #include "MD5.h" 10 10 #include "CharacterHelper.h" 11 11 12 #include <algorithm> 13 12 14 #define UNMAC_DECODER_OUTPUT_NONE 0 13 15 #define UNMAC_DECODER_OUTPUT_WAV 1 14 16 #define UNMAC_DECODER_OUTPUT_APE 2 … … 204 206 nBytesRead = 1; 205 207 while ((nBytesLeft > 0) && (nBytesRead > 0)) 206 208 { 207 int nBytesToRead = min(16384, nBytesLeft);209 int nBytesToRead = std::min(16384, nBytesLeft); 208 210 if (pIO->Read(spBuffer, nBytesToRead, &nBytesRead) != ERROR_SUCCESS) 209 211 throw(ERROR_IO_READ); 210 212 -
MAClib/APEDecompress.cpp
1 1 #include "All.h" 2 2 #include "APEDecompress.h" 3 3 4 #include <algorithm> 5 4 6 #include "APEInfo.h" 5 7 #include "Prepare.h" 6 8 #include "UnBitArray.h" … … 35 37 m_bErrorDecodingCurrentFrame = FALSE; 36 38 37 39 // set the "real" start and finish blocks 38 m_nStartBlock = (nStartBlock < 0) ? 0 : min(nStartBlock, GetInfo(APE_INFO_TOTAL_BLOCKS));39 m_nFinishBlock = (nFinishBlock < 0) ? GetInfo(APE_INFO_TOTAL_BLOCKS) : min(nFinishBlock, GetInfo(APE_INFO_TOTAL_BLOCKS));40 m_nStartBlock = (nStartBlock < 0) ? 0 : std::min(nStartBlock, GetInfo(APE_INFO_TOTAL_BLOCKS)); 41 m_nFinishBlock = (nFinishBlock < 0) ? GetInfo(APE_INFO_TOTAL_BLOCKS) : std::min(nFinishBlock, GetInfo(APE_INFO_TOTAL_BLOCKS)); 40 42 m_bIsRanged = (m_nStartBlock != 0) || (m_nFinishBlock != GetInfo(APE_INFO_TOTAL_BLOCKS)); 41 43 } 42 44 … … 85 87 86 88 // cap 87 89 int nBlocksUntilFinish = m_nFinishBlock - m_nCurrentBlock; 88 const int nBlocksToRetrieve = min(nBlocks, nBlocksUntilFinish);90 const int nBlocksToRetrieve = std::min(nBlocks, nBlocksUntilFinish); 89 91 90 92 // get the data 91 93 unsigned char * pOutputBuffer = (unsigned char *) pBuffer; … … 99 101 100 102 // analyze how much to remove from the buffer 101 103 const int nFrameBufferBlocks = m_nFrameBufferFinishedBlocks; 102 nBlocksThisPass = min(nBlocksLeft, nFrameBufferBlocks);104 nBlocksThisPass = std::min(nBlocksLeft, nFrameBufferBlocks); 103 105 104 106 // remove as much as possible 105 107 if (nBlocksThisPass > 0) … … 182 184 183 185 int nFrameOffsetBlocks = m_nCurrentFrameBufferBlock % GetInfo(APE_INFO_BLOCKS_PER_FRAME); 184 186 int nFrameBlocksLeft = nFrameBlocks - nFrameOffsetBlocks; 185 int nBlocksThisPass = min(nFrameBlocksLeft, nBlocksLeft);187 int nBlocksThisPass = std::min(nFrameBlocksLeft, nBlocksLeft); 186 188 187 189 // start the frame if we need to 188 190 if (nFrameOffsetBlocks == 0) -
LibMonkeysAudio/LibMonkeysAudio.cpp
1 #include <string> 2 1 3 #include <InterfaceDefs.h> 2 4 5 #include "LibMonkeysAudio.h" 6 7 3 8 /*============================================================================*/ 4 9 const char* gAppName = "Lib Monkey's Audio"; 5 10 const char* gAppVer = "Ver 1.65"; … … 8 13 const char* gAppSignature = "application/x-vnd.SHINTA-LibMonkeysAudio"; 9 14 /*============================================================================*/ 10 15 11 /*=== Memo =====================================================================12 ==============================================================================*/13 16 14 //------------------------------------------------------------------------------15 #include "LibMonkeysAudio.h"16 //------------------------------------------------------------------------------17 // BeOS18 // C++19 #include <string>20 // Add221 17 //=========================================================================== 22 18 CAPETag* create_capetag_1(CIO* oIO, BOOL oAnalyze) 23 19 { … … 41 37 //------------------------------------------------------------------------------ 42 38 const char* lib_monkeys_audio_copyright() 43 39 { 44 static st ring saCright;40 static std::string saCright; 45 41 46 saCright = st ring(gCright)+"\n"+gOriginal;42 saCright = std::string(gCright)+"\n"+gOriginal; 47 43 return saCright.c_str(); 48 44 } 49 45 //------------------------------------------------------------------------------