aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-01-30 04:36:06 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-01-30 04:36:06 +0000
commit392f24a84a7ca535a7132cfe0a8da55aa28733ce (patch)
tree9b546e31a6d682c1abf67afb4c06397c488683a2 /externals/grill/flext/source
parentc1313aea8746276cc4de4dbd177f6bf732db2a05 (diff)
""
svn path=/trunk/; revision=366
Diffstat (limited to 'externals/grill/flext/source')
-rw-r--r--externals/grill/flext/source/fldsp.cpp3
-rwxr-xr-xexternals/grill/flext/source/flprefix.h1
-rw-r--r--externals/grill/flext/source/flsupport.h20
3 files changed, 18 insertions, 6 deletions
diff --git a/externals/grill/flext/source/fldsp.cpp b/externals/grill/flext/source/fldsp.cpp
index 13eab25d..f6270261 100644
--- a/externals/grill/flext/source/fldsp.cpp
+++ b/externals/grill/flext/source/fldsp.cpp
@@ -186,8 +186,7 @@ void flext_dsp::m_dsp(int /*n*/,t_signalvec const * /*insigs*/,t_signalvec const
void flext_dsp::m_signal(int n,t_sample *const * /*insigs*/,t_sample *const *outs)
{
- for(int i = 0; i < CntOutSig(); ++i)
- memset(outs[i],0,n*sizeof(*outs[i]));
+ for(int i = 0; i < CntOutSig(); ++i) ZeroMem(outs[i],n*sizeof(*outs[i]));
}
#if FLEXT_SYS != FLEXT_SYS_MAX
diff --git a/externals/grill/flext/source/flprefix.h b/externals/grill/flext/source/flprefix.h
index f12d1320..51c88096 100755
--- a/externals/grill/flext/source/flprefix.h
+++ b/externals/grill/flext/source/flprefix.h
@@ -211,7 +211,6 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#endif
-
#if FLEXT_OS == FLEXT_OS_WIN
// #pragma message("Compiling for Windows")
diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h
index 3f771ea0..e2350d04 100644
--- a/externals/grill/flext/source/flsupport.h
+++ b/externals/grill/flext/source/flsupport.h
@@ -16,6 +16,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#define __FLSUPPORT_H
#include "flstdc.h"
+#include <time.h>
class FLEXT_SHARE flext_base;
@@ -729,11 +730,24 @@ public:
}
/*! \brief Wait for condition (for a certain time)
- \param time Wait time in seconds
+ \param ftime Wait time in seconds
+ \ret 0 = signalled, 1 = timed out
+ \remark Depending on the implementation ftime may not be fractional.
+ \remark So if ftime = 0 this may suck away your cpu if used in a signalled loop.
*/
- bool TimedWait(float time)
+ bool TimedWait(float ftime)
{
- timespec tm; tm.tv_sec = (long)time; tm.tv_nsec = (long)((time-(long)time)*1.e9);
+ timespec tm;
+#if 0 // find out when the following is defined
+ clock_gettime(CLOCK_REALTIME,tm);
+ tm.tv_nsec += (long)((ftime-(long)ftime)*1.e9);
+ long nns = tm.tv_nsec%1000000000;
+ tm.tv_sec += (long)ftime+(tm.tv_nsec-nns)/1000000000;
+ tm.tv_nsec = nns;
+#else
+ tm.tv_sec = time(NULL)+(long)ftime;
+ tm.tv_nsec = 0;
+#endif
Lock();
bool ret = pthread_cond_timedwait(&cond,&mutex,&tm) == 0;
Unlock();