diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-02-26 17:44:09 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-02-26 17:44:09 +0000 |
commit | c20e55d07a252e4db800454fa361b8cc9a047879 (patch) | |
tree | 574d65188ac6bfd685ae12c7eddba791c98cf8a8 /libs | |
parent | 54f18f26d4731ebda625776f8850ea8ff4dcc79e (diff) |
fix compiler complaints about RCU code; fix a couple of compiler warnings
git-svn-id: svn://localhost/ardour2/trunk@1511 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/fst/vstwin.c | 2 | ||||
-rw-r--r-- | libs/pbd/pbd/rcu.h | 19 |
2 files changed, 10 insertions, 11 deletions
diff --git a/libs/fst/vstwin.c b/libs/fst/vstwin.c index 0ee34b70b4..62bab5b418 100644 --- a/libs/fst/vstwin.c +++ b/libs/fst/vstwin.c @@ -514,7 +514,7 @@ fst_load (const char *path) return NULL; } - if ((fhandle->main_entry = GetProcAddress (fhandle->dll, "main")) == NULL) { + if ((fhandle->main_entry = ((AEffect*)()(audioMasterCallback)) GetProcAddress (fhandle->dll, "main")) == NULL) { fst_unload (fhandle); return NULL; } diff --git a/libs/pbd/pbd/rcu.h b/libs/pbd/pbd/rcu.h index a8f3cdd5bc..c9088d51df 100644 --- a/libs/pbd/pbd/rcu.h +++ b/libs/pbd/pbd/rcu.h @@ -12,22 +12,21 @@ class RCUManager public: RCUManager (T* new_rcu_value) { - m_rcu_value = new boost::shared_ptr<T> (new_rcu_value); + x.m_rcu_value = new boost::shared_ptr<T> (new_rcu_value); } - virtual ~RCUManager() { delete m_rcu_value; } + virtual ~RCUManager() { delete x.m_rcu_value; } - boost::shared_ptr<T> reader () const { return *((boost::shared_ptr<T> *) g_atomic_pointer_get (the_pointer())); } + boost::shared_ptr<T> reader () const { return *((boost::shared_ptr<T> *) g_atomic_pointer_get (&x.gptr)); } virtual boost::shared_ptr<T> write_copy () = 0; virtual bool update (boost::shared_ptr<T> new_value) = 0; protected: - boost::shared_ptr<T>* m_rcu_value; - - // this monstrosity is needed because of some wierd behavior by g++ - - gpointer * the_pointer() const { return (gpointer *) &m_rcu_value; } + union { + boost::shared_ptr<T>* m_rcu_value; + volatile gpointer gptr; + } x; }; @@ -60,7 +59,7 @@ public: // store the current - current_write_old = RCUManager<T>::m_rcu_value; + current_write_old = RCUManager<T>::x.m_rcu_value; boost::shared_ptr<T> new_copy (new T(**current_write_old)); @@ -76,7 +75,7 @@ public: // update, checking that nobody beat us to it - bool ret = g_atomic_pointer_compare_and_exchange (RCUManager<T>::the_pointer(), + bool ret = g_atomic_pointer_compare_and_exchange (&RCUManager<T>::x.gptr, (gpointer) current_write_old, (gpointer) new_spp); |