Skip to content
Snippets Groups Projects
Commit 6c6e2123 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

bcopy(src, dst) -> memcpy(dst, src)

bcopy is deprecated
memcpy is also more performant since it doesn't have to handle overlap
parent 617597d3
Branches
No related tags found
No related merge requests found
......@@ -65,8 +65,7 @@ AudioLoop::getNext (SFLDataFormat* output, int nb, short volume)
block = _size-pos;
}
// src, dest, len
bcopy (_buffer+pos, output, block*sizeof (SFLDataFormat)); // short>char conversion
memcpy(output, _buffer+pos, block*sizeof (SFLDataFormat)); // short>char conversion
if (volume!=100) {
for (int i=0; i<block; i++) {
......
......@@ -250,7 +250,7 @@ int EchoCancel::process (SFLDataFormat *inputData, SFLDataFormat *outputData, in
_delayDetector.process (inputData, nbBytes);
if (_spkrStoped) {
bcopy (inputData, outputData, nbBytes);
memcpy(outputData, inputData, nbBytes);
return nbBytes;
}
......@@ -299,7 +299,7 @@ int EchoCancel::process (SFLDataFormat *inputData, SFLDataFormat *outputData, in
// echoFile->write((const char *)_tmpOut, byteSize);
bcopy (_tmpOut, outputData+ (nbFrame*_smplPerFrame), byteSize);
memcpy(outputData+ (nbFrame*_smplPerFrame), _tmpOut, byteSize);
// used to sync with speaker
_processedByte += byteSize;
......@@ -314,7 +314,7 @@ int EchoCancel::process (SFLDataFormat *inputData, SFLDataFormat *outputData, in
performEchoCancelNoSpkr (_tmpMic, _tmpOut);
bcopy (_tmpOut, outputData+ (nbFrame*_smplPerFrame), byteSize);
memcpy (outputData+ (nbFrame*_smplPerFrame), _tmpOut, byteSize);
++nbFrame;
}
......
......@@ -257,7 +257,7 @@ RingBuffer::Put (void* buffer, int toCopy)
block = mBufferSize - pos;
}
bcopy (src, mBuffer + pos, block);
memcpy (mBuffer + pos, src, block);
src += block;
......@@ -322,7 +322,7 @@ RingBuffer::Get (void *buffer, int toCopy, std::string call_id)
block = mBufferSize - mStart;
}
bcopy (mBuffer + mStart, dest, block);
memcpy (dest, mBuffer + mStart, block);
dest += block;
......
......@@ -130,8 +130,7 @@ Tone::genBuffer (const std::string& definition)
_buffer = new SFLDataFormat[_size];
// src, dest, tocopy
bcopy (buffer, _buffer, _size*sizeof (SFLDataFormat)); // copy char, not SFLDataFormat.
memcpy (_buffer, buffer, _size*sizeof (SFLDataFormat)); // copy char, not SFLDataFormat.
delete[] buffer;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment