fix compiler complaints about RCU code; fix a couple of compiler warnings
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 26 Feb 2007 17:44:09 +0000 (17:44 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 26 Feb 2007 17:44:09 +0000 (17:44 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1511 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui_options.cc
libs/fst/vstwin.c
libs/pbd/pbd/rcu.h
vst/ardevst

index ce03a901975162036eea8b23345f92f821ef3be9..90e56ee53248315fbcbb6e6e85c08c4bbd4e8d37 100644 (file)
@@ -77,7 +77,7 @@ ARDOUR_UI::toggle_send_midi_feedback ()
 void
 ARDOUR_UI::set_native_file_header_format (HeaderFormat hf)
 {
-       const char *action;
+       const char *action = 0;
 
        switch (hf) {
        case BWF:
@@ -119,7 +119,7 @@ ARDOUR_UI::set_native_file_header_format (HeaderFormat hf)
 void
 ARDOUR_UI::set_native_file_data_format (SampleFormat sf)
 {
-       const char* action;
+       const char* action = 0;
 
        switch (sf) {
        case FormatFloat:
index 0ee34b70b40e13872e2ca7e128fcff08b7c48fea..62bab5b418f5b058f2d85d34a2014d3a1565e65d 100644 (file)
@@ -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;
        }
index a8f3cdd5bc72e5e5b23026ddcc7a6a9013b7736e..c9088d51df3513cd4daf4e80b99ec2e74a90b252 100644 (file)
@@ -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);
                
index 093c4b72da3d048c089d9a631c094ff9a8f03eea..ee27cb3f321f100ff235507d766c5f1faee94f9f 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh      
 export ARDOUR_PATH=../gtk2_ardour/icons:../gtk2_ardour/pixmaps:../gtk2_ardour
-export LD_LIBRARY_PATH=../gtk2_ardour:../libs/surfaces/control_protocol:../libs/ardour:../libs/midi++2:../libs/pbd:../libs/soundtouch:../libs/gtkmm2ext:../libs/sigc++2:../libs/glibmm2:../libs/gtkmm2/atk:../libs/gtkmm2/pango:../libs/gtkmm2/gdk:../libs/gtkmm2/gtk:../libs/libgnomecanvasmm:../libs/libsndfile:../libs/appleutility:$$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=../gtk2_ardour:../libs/surfaces/control_protocol:../libs/ardour:../libs/midi++2:../libs/pbd:../libs/soundtouch:../libs/gtkmm2ext:../libs/sigc++2:../libs/glibmm2:../libs/gtkmm2/atk:../libs/gtkmm2/pango:../libs/gtkmm2/gdk:../libs/gtkmm2/gtk:../libs/libgnomecanvasmm:../libs/libsndfile:../libs/appleutility:$LD_LIBRARY_PATH
 export GTK_PATH=$PWD/../libs/clearlooks:~/.ardour2
 exec wine ./ardour_vst.exe.so "$@"