Browse Source

Merge branch 'master' of github.com:DISTRHO/DPF into pugl-update

pull/83/head
falkTX 5 years ago
parent
commit
602a75efe1
2 changed files with 6 additions and 3 deletions
  1. +2
    -2
      Makefile.plugins.mk
  2. +4
    -1
      distrho/src/DistrhoPluginVST.cpp

+ 2
- 2
Makefile.plugins.mk View File

@@ -77,12 +77,12 @@ all:
# Common

$(BUILD_DIR)/%.c.o: %.c
-@mkdir -p $(BUILD_DIR)
-@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)"
@echo "Compiling $<"
@$(CC) $< $(BUILD_C_FLAGS) -c -o $@

$(BUILD_DIR)/%.cpp.o: %.cpp
-@mkdir -p $(BUILD_DIR)
-@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)"
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@



+ 4
- 1
distrho/src/DistrhoPluginVST.cpp View File

@@ -71,18 +71,21 @@ static const writeMidiFunc writeMidiCallback = nullptr;

void strncpy(char* const dst, const char* const src, const size_t size)
{
std::strncpy(dst, src, size-1);
DISTRHO_SAFE_ASSERT_RETURN(size > 0,);
std::memcpy(dst, src, std::min(std::strlen(src), size-1));
dst[size-1] = '\0';
}

void snprintf_param(char* const dst, const float value, const size_t size)
{
DISTRHO_SAFE_ASSERT_RETURN(size > 0,);
std::snprintf(dst, size-1, "%f", value);
dst[size-1] = '\0';
}

void snprintf_iparam(char* const dst, const int32_t value, const size_t size)
{
DISTRHO_SAFE_ASSERT_RETURN(size > 0,);
std::snprintf(dst, size-1, "%d", value);
dst[size-1] = '\0';
}


Loading…
Cancel
Save