zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 81558f9a159b4bcc07c9f402c75215dbd321c594
parent c0a6444b1ebcf8a99746bf4fd1056a4007ce0b9b
Author: falkTX <falktx@gmail.com>
Date:   Sun, 17 Jul 2016 18:13:54 +0200

Fix some compiler warnings

Diffstat:
Msrc/Containers/ScratchString.cpp | 2+-
Msrc/Misc/MiddleWare.cpp | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Containers/ScratchString.cpp b/src/Containers/ScratchString.cpp @@ -29,7 +29,7 @@ ScratchString ScratchString::operator+(const ScratchString s) { ScratchString ss; strncpy(ss.c_str, c_str, SCRATCH_SIZE); - strncat(ss.c_str, s.c_str, SCRATCH_SIZE); + strncat(ss.c_str, s.c_str, SCRATCH_SIZE-strlen(c_str)); return ss; } diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp @@ -1013,7 +1013,7 @@ const rtosc::Ports bankPorts = { #define MAX_SEARCH 128 char res_type[MAX_SEARCH+1] = {0}; rtosc_arg_t res_dat[MAX_SEARCH] = {0}; - for(int i=0; i<res.size() && i<MAX_SEARCH; ++i) { + for(unsigned i=0; i<res.size() && i<MAX_SEARCH; ++i) { res_type[i] = 's'; res_dat[i].s = res[i].c_str(); } @@ -1240,7 +1240,7 @@ static rtosc::Ports middwareSnoopPorts = { #define MAX_MIDI 32 rtosc_arg_t args[MAX_MIDI*4]; char argt[MAX_MIDI*4+1] = {0}; - for(int i=0; i<key.size() && i<MAX_MIDI; ++i) { + for(unsigned i=0; i<key.size() && i<MAX_MIDI; ++i) { auto val = midi.inv_map[key[i]]; argt[4*i+0] = 'i'; args[4*i+0].i = std::get<1>(val);