Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76e856ba authored by Andy Hung's avatar Andy Hung Committed by Gerrit Code Review
Browse files

Merge "libeffects: use memmove in Copy_Float"

parents 64300802 fc274d44
Loading
Loading
Loading
Loading
+2 −19
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
/**********************************************************************************
   INCLUDE FILES
***********************************************************************************/

#include <string.h>
#include "VectorArithmetic.h"

/**********************************************************************************
@@ -47,24 +47,7 @@ void Copy_16(const LVM_INT16* src, LVM_INT16* dst, LVM_INT16 n) {
    return;
}
void Copy_Float(const LVM_FLOAT* src, LVM_FLOAT* dst, LVM_INT16 n) {
    LVM_INT16 ii;

    if (src > dst) {
        for (ii = n; ii != 0; ii--) {
            *dst = *src;
            dst++;
            src++;
        }
    } else {
        src += n - 1;
        dst += n - 1;
        for (ii = n; ii != 0; ii--) {
            *dst = *src;
            dst--;
            src--;
        }
    }

    memmove(dst, src, n * sizeof(LVM_FLOAT));
    return;
}
// Extract out the stereo channel pair from multichannel source.