Browse Source

Fix string-copy related compiler warnings

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.1-rc1
falkTX 4 years ago
parent
commit
a89dfbf49d
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
14 changed files with 46 additions and 42 deletions
  1. +3
    -1
      source/Makefile.mk
  2. +10
    -10
      source/backend/engine/CarlaEngineNative.cpp
  3. +2
    -2
      source/backend/engine/CarlaEnginePorts.cpp
  4. +1
    -1
      source/backend/plugin/CarlaPlugin.cpp
  5. +1
    -1
      source/backend/plugin/CarlaPluginBridge.cpp
  6. +5
    -5
      source/backend/plugin/CarlaPluginLADSPADSSI.cpp
  7. +3
    -3
      source/backend/plugin/CarlaPluginLV2.cpp
  8. +1
    -1
      source/backend/plugin/CarlaPluginVST2.cpp
  9. +14
    -12
      source/modules/rtaudio/RtAudio.h
  10. +1
    -1
      source/native-plugins/midi-base.hpp
  11. +1
    -1
      source/native-plugins/midi-pattern.cpp
  12. +1
    -1
      source/plugin/carla-lv2-ui.cpp
  13. +1
    -1
      source/utils/CarlaPipeUtils.cpp
  14. +2
    -2
      source/utils/CarlaString.hpp

+ 3
- 1
source/Makefile.mk View File

@@ -180,7 +180,9 @@ BASE_FLAGS += -Wmissing-declarations -Wredundant-decls
BASE_FLAGS += -Wshadow -Wundef -Wuninitialized -Wunused BASE_FLAGS += -Wshadow -Wundef -Wuninitialized -Wunused
BASE_FLAGS += -Wstrict-aliasing -fstrict-aliasing BASE_FLAGS += -Wstrict-aliasing -fstrict-aliasing
BASE_FLAGS += -Wstrict-overflow -fstrict-overflow BASE_FLAGS += -Wstrict-overflow -fstrict-overflow
BASE_FLAGS += -Wduplicated-branches -Wduplicated-cond -Wnull-dereference
BASE_FLAGS += -Wduplicated-branches -Wduplicated-cond -Wnull-dereference
BASE_FLAGS += -Wformat-truncation=2 -Wformat-overflow=2
BASE_FLAGS += -Wstringop-overflow=4 -Wstringop-truncation
CFLAGS += -Winit-self -Wjump-misses-init -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wwrite-strings CFLAGS += -Winit-self -Wjump-misses-init -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wwrite-strings
CXXFLAGS += -Wc++0x-compat -Wc++11-compat CXXFLAGS += -Wc++0x-compat -Wc++11-compat
CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual


+ 10
- 10
source/backend/engine/CarlaEngineNative.cpp View File

@@ -427,7 +427,7 @@ protected:


{ {
const CarlaScopedLocale csl; const CarlaScopedLocale csl;
std::snprintf(tmpBuf, STR_MAX, "%f\n", newSampleRate);
std::snprintf(tmpBuf, STR_MAX, "%.12g\n", newSampleRate);
} }


if (fUiServer.writeMessage(tmpBuf)) if (fUiServer.writeMessage(tmpBuf))
@@ -537,7 +537,7 @@ protected:
std::snprintf(tmpBuf, STR_MAX, "PARAMVAL_%u:%i\n", pluginId, i); std::snprintf(tmpBuf, STR_MAX, "PARAMVAL_%u:%i\n", pluginId, i);
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);


std::snprintf(tmpBuf, STR_MAX, "%f\n", static_cast<double>(plugin->getInternalParameterValue(i)));
std::snprintf(tmpBuf, STR_MAX, "%.12g\n", static_cast<double>(plugin->getInternalParameterValue(i)));
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);


fUiServer.flushMessages(); fUiServer.flushMessages();
@@ -589,7 +589,7 @@ protected:
std::snprintf(tmpBuf, STR_MAX, "PARAMETER_RANGES_%i:%i\n", pluginId, i); std::snprintf(tmpBuf, STR_MAX, "PARAMETER_RANGES_%i:%i\n", pluginId, i);
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);


