From 9b8e8575cb6ff6fe1a368e6967303242d289f352 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 4 Sep 2008 22:30:50 +0000 Subject: [PATCH] * set common numeric locale to make atof() work properly in Germany * increased SHM_FIFO_SIZE from 4000 to 64000 for not getting stuck when exchanging bigger messages (e.g. parameter dumps) git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1548 0778d3d1-df1d-0410-868b-ea421aaaa00d --- CMakeLists.txt | 1 + include/remote_plugin.h | 19 +++++++++++++++---- lmmsconfig.h.in | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 55d2dac40..ebcc599fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,7 @@ CHECK_INCLUDE_FILES(sys/ioctl.h LMMS_HAVE_SYS_IOCTL_H) CHECK_INCLUDE_FILES(ctype.h LMMS_HAVE_CTYPE_H) CHECK_INCLUDE_FILES(string.h LMMS_HAVE_STRING_H) CHECK_INCLUDE_FILES(process.h LMMS_HAVE_PROCESS_H) +CHECK_INCLUDE_FILES(locale.h LMMS_HAVE_LOCALE_H) # check for Qt4 diff --git a/include/remote_plugin.h b/include/remote_plugin.h index b8a26e5f0..e6e4966ac 100755 --- a/include/remote_plugin.h +++ b/include/remote_plugin.h @@ -70,6 +70,10 @@ typedef int32_t key_t; #include #endif +#ifdef LMMS_HAVE_LOCALE_H +#include +#endif + #ifdef BUILD_REMOTE_PLUGIN_CLIENT #undef EXPORT @@ -80,9 +84,10 @@ typedef int32_t key_t; #include #endif +// sometimes we need to exchange bigger messages (e.g. for VST parameter dumps) +// so set a usable value here +const int SHM_FIFO_SIZE = 64000; -// 4000 should be enough - this way we only need to allocate one page -const int SHM_FIFO_SIZE = 4000; // implements a FIFO inside a shared memory segment class shmFifo @@ -159,11 +164,12 @@ public: if( sem_init( m_dataSem, 1, 1 ) ) { - printf( "could not initialize m_dataSem\n" ); + fprintf( stderr, "could not initialize m_dataSem\n" ); } if( sem_init( m_messageSem, 1, 0 ) ) { - printf( "could not initialize m_messageSem\n" ); + fprintf( stderr, "could not initialize " + "m_messageSem\n" ); } #endif } @@ -779,6 +785,11 @@ remotePluginBase::remotePluginBase( shmFifo * _in, shmFifo * _out ) : m_in( _in ), m_out( _out ) { +#ifdef LMMS_HAVE_LOCALE_H + // make sure, we're using common ways to print/scan + // floats to/from strings (',' vs. '.' for decimal point etc.) + setlocale( LC_NUMERIC, "C" ); +#endif } diff --git a/lmmsconfig.h.in b/lmmsconfig.h.in index fa66b5419..ff78543d1 100644 --- a/lmmsconfig.h.in +++ b/lmmsconfig.h.in @@ -37,6 +37,7 @@ #cmakedefine LMMS_HAVE_CTYPE_H #cmakedefine LMMS_HAVE_STRING_H #cmakedefine LMMS_HAVE_PROCESS_H +#cmakedefine LMMS_HAVE_LOCALE_H /* defines for libsamplerate */