aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/vasp/source/oploop.h
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2002-12-02 19:21:08 +0000
committerThomas Grill <xovo@users.sourceforge.net>2002-12-02 19:21:08 +0000
commit9815096db22c73cacdbb65512d1b61d633db7fa8 (patch)
tree4a6582ead85b8efd031f68e717fbc8a5b3a3df3f /externals/grill/vasp/source/oploop.h
parent0a109da279e9df66fb5ea7d6bdaeffed16592f02 (diff)
"version 0.1.1"
svn path=/trunk/; revision=267
Diffstat (limited to 'externals/grill/vasp/source/oploop.h')
-rwxr-xr-xexternals/grill/vasp/source/oploop.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/externals/grill/vasp/source/oploop.h b/externals/grill/vasp/source/oploop.h
new file mode 100755
index 00000000..6b268022
--- /dev/null
+++ b/externals/grill/vasp/source/oploop.h
@@ -0,0 +1,38 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPLOOP_H
+#define __VASP_OPLOOP_H
+
+#define _D_BLOCK 1024
+
+#define _D_MIN(a,b) ((a) < (b)?(a):(b))
+
+#ifdef FLEXT_THREADS
+#define _D_LOOP(VAR,LEN) { \
+ register I __i__; \
+ for(__i__ = 0; __i__ < LEN; flext_base::ThrYield()) { \
+ I __m__ = _D_MIN(LEN,__i__+_D_BLOCK); for(; (VAR = __i__) < __m__; ++__i__) {
+#define _E_LOOP } if(__i__ < __m__) break; }}
+#define _D_WHILE(COND) { \
+ for(; (COND) ; flext_base::ThrYield()) { \
+ register I __i__ = 0; \
+ for(; __i__ < _D_BLOCK && (COND); ++__i__) {
+#define _E_WHILE } if(__i__ < _D_BLOCK) break; }}
+#else
+#define _D_LOOP(VAR,LEN) { \
+ for(VAR = 0; VAR < LEN; ++VAR) {
+#define _E_LOOP }}
+#define _D_WHILE(COND) { \
+ while(COND) {
+#define _E_WHILE }}
+#endif
+
+#endif