std::snprintf(tmpBuf, STR_MAX, "%f:%f:%f:%f:%f:%f\n",
std::snprintf(tmpBuf, STR_MAX, "%.12g:%.12g:%.12g:%.12g:%.12g:%.12g\n",
static_cast<double>(paramRanges.def), static_cast<double>(paramRanges.def),
static_cast<double>(paramRanges.min), static_cast<double>(paramRanges.min),
static_cast<double>(paramRanges.max), static_cast<double>(paramRanges.max),
@@ -601,7 +601,7 @@ protected:
std::snprintf(tmpBuf, STR_MAX, "PARAMVAL_%u:%u\n", pluginId, i); std::snprintf(tmpBuf, STR_MAX, "PARAMVAL_%u:%u\n", pluginId, i);
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);


std::snprintf(tmpBuf, STR_MAX, "%f\n", static_cast<double>(plugin->getParameterValue(i)));
std::snprintf(tmpBuf, STR_MAX, "%.12g\n", static_cast<double>(plugin->getParameterValue(i)));
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);
} }


@@ -780,7 +780,7 @@ protected:


{ {
const CarlaScopedLocale csl; const CarlaScopedLocale csl;
std::snprintf(tmpBuf, STR_MAX, "%f\n", static_cast<double>(valuef));
std::snprintf(tmpBuf, STR_MAX, "%.12g\n", static_cast<double>(valuef));
} }
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);


@@ -837,7 +837,7 @@ protected:
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage("sample-rate\n"),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage("sample-rate\n"),);
{ {
const CarlaScopedLocale csl; const CarlaScopedLocale csl;
std::snprintf(tmpBuf, STR_MAX, "%f\n", pData->sampleRate);
std::snprintf(tmpBuf, STR_MAX, "%.12g\n", pData->sampleRate);
} }
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);


@@ -1380,7 +1380,7 @@ protected:
// send engine info // send engine info


CARLA_SAFE_ASSERT_RETURN(fUiServer.writeAndFixMessage("runtime-info"),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeAndFixMessage("runtime-info"),);
std::snprintf(tmpBuf, STR_MAX, "%f:0\n", static_cast<double>(getDSPLoad()));
std::snprintf(tmpBuf, STR_MAX, "%.12g:0\n", static_cast<double>(getDSPLoad()));
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);


fUiServer.flushMessages(); fUiServer.flushMessages();
@@ -1398,7 +1398,7 @@ protected:
timeInfo.bbt.beat, timeInfo.bbt.beat,
static_cast<int>(timeInfo.bbt.tick + 0.5)); static_cast<int>(timeInfo.bbt.tick + 0.5));
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);
std::snprintf(tmpBuf, STR_MAX, "%f\n", timeInfo.bbt.beatsPerMinute);
std::snprintf(tmpBuf, STR_MAX, "%.12g\n", timeInfo.bbt.beatsPerMinute);
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);
} }
else else
@@ -1420,7 +1420,7 @@ protected:


std::snprintf(tmpBuf, STR_MAX, "PEAKS_%i\n", i); std::snprintf(tmpBuf, STR_MAX, "PEAKS_%i\n", i);
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);
std::snprintf(tmpBuf, STR_MAX, "%f:%f:%f:%f\n",
std::snprintf(tmpBuf, STR_MAX, "%.12g:%.12g:%.12g:%.12g\n",
static_cast<double>(plugData.peaks[0]), static_cast<double>(plugData.peaks[0]),
static_cast<double>(plugData.peaks[1]), static_cast<double>(plugData.peaks[1]),
static_cast<double>(plugData.peaks[2]), static_cast<double>(plugData.peaks[2]),
@@ -1436,7 +1436,7 @@ protected:


std::snprintf(tmpBuf, STR_MAX, "PARAMVAL_%u:%u\n", i, j); std::snprintf(tmpBuf, STR_MAX, "PARAMVAL_%u:%u\n", i, j);
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);
std::snprintf(tmpBuf, STR_MAX, "%f\n", static_cast<double>(plugin->getParameterValue(j)));
std::snprintf(tmpBuf, STR_MAX, "%.12g\n", static_cast<double>(plugin->getParameterValue(j)));
CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),); CARLA_SAFE_ASSERT_RETURN(fUiServer.writeMessage(tmpBuf),);


