[PD-cvs] externals/grill/flext/source flext.cpp, 1.34, 1.35 flmap.h, 1.17, 1.18 flqueue.cpp, 1.31, 1.32

Thomas Grill xovo at users.sourceforge.net
Mon Apr 25 14:50:38 CEST 2005


Update of /cvsroot/pure-data/externals/grill/flext/source
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5399/source

Modified Files:
	flext.cpp flmap.h flqueue.cpp 
Log Message:
small fixes
fixes for MSVC6


Index: flqueue.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flqueue.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** flqueue.cpp	13 Mar 2005 04:56:39 -0000	1.31
--- flqueue.cpp	25 Apr 2005 12:50:35 -0000	1.32
***************
*** 27,30 ****
--- 27,37 ----
  #endif
  
+ #ifdef FLEXT_SHARED
+ /*
+     For the shared version it _should_ be possible to have only one queue for all externals.
+     Yet I don't know how to do this cross-platform
+ */
+ #define PERMANENTIDLE
+ #endif
  
  static void Trigger();
***************
*** 197,212 ****
  
  #elif FLEXT_QMODE == 1
! #ifndef FLEXT_SHARED
  static bool qtickactive = false;
  #endif
  static t_int QTick(t_int *)
  {
! #ifndef FLEXT_SHARED
      qtickactive = false;
  #endif
      QWork(false);
! #ifdef FLEXT_SHARED
      // will be run in the next idle cycle
!     return 2; 
  #else
      // won't be run again
--- 204,221 ----
  
  #elif FLEXT_QMODE == 1
! #ifndef PERMANENTIDLE
  static bool qtickactive = false;
  #endif
  static t_int QTick(t_int *)
  {
! #ifndef PERMANENTIDLE
      qtickactive = false;
  #endif
+ 
      QWork(false);
! 
! #ifdef PERMANENTIDLE
      // will be run in the next idle cycle
!     return 2;
  #else
      // won't be run again
***************
*** 240,244 ****
          // wake up worker thread
          qthrcond.Signal();
!     #elif FLEXT_QMODE == 1 && !defined(FLEXT_SHARED)
          if(!qtickactive) {
              sys_callback(QTick,NULL,0);
--- 249,253 ----
          // wake up worker thread
          qthrcond.Signal();
!     #elif FLEXT_QMODE == 1 && !defined(PERMANENTIDLE)
          if(!qtickactive) {
              sys_callback(QTick,NULL,0);
***************
*** 281,285 ****
  
  #if FLEXT_QMODE == 1
! #ifdef FLEXT_SHARED
      sys_callback(QTick,NULL,0);
  #endif
--- 290,294 ----
  
  #if FLEXT_QMODE == 1
! #ifdef PERMANENTIDLE
      sys_callback(QTick,NULL,0);
  #endif

Index: flext.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flext.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** flext.cpp	16 Mar 2005 04:56:29 -0000	1.34
--- flext.cpp	25 Apr 2005 12:50:35 -0000	1.35
***************
*** 176,180 ****
  
  void flext_base::m_loadbang() {}
! void flext_base::CbLoadbang() { return m_loadbang(); }
  
  void flext_base::CbClick() {}
--- 176,180 ----
  
  void flext_base::m_loadbang() {}
! void flext_base::CbLoadbang() { m_loadbang(); }
  
  void flext_base::CbClick() {}

Index: flmap.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flmap.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** flmap.h	19 Apr 2005 13:29:56 -0000	1.17
--- flmap.h	25 Apr 2005 12:50:35 -0000	1.18
***************
*** 24,28 ****
  class FLEXT_SHARE TableAnyMap
  {
! protected:
      virtual TableAnyMap *_newmap(TableAnyMap *parent) = 0;
      virtual void _delmap(TableAnyMap *map) = 0;
--- 24,29 ----
  class FLEXT_SHARE TableAnyMap
  {
! public:
! 
      virtual TableAnyMap *_newmap(TableAnyMap *parent) = 0;
      virtual void _delmap(TableAnyMap *map) = 0;
***************
*** 36,39 ****
--- 37,43 ----
      };
  
+ protected:
+     // constructor and destructor are protected so that they can't be directly instantiated 
+ 
      TableAnyMap(TableAnyMap *p,Data *dt)
          : data(dt)
***************
*** 44,47 ****
--- 48,53 ----
      virtual ~TableAnyMap();
  
+ public:
+ 
  #if 0 // set 1 for asserting the map structure (very cpu-intensive!)
      void check(int tsize) { if(n) _check(tsize); }
***************
*** 106,111 ****
      };
  
- private:
- 
      void _init(size_t k,void *t) { data[0](k,t); n = 1; }
  
--- 112,115 ----
***************
*** 179,183 ****
  template <typename K,typename T,int N = 8>
  class TablePtrMap
!     : TableAnyMap
  {
  public:
--- 183,191 ----
  template <typename K,typename T,int N = 8>
  class TablePtrMap
!     : 
! #if defined(_MSC_VER) && _MSC_VER < 1300
!     public  // necessary for VC6
! #endif
!     TableAnyMap
  {
  public:
***************
*** 205,208 ****
--- 213,217 ----
      }
  
+ 
      class iterator
          : TableAnyMap::iterator
***************
*** 213,224 ****
          iterator(iterator &it): TableAnyMap::iterator(it) {}
  
!         inline iterator &operator =(const iterator &it) { TableAnyMap::operator =(it); return *this; }
  
!         inline operator bool() const {return TableAnyMap::iterator::operator bool(); }
!         inline T data() const { return (T)TableAnyMap::iterator::data(); }
!         inline K key() const { return (K)TableAnyMap::iterator::key(); }
  
!         inline iterator &operator ++() { TableAnyMap::iterator::operator ++(); return *this; }  
  
      };
  
--- 222,234 ----
          iterator(iterator &it): TableAnyMap::iterator(it) {}
  
!         // this ugly syntax (cast to parent class) is needed for MSVC6 
  
!         inline iterator &operator =(const iterator &it) { ((TableAnyMap::iterator &)*this) = it; return *this; }
  
!         inline operator bool() const { return (bool)((TableAnyMap::iterator &)*this); } 
!         inline T data() const { return (T)(((TableAnyMap::iterator &)*this).data()); }
!         inline K key() const { return (K)(((TableAnyMap::iterator &)*this).key()); }
  
+         inline iterator &operator ++() { ++((TableAnyMap::iterator &)*this); return *this; }  
      };
  





More information about the Pd-cvs mailing list