Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 593890
Collapse All | Expand All

(-)mac-3.99-u4-b5-s7/src/Shared/NoWindows.h.old (-2 / +2 lines)
Lines 39-46 Link Here
39
typedef const wchar_t *     LPCWSTR;
39
typedef const wchar_t *     LPCWSTR;
40
40
41
#define ZeroMemory(POINTER, BYTES) memset(POINTER, 0, BYTES);
41
#define ZeroMemory(POINTER, BYTES) memset(POINTER, 0, BYTES);
42
#define max(a,b)    (((a) > (b)) ? (a) : (b))
42
#define max_macro(a,b)    (((a) > (b)) ? (a) : (b))
43
#define min(a,b)    (((a) < (b)) ? (a) : (b))
43
#define min_macro(a,b)    (((a) < (b)) ? (a) : (b))
44
44
45
#define __stdcall
45
#define __stdcall
46
#define CALLBACK
46
#define CALLBACK
(-)mac-3.99-u4-b5-s7/src/Shared/CircleBuffer.cpp.old (-3 / +3 lines)
Lines 45-51 Link Here
45
45
46
    if (pBuffer != NULL && nBytes > 0)
46
    if (pBuffer != NULL && nBytes > 0)
47
    {
47
    {
48
        int nHeadBytes = min(m_nEndCap - m_nHead, nBytes);
48
        int nHeadBytes = min_macro(m_nEndCap - m_nHead, nBytes);
49
        int nFrontBytes = nBytes - nHeadBytes;
49
        int nFrontBytes = nBytes - nHeadBytes;
50
50
51
        memcpy(&pBuffer[0], &m_pBuffer[m_nHead], nHeadBytes);
51
        memcpy(&pBuffer[0], &m_pBuffer[m_nHead], nHeadBytes);
Lines 72-78 Link Here
72
72
73
int CCircleBuffer::RemoveHead(int nBytes)
73
int CCircleBuffer::RemoveHead(int nBytes)
74
{
74
{
75
    nBytes = min(MaxGet(), nBytes);
75
    nBytes = min_macro(MaxGet(), nBytes);
76
    m_nHead += nBytes;
76
    m_nHead += nBytes;
77
    if (m_nHead >= m_nEndCap)
77
    if (m_nHead >= m_nEndCap)
78
        m_nHead -= m_nEndCap;
78
        m_nHead -= m_nEndCap;
Lines 81-87 Link Here
81
81
82
int CCircleBuffer::RemoveTail(int nBytes)
82
int CCircleBuffer::RemoveTail(int nBytes)
83
{
83
{
84
    nBytes = min(MaxGet(), nBytes);
84
    nBytes = min_macro(MaxGet(), nBytes);
85
    m_nTail -= nBytes;
85
    m_nTail -= nBytes;
86
    if (m_nTail < 0)
86
    if (m_nTail < 0)
87
        m_nTail += m_nEndCap;
87
        m_nTail += m_nEndCap;
(-)mac-3.99-u4-b5-s7/src/MACLib/APECompress.cpp.old (-2 / +2 lines)
Lines 117-123 Link Here
117
            return ERROR_UNDEFINED;
117
            return ERROR_UNDEFINED;
118
        
118
        
119
        // calculate how many bytes to copy and add that much to the buffer
119
        // calculate how many bytes to copy and add that much to the buffer
120
        int nBytesToProcess = min(nBytesAvailable, nBytes - nBytesDone);
120
        int nBytesToProcess = min_macro(nBytesAvailable, nBytes - nBytesDone);
121
        memcpy(pBuffer, &pData[nBytesDone], nBytesToProcess);
121
        memcpy(pBuffer, &pData[nBytesDone], nBytesToProcess);
122
                        
122
                        
123
        // unlock the buffer (fail if not successful)
123
        // unlock the buffer (fail if not successful)
Lines 162-168 Link Here
162
        
162
        
163
        while ((m_nBufferTail - m_nBufferHead) >= nThreshold)
163
        while ((m_nBufferTail - m_nBufferHead) >= nThreshold)
164
        {
164
        {
165
            int nFrameBytes = min(m_spAPECompressCreate->GetFullFrameBytes(), m_nBufferTail - m_nBufferHead);
165
            int nFrameBytes = min_macro(m_spAPECompressCreate->GetFullFrameBytes(), m_nBufferTail - m_nBufferHead);
166
            
166
            
167
            if (nFrameBytes == 0)
167
            if (nFrameBytes == 0)
168
                break;
168
                break;
(-)mac-3.99-u4-b5-s7/src/MACLib/APEDecompress.cpp.old (-5 / +5 lines)
Lines 35-42 Link Here
35
    m_bErrorDecodingCurrentFrame = FALSE;
35
    m_bErrorDecodingCurrentFrame = FALSE;
36
36
37
    // set the "real" start and finish blocks
37
    // set the "real" start and finish blocks
38
    m_nStartBlock = (nStartBlock < 0) ? 0 : min(nStartBlock, GetInfo(APE_INFO_TOTAL_BLOCKS));
38
    m_nStartBlock = (nStartBlock < 0) ? 0 : min_macro(nStartBlock, GetInfo(APE_INFO_TOTAL_BLOCKS));
39
    m_nFinishBlock = (nFinishBlock < 0) ? GetInfo(APE_INFO_TOTAL_BLOCKS) : min(nFinishBlock, GetInfo(APE_INFO_TOTAL_BLOCKS));
39
    m_nFinishBlock = (nFinishBlock < 0) ? GetInfo(APE_INFO_TOTAL_BLOCKS) : min_macro(nFinishBlock, GetInfo(APE_INFO_TOTAL_BLOCKS));
40
    m_bIsRanged = (m_nStartBlock != 0) || (m_nFinishBlock != GetInfo(APE_INFO_TOTAL_BLOCKS));
40
    m_bIsRanged = (m_nStartBlock != 0) || (m_nFinishBlock != GetInfo(APE_INFO_TOTAL_BLOCKS));
41
}
41
}
42
42
Lines 85-91 Link Here
85
85
86
    // cap
86
    // cap
87
    int nBlocksUntilFinish = m_nFinishBlock - m_nCurrentBlock;
87
    int nBlocksUntilFinish = m_nFinishBlock - m_nCurrentBlock;
88
    const int nBlocksToRetrieve = min(nBlocks, nBlocksUntilFinish);
88
    const int nBlocksToRetrieve = min_macro(nBlocks, nBlocksUntilFinish);
89
    
89
    
90
    // get the data
90
    // get the data
91
    unsigned char * pOutputBuffer = (unsigned char *) pBuffer;
91
    unsigned char * pOutputBuffer = (unsigned char *) pBuffer;
Lines 99-105 Link Here
99
99
100
        // analyze how much to remove from the buffer
100
        // analyze how much to remove from the buffer
101
        const int nFrameBufferBlocks = m_nFrameBufferFinishedBlocks;
101
        const int nFrameBufferBlocks = m_nFrameBufferFinishedBlocks;
102
        nBlocksThisPass = min(nBlocksLeft, nFrameBufferBlocks);
102
        nBlocksThisPass = min_macro(nBlocksLeft, nFrameBufferBlocks);
103
103
104
        // remove as much as possible
104
        // remove as much as possible
105
        if (nBlocksThisPass > 0)
105
        if (nBlocksThisPass > 0)
Lines 182-188 Link Here
182
182
183
        int nFrameOffsetBlocks = m_nCurrentFrameBufferBlock % GetInfo(APE_INFO_BLOCKS_PER_FRAME);
183
        int nFrameOffsetBlocks = m_nCurrentFrameBufferBlock % GetInfo(APE_INFO_BLOCKS_PER_FRAME);
184
        int nFrameBlocksLeft = nFrameBlocks - nFrameOffsetBlocks;
184
        int nFrameBlocksLeft = nFrameBlocks - nFrameOffsetBlocks;
185
        int nBlocksThisPass = min(nFrameBlocksLeft, nBlocksLeft);
185
        int nBlocksThisPass = min_macro(nFrameBlocksLeft, nBlocksLeft);
186
186
187
        // start the frame if we need to
187
        // start the frame if we need to
188
        if (nFrameOffsetBlocks == 0)
188
        if (nFrameOffsetBlocks == 0)
(-)mac-3.99-u4-b5-s7/src/MACLib/APESimple.cpp.old (-1 / +1 lines)
Lines 193-199 Link Here
193
    nBytesRead = 1;
193
    nBytesRead = 1;
194
    while ((nBytesLeft > 0) && (nBytesRead > 0))
194
    while ((nBytesLeft > 0) && (nBytesRead > 0))
195
    {
195
    {
196
        int nBytesToRead = min(16384, nBytesLeft);
196
        int nBytesToRead = min_macro(16384, nBytesLeft);
197
        if (pIO->Read(spBuffer, nBytesToRead, &nBytesRead) != ERROR_SUCCESS)
197
        if (pIO->Read(spBuffer, nBytesToRead, &nBytesRead) != ERROR_SUCCESS)
198
            return ERROR_IO_READ;
198
            return ERROR_IO_READ;
199
199
(-)mac-3.99-u4-b5-s7/src/MACLib/APETag.cpp.old (-1 / +1 lines)
Lines 16-22 Link Here
16
    memcpy(m_spFieldNameUTF16, pFieldName, (wcslen(pFieldName) + 1) * sizeof(str_utf16));
16
    memcpy(m_spFieldNameUTF16, pFieldName, (wcslen(pFieldName) + 1) * sizeof(str_utf16));
17
    
17
    
18
    // data (we'll always allocate two extra bytes and memset to 0 so we're safely NULL terminated)
18
    // data (we'll always allocate two extra bytes and memset to 0 so we're safely NULL terminated)
19
    m_nFieldValueBytes = max(nFieldBytes, 0);
19
    m_nFieldValueBytes = max_macro(nFieldBytes, 0);
20
    m_spFieldValue.Assign(new char [m_nFieldValueBytes + 2], TRUE);
20
    m_spFieldValue.Assign(new char [m_nFieldValueBytes + 2], TRUE);
21
    memset(m_spFieldValue, 0, m_nFieldValueBytes + 2);
21
    memset(m_spFieldValue, 0, m_nFieldValueBytes + 2);
22
    if (m_nFieldValueBytes > 0)
22
    if (m_nFieldValueBytes > 0)
(-)mac-3.99-u4-b5-s7/src/MACLib/BitArray.cpp.old (-2 / +2 lines)
Lines 113-119 Link Here
113
        m_nCurrentBitIndex = (m_nCurrentBitIndex & 31);
113
        m_nCurrentBitIndex = (m_nCurrentBitIndex & 31);
114
        
114
        
115
        // zero the rest of the memory (may not need the +1 because of frame byte alignment)
115
        // zero the rest of the memory (may not need the +1 because of frame byte alignment)
116
        memset(&m_pBitArray[1], 0, min(nBytesToWrite + 1, BIT_ARRAY_BYTES - 1));
116
        memset(&m_pBitArray[1], 0, min_macro(nBytesToWrite + 1, BIT_ARRAY_BYTES - 1));
117
    }
117
    }
118
    
118
    
119
    // return a success
119
    // return a success
Lines 247-253 Link Here
247
        BitArrayState.k++;
247
        BitArrayState.k++;
248
248
249
    // figure the pivot value
249
    // figure the pivot value
250
    int nPivotValue = max(nOriginalKSum / 32, 1);
250
    int nPivotValue = max_macro(nOriginalKSum / 32, 1);
251
    int nOverflow = nEncode / nPivotValue;
251
    int nOverflow = nEncode / nPivotValue;
252
    int nBase = nEncode - (nOverflow * nPivotValue);
252
    int nBase = nEncode - (nOverflow * nPivotValue);
253
253
(-)mac-3.99-u4-b5-s7/src/MACLib/MACProgressHelper.cpp.old (-1 / +1 lines)
Lines 35-41 Link Here
35
        m_nCurrentStep = nCurrentStep;
35
        m_nCurrentStep = nCurrentStep;
36
36
37
    // figure the percentage done
37
    // figure the percentage done
38
    float fPercentageDone = float(m_nCurrentStep) / float(max(m_nTotalSteps, 1));
38
    float fPercentageDone = float(m_nCurrentStep) / float(max_macro(m_nTotalSteps, 1));
39
    int nPercentageDone = (int) (fPercentageDone * 1000 * 100);
39
    int nPercentageDone = (int) (fPercentageDone * 1000 * 100);
40
    if (nPercentageDone > 100000) nPercentageDone = 100000;
40
    if (nPercentageDone > 100000) nPercentageDone = 100000;
41
41
(-)mac-3.99-u4-b5-s7/src/MACLib/Prepare.cpp.old (-2 / +2 lines)
Lines 177-185 Link Here
177
177
178
            if (LPeak == 0) { *pSpecialCodes |= SPECIAL_FRAME_LEFT_SILENCE; }
178
            if (LPeak == 0) { *pSpecialCodes |= SPECIAL_FRAME_LEFT_SILENCE; }
179
            if (RPeak == 0) { *pSpecialCodes |= SPECIAL_FRAME_RIGHT_SILENCE; }
179
            if (RPeak == 0) { *pSpecialCodes |= SPECIAL_FRAME_RIGHT_SILENCE; }
180
            if (max(LPeak, RPeak) > *pPeakLevel) 
180
            if (max_macro(LPeak, RPeak) > *pPeakLevel) 
181
            {
181
            {
182
                *pPeakLevel = max(LPeak, RPeak);
182
                *pPeakLevel = max_macro(LPeak, RPeak);
183
            }
183
            }
184
184
185
            // check for pseudo-stereo files
185
            // check for pseudo-stereo files
(-)mac-3.99-u4-b5-s7/src/MACLib/UnBitArray.cpp.old (-1 / +1 lines)
Lines 110-116 Link Here
110
    if (m_nVersion >= 3990)
110
    if (m_nVersion >= 3990)
111
    {
111
    {
112
        // figure the pivot value
112
        // figure the pivot value
113
        int nPivotValue = max(BitArrayState.nKSum / 32, 1);
113
        int nPivotValue = max_macro(BitArrayState.nKSum / 32, 1);
114
        
114
        
115
        // get the overflow
115
        // get the overflow
116
        int nOverflow = 0;
116
        int nOverflow = 0;

Return to bug 593890