fUiServer.flushMessages(); fUiServer.flushMessages();


+ 2
- 2
source/backend/engine/CarlaEnginePorts.cpp View File

@@ -102,8 +102,8 @@ void CarlaEngineCVPort::setRange(const float min, const float max) noexcept


{ {
const CarlaScopedLocale csl; const CarlaScopedLocale csl;
std::snprintf(strBufMin, STR_MAX-1, "%f", static_cast<double>(min));
std::snprintf(strBufMax, STR_MAX-1, "%f", static_cast<double>(max));
std::snprintf(strBufMin, STR_MAX-1, "%.12g", static_cast<double>(min));
std::snprintf(strBufMax, STR_MAX-1, "%.12g", static_cast<double>(max));
} }


setMetaData(LV2_CORE__minimum, strBufMin, ""); setMetaData(LV2_CORE__minimum, strBufMin, "");


+ 1
- 1
source/backend/plugin/CarlaPlugin.cpp View File

@@ -1771,7 +1771,7 @@ void CarlaPlugin::setParameterMappedRange(const uint32_t parameterId, const floa


char strBuf[STR_MAX+1]; char strBuf[STR_MAX+1];
carla_zeroChars(strBuf, STR_MAX+1); carla_zeroChars(strBuf, STR_MAX+1);
std::snprintf(strBuf, STR_MAX, "%f:%f", static_cast<double>(minimum), static_cast<double>(maximum));
std::snprintf(strBuf, STR_MAX, "%.12g:%.12g", static_cast<double>(minimum), static_cast<double>(maximum));


#ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH
pData->engine->callback(sendCallback, sendOsc, pData->engine->callback(sendCallback, sendOsc,


+ 1
- 1
source/backend/plugin/CarlaPluginBridge.cpp View File

@@ -583,7 +583,7 @@ public:
if (waitForParameterText()) if (waitForParameterText())
return true; return true;


std::snprintf(strBuf, STR_MAX, "%f", static_cast<double>(fParams[parameterId].value));
std::snprintf(strBuf, STR_MAX, "%.12g", static_cast<double>(fParams[parameterId].value));
return false; return false;
} }




+ 5
- 5
source/backend/plugin/CarlaPluginLADSPADSSI.cpp View File

@@ -3111,25 +3111,25 @@ private:
static bool _getSeparatedParameterNameOrUnitImpl(const char* const paramName, char* const strBuf, static bool _getSeparatedParameterNameOrUnitImpl(const char* const paramName, char* const strBuf,
const bool wantName, const bool useBracket) noexcept const bool wantName, const bool useBracket) noexcept
{ {
const char* const sepBracketStart(std::strstr(paramName, useBracket ? " [" : " ("));
const char* const sepBracketStart = std::strstr(paramName, useBracket ? " [" : " (");


if (sepBracketStart == nullptr) if (sepBracketStart == nullptr)
return false; return false;


const char* const sepBracketEnd(std::strstr(sepBracketStart, useBracket ? "]" : ")"));
const char* const sepBracketEnd = std::strstr(sepBracketStart, useBracket ? "]" : ")");


if (sepBracketEnd == nullptr) if (sepBracketEnd == nullptr)
return false; return false;


const std::size_t unitSize(static_cast<std::size_t>(sepBracketEnd-sepBracketStart-2));
const std::size_t unitSize = static_cast<std::size_t>(sepBracketEnd-sepBracketStart-2);


if (unitSize > 7) // very unlikely to have such big unit if (unitSize > 7) // very unlikely to have such big unit
return false; return false;


const std::size_t sepIndex(std::strlen(paramName)-unitSize-3);
const std::size_t sepIndex = std::strlen(paramName)-unitSize-3;


// just in case // just in case
if (sepIndex+2 >= STR_MAX)
if (sepIndex > STR_MAX-3)
return false; return false;


if (wantName) if (wantName)


+ 3
- 3
source/backend/plugin/CarlaPluginLV2.cpp View File

@@ -478,7 +478,7 @@ public:
char sampleRateStr[32]; char sampleRateStr[32];
{ {
const CarlaScopedLocale csl; const CarlaScopedLocale csl;
std::snprintf(sampleRateStr, 31, "%f", kEngine->getSampleRate());
std::snprintf(sampleRateStr, 31, "%.12g", kEngine->getSampleRate());
} }
sampleRateStr[31] = '\0'; sampleRateStr[31] = '\0';


@@ -1580,7 +1580,7 @@ public:
if (! fPipeServer.writeMessage(tmpBuf)) if (! fPipeServer.writeMessage(tmpBuf))
return; return;


std::snprintf(tmpBuf, 0xff, "%f\n", static_cast<double>(pData->engine->getOptions().uiScale));
std::snprintf(tmpBuf, 0xff, "%.12g\n", static_cast<double>(pData->engine->getOptions().uiScale));
if (! fPipeServer.writeMessage(tmpBuf)) if (! fPipeServer.writeMessage(tmpBuf))
return; return;


@@ -1611,7 +1611,7 @@ public:
if (! fPipeServer.writeMessage(tmpBuf)) if (! fPipeServer.writeMessage(tmpBuf))
return; return;


std::snprintf(tmpBuf, 0xff, "%f\n", static_cast<double>(getParameterValue(i)));
std::snprintf(tmpBuf, 0xff, "%.12g\n", static_cast<double>(getParameterValue(i)));
if (! fPipeServer.writeMessage(tmpBuf)) if (! fPipeServer.writeMessage(tmpBuf))
return; return;
} }


+ 1
- 1
source/backend/plugin/CarlaPluginVST2.cpp View File

@@ -339,7 +339,7 @@ public:
dispatcher(effGetParamDisplay, static_cast<int32_t>(parameterId), 0, strBuf); dispatcher(effGetParamDisplay, static_cast<int32_t>(parameterId), 0, strBuf);


if (strBuf[0] == '\0') if (strBuf[0] == '\0')
std::snprintf(strBuf, STR_MAX, "%f", static_cast<double>(getParameterValue(parameterId)));
std::snprintf(strBuf, STR_MAX, "%.12g", static_cast<double>(getParameterValue(parameterId)));


return true; return true;
} }


