Ticket #3740: ape_reader.gcc4.patch

File ape_reader.gcc4.patch, 7.5 KB (added by pulkomandy, 11 years ago)

Patch for gcc4 build

  • MAClib/CircleBuffer.h

     
    1717    int MaxGet();
    1818
    1919    // direct writing
    20     inline unsigned char * CCircleBuffer::GetDirectWritePointer()
     20    inline unsigned char * GetDirectWritePointer()
    2121    {
    2222        // return a pointer to the tail -- note that it will always be safe to write
    2323        // at least m_nMaxDirectWriteBytes since we use an end cap region
    2424        return &m_pBuffer[m_nTail];
    2525    }
    2626
    27     inline void CCircleBuffer::UpdateAfterDirectWrite(int nBytes)
     27    inline void UpdateAfterDirectWrite(int nBytes)
    2828    {
    2929        // update the tail
    3030        m_nTail += nBytes;
  • MAClib/APETag.cpp

     
    55#include "IO.h"
    66#include IO_HEADER_FILE
    77
     8#include <algorithm>
     9
    810/*****************************************************************************************
    911CAPETagField
    1012*****************************************************************************************/
     
    1618    memcpy(m_spFieldNameUTF16, pFieldName, (wcslen(pFieldName) + 1) * sizeof(str_utf16));
    1719   
    1820    // 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);
    2022    m_spFieldValue.Assign(new char [m_nFieldValueBytes + 2], TRUE);
    2123    memset(m_spFieldValue, 0, m_nFieldValueBytes + 2);
    2224    if (m_nFieldValueBytes > 0)
  • MAClib/UnBitArray.cpp

     
    33#include "UnBitArray.h"
    44#include "BitArray.h"
    55
     6#include <algorithm>
     7
    68const 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};
    79
    810const 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};
     
    108110    if (m_nVersion >= 3990)
    109111    {
    110112        // figure the pivot value
    111         int nPivotValue = max(BitArrayState.nKSum / 32, 1);
     113        int nPivotValue = std::max(BitArrayState.nKSum / 32, 1UL);
    112114       
    113115        // get the overflow
    114116        int nOverflow = 0;
  • MAClib/SmartPtr.h

     
    8686
    8787#ifdef _MSC_VER
    8888    #pragma warning(pop)
    89 #endif _MSC_VER
     89#endif //_MSC_VER
    9090
    9191#endif // #ifndef APE_SMARTPTR_H
  • MAClib/APESimple.cpp

     
    99#include "MD5.h"
    1010#include "CharacterHelper.h"
    1111
     12#include <algorithm>
     13
    1214#define UNMAC_DECODER_OUTPUT_NONE       0
    1315#define UNMAC_DECODER_OUTPUT_WAV        1
    1416#define UNMAC_DECODER_OUTPUT_APE        2
     
    204206            nBytesRead = 1;
    205207            while ((nBytesLeft > 0) && (nBytesRead > 0))
    206208            {
    207                 int nBytesToRead = min(16384, nBytesLeft);
     209                int nBytesToRead = std::min(16384, nBytesLeft);
    208210                if (pIO->Read(spBuffer, nBytesToRead, &nBytesRead) != ERROR_SUCCESS)
    209211                    throw(ERROR_IO_READ);
    210212
  • MAClib/APEDecompress.cpp

     
    11#include "All.h"
    22#include "APEDecompress.h"
    33
     4#include <algorithm>
     5
    46#include "APEInfo.h"
    57#include "Prepare.h"
    68#include "UnBitArray.h"
     
    3537    m_bErrorDecodingCurrentFrame = FALSE;
    3638
    3739    // 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));
    4042    m_bIsRanged = (m_nStartBlock != 0) || (m_nFinishBlock != GetInfo(APE_INFO_TOTAL_BLOCKS));
    4143}
    4244
     
    8587
    8688    // cap
    8789    int nBlocksUntilFinish = m_nFinishBlock - m_nCurrentBlock;
    88     const int nBlocksToRetrieve = min(nBlocks, nBlocksUntilFinish);
     90    const int nBlocksToRetrieve = std::min(nBlocks, nBlocksUntilFinish);
    8991   
    9092    // get the data
    9193    unsigned char * pOutputBuffer = (unsigned char *) pBuffer;
     
    99101
    100102        // analyze how much to remove from the buffer
    101103        const int nFrameBufferBlocks = m_nFrameBufferFinishedBlocks;
    102         nBlocksThisPass = min(nBlocksLeft, nFrameBufferBlocks);
     104        nBlocksThisPass = std::min(nBlocksLeft, nFrameBufferBlocks);
    103105
    104106        // remove as much as possible
    105107        if (nBlocksThisPass > 0)
     
    182184
    183185        int nFrameOffsetBlocks = m_nCurrentFrameBufferBlock % GetInfo(APE_INFO_BLOCKS_PER_FRAME);
    184186        int nFrameBlocksLeft = nFrameBlocks - nFrameOffsetBlocks;
    185         int nBlocksThisPass = min(nFrameBlocksLeft, nBlocksLeft);
     187        int nBlocksThisPass = std::min(nFrameBlocksLeft, nBlocksLeft);
    186188
    187189        // start the frame if we need to
    188190        if (nFrameOffsetBlocks == 0)
  • LibMonkeysAudio/LibMonkeysAudio.cpp

     
     1#include <string>
     2
    13#include <InterfaceDefs.h>
    24
     5#include "LibMonkeysAudio.h"
     6
     7
    38/*============================================================================*/
    49const char* gAppName = "Lib Monkey's Audio";
    510const char* gAppVer = "Ver 1.65";
     
    813const char* gAppSignature = "application/x-vnd.SHINTA-LibMonkeysAudio";
    914/*============================================================================*/
    1015
    11 /*=== Memo =====================================================================
    12 ==============================================================================*/
    1316
    14 //------------------------------------------------------------------------------
    15 #include "LibMonkeysAudio.h"
    16 //------------------------------------------------------------------------------
    17 // BeOS
    18 // C++
    19 #include <string>
    20 // Add2
    2117//===========================================================================
    2218CAPETag*    create_capetag_1(CIO* oIO, BOOL oAnalyze)
    2319{
     
    4137//------------------------------------------------------------------------------
    4238const char* lib_monkeys_audio_copyright()
    4339{
    44     static string   saCright;
     40    static std::string  saCright;
    4541
    46     saCright = string(gCright)+"\n"+gOriginal;
     42    saCright = std::string(gCright)+"\n"+gOriginal;
    4743    return saCright.c_str();
    4844}
    4945//------------------------------------------------------------------------------