• Bug#266679: libsoundtouch1: st_assert (from ardour CVS) (3/4)

    From Robert Jordens@1:229/2 to All on Wed Aug 18 20:00:16 2004
    [continued from previous message]

    // Enables/disables the quick position seeking algorithm. Zero to disable, nonzero
    // to enable
    -void TDStretch::enableQuickSeek(const BOOL enable)
    +void TDStretch::enableQuickSeek(const bool enable)
    {
    bQuickseek = enable;
    }


    // Returns nonzero if the quick seeking algorithm is enabled.
    -BOOL TDStretch::isQuickSeekEnabled() const
    +bool TDStretch::isQuickSeekEnabled() const
    {
    return bQuickseek;
    }
    @@ -573,7 +572,7 @@
    void TDStretch::setChannels(const uint numChannels)
    {
    if (channels == numChannels) return;
    - assert(numChannels == 1 || numChannels == 2);
    + st_assert(numChannels == 1 || numChannels == 2);

    channels = numChannels;
    inputBuffer.setChannels(channels);
    @@ -585,7 +584,7 @@
    // to outputBuffer
    void TDStretch::processNominalTempo()
    {
    - assert(tempo == 1.0f);
    + st_assert(tempo == 1.0f);

    if (bMidBufferDirty) {
    // If there are samples in pMidBuffer waiting for overlapping,
    @@ -622,7 +621,7 @@
    return;
    }

    - if (bMidBufferDirty == FALSE) {
    + if (bMidBufferDirty == false) {
    // if midBuffer is empty, move the first samples of the input stream
    // into it
    if (inputBuffer.numSamples() < overlapLength) {
    @@ -631,7 +630,7 @@
    }
    memcpy(pMidBuffer, inputBuffer.ptrBegin(), channels * overlapLength * sizeof(Sample));
    inputBuffer.receiveSamples(overlapLength);
    - bMidBufferDirty = TRUE;
    + bMidBufferDirty = true;
    }

    // Process samples as long as there are enough samples in 'inputBuffer'
    @@ -655,9 +654,9 @@
    // Copies the end of the current sequence from 'inputBuffer' to
    // 'midBuffer' for being mixed with the beginning of the next
    // processing sequence and so on
    - assert(offset + seekWindowLength <= inputBuffer.numSamples());
    + st_assert(offset + seekWindowLength <= inputBuffer.numSamples());
    memcpy(pMidBuffer, inputBuffer.ptrBegin() + channels * (offset + seekWindowLength - overlapLength), channels * sizeof(Sample) * overlapLength);
    - bMidBufferDirty = TRUE;
    + bMidBufferDirty = true;

    // Remove the processed samples from the input buffer
    ovlSkip = (int)(tempo * (seekWindowLength - overlapLength) + 0.5f); --- orig/libs/soundtouch/mmx_gcc.cc
    +++ mod/libs/soundtouch/mmx_gcc.cc
    @@ -54,12 +54,12 @@

    // Flag variable indicating if MMX routines are disabled (for debugging)
    #if defined(__i386__) || !SAMPLES_ARE_SHORT
    -static BOOL _mmxDisabled = FALSE;
    +static bool _mmxDisabled = false;
    #endif

    // Forces the 'mmxDetect' function to report no MMX support, if called with
    // nonzero value in parameter 'disable'.
    -void mmxDisable(const BOOL disable)
    +void mmxDisable(const bool disable)
    {
    #if defined(__i386__)
    _mmxDisabled = disable;
    @@ -67,14 +67,14 @@
    }

    // Checks if the processor supports MMX. Returns '1' if it does, otherwise '0' -BOOL mmxDetect(void)
    +bool mmxDetect(void)
    {
    #if !defined(__i386__) || !SAMPLES_ARE_SHORT
    - return FALSE; // always disable MMX on non-x86 platforms.
    + return false; // always disable MMX on non-x86 platforms.
    #else
    int res;

    - if (_mmxDisabled) return FALSE;
    + if (_mmxDisabled) return false;

    asm(
    // check