+ 14
- 12
source/modules/rtaudio/RtAudio.h View File

@@ -113,7 +113,7 @@ static const RtAudioFormat RTAUDIO_FLOAT64 = 0x20; // Normalized between plus/mi
open the input and/or output stream device(s) for exclusive use. open the input and/or output stream device(s) for exclusive use.
Note that this is not possible with all supported audio APIs. Note that this is not possible with all supported audio APIs.


If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt
If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt
to select realtime scheduling (round-robin) for the callback thread. to select realtime scheduling (round-robin) for the callback thread.


If the RTAUDIO_ALSA_USE_DEFAULT flag is set, RtAudio will attempt to If the RTAUDIO_ALSA_USE_DEFAULT flag is set, RtAudio will attempt to
@@ -347,7 +347,7 @@ class RTAUDIO_DLL_PUBLIC RtAudio
open the input and/or output stream device(s) for exclusive use. open the input and/or output stream device(s) for exclusive use.
Note that this is not possible with all supported audio APIs. Note that this is not possible with all supported audio APIs.


If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt
If the RTAUDIO_SCHEDULE_REALTIME flag is set, RtAudio will attempt
to select realtime scheduling (round-robin) for the callback thread. to select realtime scheduling (round-robin) for the callback thread.
The \c priority parameter will only be used if the RTAUDIO_SCHEDULE_REALTIME The \c priority parameter will only be used if the RTAUDIO_SCHEDULE_REALTIME
flag is set. It defines the thread's realtime priority. flag is set. It defines the thread's realtime priority.
@@ -416,7 +416,7 @@ class RTAUDIO_DLL_PUBLIC RtAudio
/*! /*!
This function performs a system query of available devices each time it This function performs a system query of available devices each time it
is called, thus supporting devices connected \e after instantiation. If is called, thus supporting devices connected \e after instantiation. If
a system error occurs during processing, a warning will be issued.
a system error occurs during processing, a warning will be issued.
*/ */
unsigned int getDeviceCount( void ); unsigned int getDeviceCount( void );


