Browse Source

Cleanup

tags/1.9.4
falkTX 11 years ago
parent
commit
7b0c8f9f5f
7 changed files with 45 additions and 40 deletions
  1. +17
    -14
      source/Makefile.mk
  2. +5
    -3
      source/backend/engine/CarlaEngine.cpp
  3. +16
    -16
      source/backend/engine/CarlaEngineInternal.cpp
  4. +2
    -2
      source/backend/engine/CarlaEngineInternal.hpp
  5. +1
    -1
      source/includes/CarlaDefines.h
  6. +3
    -3
      source/utils/CarlaMathUtils.hpp
  7. +1
    -1
      source/utils/CarlaThread.hpp

+ 17
- 14
source/Makefile.mk View File

@@ -41,30 +41,33 @@ endif
# --------------------------------------------------------------
# Common build and link flags

BASE_FLAGS = -Wall -Wextra -Wcast-qual -Wconversion -pipe -DREAL_BUILD
BASE_FLAGS = -Wall -Wextra -pipe -DREAL_BUILD
BASE_OPTS = -O3 -ffast-math -mtune=generic -msse -msse2 -mfpmath=sse -fdata-sections -ffunction-sections
LINK_OPTS = -fdata-sections -ffunction-sections -Wl,--gc-sections

ifeq ($(TESTBUILD),true)
# TODO: check which ones are valid on OSX
BASE_FLAGS += -Wcast-align -Wredundant-decls -Wshadow
BASE_FLAGS += -Wmissing-declarations -Wstrict-overflow -Wundef -Wwrite-strings -fstrict-overflow -Wsuggest-attribute=noreturn -Wunsafe-loop-optimizations
BASE_FLAGS += -Werror
BASE_FLAGS += -Werror -Wcast-align -Wcast-qual -Wconversion -Wredundant-decls -Wshadow -Wstrict-overflow -fstrict-overflow -Wundef -Wunsafe-loop-optimizations -Wwrite-strings
CFLAGS += -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes
CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual
ifeq ($(LINUX),true)
CFLAGS += -isystem /opt/kxstudio/include
CFLAGS += -Wstrict-prototypes -Wmissing-prototypes
CXXFLAGS += -isystem /opt/kxstudio/include
CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual
endif

# -Wcast-align -Wredundant-decls -Wshadow -Wstrict-prototypes -Wmissing-prototypes
# -Wmissing-declarations -Wstrict-overflow -Wundef -Wwrite-strings -fstrict-overflow -Wsuggest-attribute=noreturn -Wunsafe-loop-optimizations
# -Wnon-virtual-dtor -Woverloaded-virtual
# -Werror

# -Waggregate-return -Wsign-conversion
ifeq ($(MACOS),true)
CFLAGS += -isystem /opt/local/include/
CXXFLAGS += -isystem /opt/local/include/
endif
ifeq ($(WIN32),true)
CFLAGS += -isystem /opt/mingw32/include
CXXFLAGS += -isystem /opt/mingw32/include -isystem /opt/mingw32/include/qt4
endif
endif

ifneq ($(MACOS),true)
BASE_FLAGS += -Wlogical-op
ifeq ($(TESTBUILD),true)
BASE_FLAGS += -Wmissing-declarations -Wsign-conversion -Wsuggest-attribute=noreturn
endif
endif

ifneq ($(WIN32),true)


+ 5
- 3
source/backend/engine/CarlaEngine.cpp View File

@@ -1615,7 +1615,8 @@ bool CarlaEngine::patchbayConnect(const int portA, const int portB)
connectionToId.portOut = portA;
connectionToId.portIn = portB;

callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, rack->lastConnectionId, portA, portB, 0.0f, nullptr);
CARLA_SAFE_ASSERT(rack->lastConnectionId >= 0);
callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, static_cast<uint>(rack->lastConnectionId), portA, portB, 0.0f, nullptr);

rack->usedConnections.append(connectionToId);
rack->lastConnectionId++;
@@ -1693,7 +1694,8 @@ bool CarlaEngine::patchbayDisconnect(const int connectionId)
CARLA_SAFE_ASSERT_RETURN(false, false);
}

callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, connection.id, connection.portOut, connection.portIn, 0.0f, nullptr);
CARLA_SAFE_ASSERT(connection.id >= 0);
callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, static_cast<uint>(connection.id), connection.portOut, connection.portIn, 0.0f, nullptr);

rack->usedConnections.remove(it);
break;
@@ -1917,7 +1919,7 @@ void CarlaEngine::bufferSizeChanged(const uint32_t newBufferSize)
plugin->bufferSizeChanged(newBufferSize);
}

callback(ENGINE_CALLBACK_BUFFER_SIZE_CHANGED, 0, newBufferSize, 0, 0.0f, nullptr);
callback(ENGINE_CALLBACK_BUFFER_SIZE_CHANGED, 0, static_cast<int>(newBufferSize), 0, 0.0f, nullptr);
}

void CarlaEngine::sampleRateChanged(const double newSampleRate)


+ 16
- 16
source/backend/engine/CarlaEngineInternal.cpp View File

@@ -699,10 +699,10 @@ void CarlaEngineProtectedData::processRack(float* inBufReal[2], float* outBuf[2]

if (oldAudioInCount > 0)
{
FloatVectorOperations::findMinAndMax(inBuf0, frames, tmpMin, tmpMax);
FloatVectorOperations::findMinAndMax(inBuf0, static_cast<int>(frames), tmpMin, tmpMax);
pluginData.insPeak[0] = carla_max<float>(std::abs(tmpMin), std::abs(tmpMax), 1.0f);

FloatVectorOperations::findMinAndMax(inBuf1, frames, tmpMin, tmpMax);
FloatVectorOperations::findMinAndMax(inBuf1, static_cast<int>(frames), tmpMin, tmpMax);
pluginData.insPeak[1] = carla_max<float>(std::abs(tmpMin), std::abs(tmpMax), 1.0f);
}
else
@@ -713,10 +713,10 @@ void CarlaEngineProtectedData::processRack(float* inBufReal[2], float* outBuf[2]

if (plugin->getAudioOutCount() > 0)
{
FloatVectorOperations::findMinAndMax(outBuf[0], frames, tmpMin, tmpMax);
FloatVectorOperations::findMinAndMax(outBuf[0], static_cast<int>(frames), tmpMin, tmpMax);
pluginData.outsPeak[0] = carla_max<float>(std::abs(tmpMin), std::abs(tmpMax), 1.0f);

FloatVectorOperations::findMinAndMax(outBuf[1], frames, tmpMin, tmpMax);
FloatVectorOperations::findMinAndMax(outBuf[1], static_cast<int>(frames), tmpMin, tmpMax);
pluginData.outsPeak[1] = carla_max<float>(std::abs(tmpMin), std::abs(tmpMax), 1.0f);
}
else
@@ -786,10 +786,10 @@ void CarlaEngineProtectedData::processRackFull(float** const inBuf, const uint32
{
bool first = true;

for (LinkedList<uint>::Itenerator it = rack->connectedIns[0].begin(); it.valid(); it.next())
for (LinkedList<int>::Itenerator it = rack->connectedIns[0].begin(); it.valid(); it.next())
{
const uint& port(it.getValue());
CARLA_SAFE_ASSERT_CONTINUE(port < inCount);
const int& port(it.getValue());
CARLA_SAFE_ASSERT_CONTINUE(port >= 0 && port < static_cast<int>(inCount));

if (first)
{
@@ -814,10 +814,10 @@ void CarlaEngineProtectedData::processRackFull(float** const inBuf, const uint32
{
bool first = true;

for (LinkedList<uint>::Itenerator it = rack->connectedIns[1].begin(); it.valid(); it.next())
for (LinkedList<int>::Itenerator it = rack->connectedIns[1].begin(); it.valid(); it.next())
{
const uint& port(it.getValue());
CARLA_SAFE_ASSERT_CONTINUE(port < inCount);
const int& port(it.getValue());
CARLA_SAFE_ASSERT_CONTINUE(port >= 0 && port < static_cast<int>(inCount));

if (first)
{
@@ -843,10 +843,10 @@ void CarlaEngineProtectedData::processRackFull(float** const inBuf, const uint32
// connect output buffers
if (rack->connectedOuts[0].count() != 0)
{
for (LinkedList<uint>::Itenerator it = rack->connectedOuts[0].begin(); it.valid(); it.next())
for (LinkedList<int>::Itenerator it = rack->connectedOuts[0].begin(); it.valid(); it.next())
{
const uint& port(it.getValue());
CARLA_SAFE_ASSERT_CONTINUE(port < outCount);
const int& port(it.getValue());
CARLA_SAFE_ASSERT_CONTINUE(port >= 0 && port < static_cast<int>(outCount));

FLOAT_ADD(outBuf[port], rack->out[0], nframes);
}
@@ -854,10 +854,10 @@ void CarlaEngineProtectedData::processRackFull(float** const inBuf, const uint32

if (rack->connectedOuts[1].count() != 0)
{
for (LinkedList<uint>::Itenerator it = rack->connectedOuts[1].begin(); it.valid(); it.next())
for (LinkedList<int>::Itenerator it = rack->connectedOuts[1].begin(); it.valid(); it.next())
{
const uint& port(it.getValue());
CARLA_SAFE_ASSERT_CONTINUE(port < outCount);
const int& port(it.getValue());
CARLA_SAFE_ASSERT_CONTINUE(port >= 0 && port < static_cast<int>(outCount));

FLOAT_ADD(outBuf[port], rack->out[1], nframes);
}


+ 2
- 2
source/backend/engine/CarlaEngineInternal.hpp View File

@@ -85,8 +85,8 @@ struct EngineRackBuffers {
float* out[2];

// connections stuff
LinkedList<uint> connectedIns[2];
LinkedList<uint> connectedOuts[2];
LinkedList<int> connectedIns[2];
LinkedList<int> connectedOuts[2];
CarlaMutex connectLock;

int lastConnectionId;


+ 1
- 1
source/includes/CarlaDefines.h View File

@@ -91,7 +91,7 @@
# define P_INTPTR "%i"
# define P_UINTPTR "%x"
# define P_SIZE "%u"
#elif __WORDSIZE == 64
#elif defined(__WORDSIZE) && __WORDSIZE == 64
# define P_INT64 "%li"
# define P_INTPTR "%li"
# define P_UINTPTR "%lx"


+ 3
- 3
source/utils/CarlaMathUtils.hpp View File

@@ -31,9 +31,9 @@ using juce::FloatVectorOperations;
// Float operations

#ifdef HAVE_JUCE
# define FLOAT_ADD(bufDst, bufSrc, frames) FloatVectorOperations::add(bufDst, bufSrc, frames)
# define FLOAT_COPY(bufDst, bufSrc, frames) FloatVectorOperations::copy(bufDst, bufSrc, frames)
# define FLOAT_CLEAR(buf, frames) FloatVectorOperations::clear(buf, frames)
# define FLOAT_ADD(bufDst, bufSrc, frames) FloatVectorOperations::add(bufDst, bufSrc, static_cast<int>(frames))
# define FLOAT_COPY(bufDst, bufSrc, frames) FloatVectorOperations::copy(bufDst, bufSrc, static_cast<int>(frames))
# define FLOAT_CLEAR(buf, frames) FloatVectorOperations::clear(buf, static_cast<int>(frames))
#else
# define FLOAT_ADD(bufDst, bufSrc, frames) carla_addFloat(bufDst, bufSrc, frames)
# define FLOAT_COPY(bufDst, bufSrc, frames) carla_copyFloat(bufDst, bufSrc, frames)


+ 1
- 1
source/utils/CarlaThread.hpp View File

@@ -88,7 +88,7 @@ public:

if (pthread_create(&threadId, nullptr, _entryPoint, this) == 0)
{
#if (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012
#if defined(__GLIBC__) && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012
if (fName.isNotEmpty())
pthread_setname_np(threadId, fName.getBuffer());
#endif


Loading…
Cancel
Save