@@ -483,7 +483,7 @@ class RTAUDIO_DLL_PUBLIC RtAudio
from within the callback function. from within the callback function.
\param options An optional pointer to a structure containing various \param options An optional pointer to a structure containing various
global stream options, including a list of OR'ed RtAudioStreamFlags global stream options, including a list of OR'ed RtAudioStreamFlags
and a suggested number of stream buffers that can be used to
and a suggested number of stream buffers that can be used to
control stream latency. More buffers typically result in more control stream latency. More buffers typically result in more
robust performance, though at a cost of greater latency. If a robust performance, though at a cost of greater latency. If a
value of zero is specified, a system-specific median value is value of zero is specified, a system-specific median value is
@@ -658,7 +658,9 @@ class S24 {
return *this; return *this;
} }


#if defined(__GNUC__) && __GNUC__ < 8
S24( const S24& v ) { *this = v; } S24( const S24& v ) { *this = v; }
#endif
S24( const double& d ) { *this = (int) d; } S24( const double& d ) { *this = (int) d; }
S24( const float& f ) { *this = (int) f; } S24( const float& f ) { *this = (int) f; }
S24( const signed short& s ) { *this = (int) s; } S24( const signed short& s ) { *this = (int) s; }
@@ -792,7 +794,7 @@ protected:
"warning" message is reported and FAILURE is returned. A "warning" message is reported and FAILURE is returned. A
successful probe is indicated by a return value of SUCCESS. successful probe is indicated by a return value of SUCCESS.
*/ */
virtual bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
virtual bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate, unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize, RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options ); RtAudio::StreamOptions *options );
@@ -884,7 +886,7 @@ public:


private: private:


bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate, unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize, RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options ); RtAudio::StreamOptions *options );
@@ -921,7 +923,7 @@ public:


private: private:


bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate, unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize, RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options ); RtAudio::StreamOptions *options );
@@ -959,7 +961,7 @@ public:
std::vector<RtAudio::DeviceInfo> devices_; std::vector<RtAudio::DeviceInfo> devices_;
void saveDeviceInfo( void ); void saveDeviceInfo( void );
bool coInitialized_; bool coInitialized_;
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate, unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize, RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options ); RtAudio::StreamOptions *options );
@@ -998,7 +1000,7 @@ public:
bool buffersRolling; bool buffersRolling;
long duplexPrerollBytes; long duplexPrerollBytes;
std::vector<struct DsDevice> dsDevices; std::vector<struct DsDevice> dsDevices;
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate, unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize, RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options ); RtAudio::StreamOptions *options );
@@ -1069,7 +1071,7 @@ public:


std::vector<RtAudio::DeviceInfo> devices_; std::vector<RtAudio::DeviceInfo> devices_;
void saveDeviceInfo( void ); void saveDeviceInfo( void );
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate, unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize, RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options ); RtAudio::StreamOptions *options );
@@ -1133,7 +1135,7 @@ public:


private: private:


bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels,
unsigned int firstChannel, unsigned int sampleRate, unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize, RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options ); RtAudio::StreamOptions *options );
@@ -1158,7 +1160,7 @@ public:


private: private:


bool probeDeviceOpen( unsigned int /*device*/, StreamMode /*mode*/, unsigned int /*channels*/,
bool probeDeviceOpen( unsigned int /*device*/, StreamMode /*mode*/, unsigned int /*channels*/,
unsigned int /*firstChannel*/, unsigned int /*sampleRate*/, unsigned int /*firstChannel*/, unsigned int /*sampleRate*/,
RtAudioFormat /*format*/, unsigned int * /*bufferSize*/, RtAudioFormat /*format*/, unsigned int * /*bufferSize*/,
RtAudio::StreamOptions * /*options*/ ) { return false; } RtAudio::StreamOptions * /*options*/ ) { return false; }


+ 1
- 1
source/native-plugins/midi-base.hpp View File

@@ -302,7 +302,7 @@ public:
const RawMidiEvent* const rawMidiEvent(it.getValue(nullptr)); const RawMidiEvent* const rawMidiEvent(it.getValue(nullptr));
CARLA_SAFE_ASSERT_CONTINUE(rawMidiEvent != nullptr); CARLA_SAFE_ASSERT_CONTINUE(rawMidiEvent != nullptr);


wrtn = std::snprintf(dataWrtn, maxTimeSize+4, P_INT64 ":%i:", rawMidiEvent->time, rawMidiEvent->size);
wrtn = std::snprintf(dataWrtn, maxTimeSize+6, P_UINT64 ":%u:", rawMidiEvent->time, rawMidiEvent->size);
CARLA_SAFE_ASSERT_BREAK(wrtn > 0); CARLA_SAFE_ASSERT_BREAK(wrtn > 0);
dataWrtn += wrtn; dataWrtn += wrtn;




+ 1
- 1
source/native-plugins/midi-pattern.cpp View File

@@ -312,7 +312,7 @@ protected:


{ {
const CarlaScopedLocale csl; const CarlaScopedLocale csl;
std::snprintf(strBuf, 0xff, "%f\n", beatsPerMinute);
std::snprintf(strBuf, 0xff, "%.12g\n", beatsPerMinute);
} }


CARLA_SAFE_ASSERT_RETURN(writeMessage(strBuf),); CARLA_SAFE_ASSERT_RETURN(writeMessage(strBuf),);


+ 1
- 1
source/plugin/carla-lv2-ui.cpp View File

@@ -139,7 +139,7 @@ public:


{ {
const CarlaScopedLocale csl; const CarlaScopedLocale csl;
std::snprintf(msg, 127, "control %u %f", portIndex, static_cast<double>(*valuePtr));
std::snprintf(msg, 127, "control %u %.12g", portIndex, static_cast<double>(*valuePtr));
} }


msg[127] = '\0'; msg[127] = '\0';


+ 1
- 1
source/utils/CarlaPipeUtils.cpp View File

@@ -984,7 +984,7 @@ void CarlaPipeCommon::writeControlMessage(const uint32_t index, const float valu


{ {
const CarlaScopedLocale csl; const CarlaScopedLocale csl;
std::snprintf(tmpBuf, 0xff, "%f\n", static_cast<double>(value));
std::snprintf(tmpBuf, 0xff, "%.12g\n", static_cast<double>(value));
} }


if (! _writeMsgBuffer(tmpBuf, std::strlen(tmpBuf))) if (! _writeMsgBuffer(tmpBuf, std::strlen(tmpBuf)))


+ 2
- 2
source/utils/CarlaString.hpp View File

@@ -179,7 +179,7 @@ public:


{ {
const CarlaScopedLocale csl; const CarlaScopedLocale csl;
std::snprintf(strBuf, 0xff, "%f", static_cast<double>(value));
std::snprintf(strBuf, 0xff, "%.12g", static_cast<double>(value));
} }


strBuf[0xff] = '\0'; strBuf[0xff] = '\0';
@@ -199,7 +199,7 @@ public:


{ {
const CarlaScopedLocale csl; const CarlaScopedLocale csl;
std::snprintf(strBuf, 0xff, "%f", value);
std::snprintf(strBuf, 0xff, "%.24g", value);
} }


strBuf[0xff] = '\0'; strBuf[0xff] = '\0';


Loading…
Cancel
Save