openvrml patches for f17 and rawhide

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've spent far too much time working on this, but I still haven't gotten
it 100% working (the browser tests still fail). I'm not entirely sure
these fixes are correct either, so I'm just sharing what I've
accomplished here and moving on.

~tom

==
Fedora Project
diff -up openvrml-0.18.8/src/libopenvrml/openvrml/local/component.cpp.boostfix openvrml-0.18.8/src/libopenvrml/openvrml/local/component.cpp
--- openvrml-0.18.8/src/libopenvrml/openvrml/local/component.cpp.boostfix	2009-07-04 17:20:16.000000000 -0400
+++ openvrml-0.18.8/src/libopenvrml/openvrml/local/component.cpp	2012-03-31 23:59:57.105645925 -0400
@@ -358,8 +358,7 @@ openvrml::local::component_registry::com
          entry != directory_iterator();
          ++entry) {
         if (!is_directory(entry->path())) try {
-            auto_ptr<component>
-                c(new component(entry->path().file_string()));
+            auto_ptr<component> c(new component(entry->path().string()));
             std::string key = c->id();
             succeeded = this->insert(key, c.release()).second;
             assert(succeeded);
diff -up openvrml-0.18.8/src/local/libopenvrml-dl/openvrml/local/dl.cpp.boostfix openvrml-0.18.8/src/local/libopenvrml-dl/openvrml/local/dl.cpp
--- openvrml-0.18.8/src/local/libopenvrml-dl/openvrml/local/dl.cpp.boostfix	2012-03-31 23:59:57.094646016 -0400
+++ openvrml-0.18.8/src/local/libopenvrml-dl/openvrml/local/dl.cpp	2012-03-31 23:59:57.105645925 -0400
@@ -103,11 +103,13 @@ foreachfile(const std::vector<boost::fil
 int
 openvrml::local::dl::prepend_to_searchpath(const boost::filesystem::path & dir)
 {
+    const std::string & dir_str = dir.string();
+    const char * const dir_c_str = dir_str.c_str();
 # ifdef _WIN32
-    return SetDllDirectory(dir.directory_string().c_str());
+    return SetDllDirectory(dir_c_str);
 # else
     const char * const before = lt_dlgetsearchpath();
-    return lt_dlinsertsearchdir(before, dir.directory_string().c_str());
+    return lt_dlinsertsearchdir(before, dir_c_str);
 # endif
 }
 
diff -up openvrml-0.18.8/src/Makefile.am.boostfix openvrml-0.18.8/src/Makefile.am
--- openvrml-0.18.8/src/Makefile.am.boostfix	2011-04-20 11:33:05.200247824 -0400
+++ openvrml-0.18.8/src/Makefile.am	2012-03-31 23:59:57.106645916 -0400
@@ -71,7 +71,7 @@ libopenvrml_libopenvrml_la_CPPFLAGS = \
         -DOPENVRML_PKGLIBDIR_=\"$(pkglibdir)\" \
         -DBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS \
         -DBOOST_MPL_LIMIT_VECTOR_SIZE=30 \
-        -DBOOST_FILESYSTEM_VERSION=2
+        -DBOOST_FILESYSTEM_VERSION=3
 libopenvrml_libopenvrml_la_CXXFLAGS = \
         $(FREETYPE_CFLAGS) \
         $(PTHREAD_CFLAGS) \
@@ -134,7 +134,7 @@ local_libopenvrml_dl_la_SOURCES = \
 local_libopenvrml_dl_la_CPPFLAGS = \
         -I$(top_builddir)/src/libopenvrml \
         -I$(top_srcdir)/src/libopenvrml \
-        -DBOOST_FILESYSTEM_VERSION=2
+        -DBOOST_FILESYSTEM_VERSION=3
 local_libopenvrml_dl_la_LIBADD = \
         -lboost_filesystem$(BOOST_LIB_SUFFIX) \
         -lboost_system$(BOOST_LIB_SUFFIX) \
@@ -178,7 +178,7 @@ script_java_la_CPPFLAGS = \
         -DOPENVRML_JVM_ARCH=\"$(OPENVRML_JVM_ARCH)\" \
         -DBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS \
         -DBOOST_MPL_LIMIT_VECTOR_SIZE=30 \
-        -DBOOST_FILESYSTEM_VERSION=2
+        -DBOOST_FILESYSTEM_VERSION=3
 script_java_la_LDFLAGS = \
         -module \
         -no-undefined \
diff -up openvrml-0.18.8/src/openvrml-xembed/browserfactory.cpp.boostfix openvrml-0.18.8/src/openvrml-xembed/browserfactory.cpp
--- openvrml-0.18.8/src/openvrml-xembed/browserfactory.cpp.boostfix	2012-03-31 23:59:57.087646074 -0400
+++ openvrml-0.18.8/src/openvrml-xembed/browserfactory.cpp	2012-03-31 23:59:57.106645916 -0400
@@ -18,7 +18,6 @@
 // with this library; if not, see <http://www.gnu.org/licenses/>.
 //
 
-# include <boost/intrusive_ptr.hpp>
 # include <boost/scope_exit.hpp>
 # include <boost/ref.hpp>
 # include <gtk/gtk.h>
@@ -34,6 +33,20 @@
 # include "browser-factory-server-glue.h"
 # include "browser.h"
 
+namespace {
+    G_GNUC_INTERNAL void intrusive_ptr_add_ref(GObject * const obj)
+    {
+     	g_object_ref(obj);
+    }
+
+    G_GNUC_INTERNAL void intrusive_ptr_release(GObject * const obj)
+    {
+     	g_object_unref(obj);
+    }
+}
+
+# include <boost/intrusive_ptr.hpp>
+
 G_DEFINE_TYPE(OpenvrmlXembedBrowserFactory,
               openvrml_xembed_browser_factory,
               G_TYPE_OBJECT)
@@ -51,18 +64,6 @@ extern "C" {
                                                       GParamSpec * pspec);
 }
 
-namespace {
-    G_GNUC_INTERNAL void intrusive_ptr_add_ref(GObject * const obj)
-    {
-        g_object_ref(obj);
-    }
-
-    G_GNUC_INTERNAL void intrusive_ptr_release(GObject * const obj)
-    {
-        g_object_unref(obj);
-    }
-}
-
 //
 // hosts maps the unique bus identifiers of hosts to a controls_map_t; a
 // controls_map_t maps an object path to an OpenvrmlXembedBrowser instance.
diff -up openvrml-0.18.8/tests/Makefile.am.boostfix openvrml-0.18.8/tests/Makefile.am
--- openvrml-0.18.8/tests/Makefile.am.boostfix	2012-04-02 09:18:26.626707408 -0400
+++ openvrml-0.18.8/tests/Makefile.am	2012-04-02 09:18:34.211634549 -0400
@@ -2,7 +2,7 @@ AM_CPPFLAGS = \
         -I$(top_builddir)/src/libopenvrml \
         -I$(top_srcdir)/src/libopenvrml \
         -DBOOST_TEST_DYN_LINK \
-        -DBOOST_FILESYSTEM_VERSION=2
+        -DBOOST_FILESYSTEM_VERSION=3
 AM_CXXFLAGS = $(PTHREAD_CFLAGS)
 
 TESTS_ENVIRONMENT = \
diff -up openvrml-0.18.8/src/node/vrml97/image_stream_listener.cpp.png15 openvrml-0.18.8/src/node/vrml97/image_stream_listener.cpp
--- openvrml-0.18.8/src/node/vrml97/image_stream_listener.cpp.png15	2012-03-31 21:11:07.833100340 -0400
+++ openvrml-0.18.8/src/node/vrml97/image_stream_listener.cpp	2012-03-31 22:31:00.733711173 -0400
@@ -136,7 +136,10 @@ void openvrml_png_info_callback(png_stru
 
     png_read_update_info(png_ptr, info_ptr);
 
-    reader.old_row.resize(png_ptr->rowbytes);
+    reader.width = png_get_image_width(png_ptr, info_ptr);
+    reader.rowbytes = png_get_rowbytes(png_ptr, info_ptr);
+
+    reader.old_row.resize(reader.rowbytes);
 }
 
 void openvrml_png_row_callback(png_structp png_ptr,
@@ -166,8 +169,8 @@ void openvrml_png_row_callback(png_struc
     // openvrml::image pixels start at the bottom left.
     //
     const size_t image_row = (image.y() - 1) - row_num;
-    const size_t bytes_per_row = png_ptr->rowbytes;
-    const size_t image_width = png_ptr->width;
+    const size_t bytes_per_row = reader.rowbytes;
+    const size_t image_width = reader.width;
     for (size_t pixel_index = 0, byte_index = 0; pixel_index < image_width;
          ++pixel_index) {
         using openvrml::int32;
diff -up openvrml-0.18.8/src/node/vrml97/image_stream_listener.h.png15 openvrml-0.18.8/src/node/vrml97/image_stream_listener.h
--- openvrml-0.18.8/src/node/vrml97/image_stream_listener.h.png15	2012-03-31 21:17:54.638075167 -0400
+++ openvrml-0.18.8/src/node/vrml97/image_stream_listener.h	2012-03-31 22:05:04.422126830 -0400
@@ -88,6 +88,8 @@ namespace openvrml_node_vrml97 {
             image_stream_listener & stream_listener;
             std::vector<png_byte> old_row;
             bool gray_palette;
+            png_uint_32 width;
+            int rowbytes;
 
             explicit png_reader(image_stream_listener & stream_listener);
             virtual ~png_reader() OPENVRML_NOTHROW;
diff -up openvrml-0.18.8/src/mozilla-plugin/openvrml.cpp.xul11 openvrml-0.18.8/src/mozilla-plugin/openvrml.cpp
--- openvrml-0.18.8/src/mozilla-plugin/openvrml.cpp.xul11	2012-03-31 23:55:23.800928150 -0400
+++ openvrml-0.18.8/src/mozilla-plugin/openvrml.cpp	2012-03-31 23:55:23.818928000 -0400
@@ -215,7 +215,7 @@ void openvrml_np_browser_host_set_world_
 {
 }
 
-char * NP_GetMIMEDescription()
+const char * NP_GetMIMEDescription()
 {
     return NPP_GetMIMEDescription();
 }
@@ -380,7 +380,7 @@ NPError NP_GetValue(void *, NPPVariable
     return err;
 }
 
-char * NPP_GetMIMEDescription()
+const char * NPP_GetMIMEDescription()
 {
     static const char mimeDescription[] =
         "model/x3d-vrml:x3dv:X3D world;"
diff -up openvrml-0.18.8/src/script/javascript.cpp.xul11 openvrml-0.18.8/src/script/javascript.cpp
--- openvrml-0.18.8/src/script/javascript.cpp.xul11	2012-03-31 23:55:23.803928125 -0400
+++ openvrml-0.18.8/src/script/javascript.cpp	2012-03-31 23:59:39.028796984 -0400
@@ -37,7 +37,6 @@
 # endif
 
 namespace {
-
 # if OPENVRML_JSPROPERTYOP_USES_JSID
     typedef jsid jspropertyop_id;
 # else
@@ -53,7 +52,7 @@ namespace {
 # endif
     }
 
-    ::int32 jspropertyop_id_to_int(const jspropertyop_id id)
+    int32_t jspropertyop_id_to_int(const jspropertyop_id id)
     {
 # if OPENVRML_JSPROPERTYOP_USES_JSID
         return JSID_TO_INT(id);
@@ -453,7 +452,7 @@ namespace {
     private:
         static OPENVRML_DECLARE_JSNATIVE(construct);
         static JSBool initObject(JSContext * cx, JSObject * obj,
-                                 uint32 x, uint32 y, uint32 comp,
+                                 uint32_t x, uint32_t y, uint32_t comp,
                                  JSObject * pixels_obj)
             OPENVRML_NOTHROW;
         static JSBool getProperty(JSContext * cx, JSObject * obj,
@@ -1553,7 +1552,7 @@ namespace {
     {
         using std::find_if;
 
-        JSString * const str = JS_ValueToString(cx, id);
+        JSString * const str = JSID_TO_STRING(id);
         if (!str) { return JS_FALSE; }
         const char * const eventId = JS_EncodeString(cx, str);
 
@@ -1604,7 +1603,7 @@ namespace {
     {
         using std::find_if;
 
-        JSString * const str = JS_ValueToString(cx, id);
+        JSString * const str = JSID_TO_STRING(id);
         if (!str) { return JS_FALSE; }
         const char * const fieldId = JS_EncodeString(cx, str);
 
@@ -1945,7 +1944,7 @@ namespace {
 
         case field_value::sfint32_id:
         {
-            ::int32 i;
+            int32_t i;
             if (!JS_ValueToECMAInt32(cx, v, &i)) {
                 throw bad_conversion("Numeric value expected.");
             }
@@ -2944,7 +2943,7 @@ namespace {
 
     OPENVRML_DEFINE_MEMBER_JSNATIVE(SFImage, construct)
     {
-        uint32 x = 0, y = 0, comp = 0;
+        uint32_t x = 0, y = 0, comp = 0;
         JSObject * pixels = 0;
         if (!JS_ConvertArguments(cx, argc, OPENVRML_JS_ARGV(cx, vp), "uuuo",
                                  &x, &y, &comp, &pixels)) {
@@ -2981,9 +2980,9 @@ namespace {
 //
     JSBool SFImage::initObject(JSContext * const cx,
                                JSObject * const obj,
-                               const uint32 x,
-                               const uint32 y,
-                               const uint32 comp,
+                               const uint32_t x,
+                               const uint32_t y,
+                               const uint32_t comp,
                                JSObject * const pixels_obj)
         OPENVRML_NOTHROW
     {
@@ -3009,7 +3008,7 @@ namespace {
                     assert(JSVAL_IS_INT(mfdata->array[i]));
                     static const long byteMask[] =
                         { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 };
-                    ::int32 pixel;
+                    int32_t pixel;
                     if (!JS_ValueToInt32(cx, mfdata->array[i], &pixel)) {
                         return JS_FALSE;
                     }
@@ -3281,7 +3280,7 @@ namespace {
                                jsval * const vp)
         OPENVRML_NOTHROW
     {
-        if (!JSVAL_IS_STRING(id)) { return JS_TRUE; }
+        if (!JSID_IS_STRING(id)) { return JS_TRUE; }
 
         assert(JS_GetPrivate(cx, obj));
         const sfield::sfdata & sfdata =
@@ -3296,7 +3295,7 @@ namespace {
         script & s = *static_cast<script *>(JS_GetContextPrivate(cx));
 
         try {
-            const char * eventOut = JS_EncodeString(cx, JSVAL_TO_STRING(id));
+            const char * eventOut = JS_EncodeString(cx, JSID_TO_STRING(id));
             openvrml::event_emitter & emitter =
                 thisNode.value()->event_emitter(eventOut);
             *vp = s.vrmlFieldToJSVal(emitter.value());
@@ -3309,7 +3308,7 @@ namespace {
 
     OPENVRML_DEFINE_MEMBER_JSSTRICTPROPERTYOP(SFNode, setProperty)
     {
-        if (JSVAL_IS_STRING(id)) {
+        if (JSID_IS_STRING(id)) {
             using std::auto_ptr;
             using std::string;
 
@@ -3325,7 +3324,7 @@ namespace {
             boost::intrusive_ptr<openvrml::node> nodePtr = thisNode.value();
 
             const char * const eventInId =
-                JS_EncodeString(cx, JSVAL_TO_STRING(id));
+                JS_EncodeString(cx, JSID_TO_STRING(id));
 
             try {
                 using boost::shared_ptr;
@@ -5366,7 +5365,7 @@ namespace {
         MFData * const mfdata = static_cast<MFData *>(JS_GetPrivate(cx, obj));
         assert(mfdata);
 
-        uint32 new_length;
+        uint32_t new_length;
         if (!JS_ValueToECMAUint32(cx, *vp, &new_length)) { return JS_FALSE; }
 
         if (new_length == mfdata->array.size()) {
@@ -5584,7 +5583,7 @@ namespace {
         MFData * const mfdata = static_cast<MFData *>(JS_GetPrivate(cx, obj));
         assert(mfdata);
 
-        uint32 new_length;
+        uint32_t new_length;
         if (!JS_ValueToECMAUint32(cx, *vp, &new_length)) { return JS_FALSE; }
 
         if (size_t(JSVAL_TO_INT(*vp)) == mfdata->array.size()) {
@@ -5835,7 +5834,7 @@ namespace {
         MFData * const mfdata = static_cast<MFData *>(JS_GetPrivate(cx, obj));
         assert(mfdata);
 
-        uint32 new_length;
+        uint32_t new_length;
         if (!JS_ValueToECMAUint32(cx, *vp, &new_length)) { return JS_FALSE; }
 
         try {
@@ -6239,7 +6238,7 @@ namespace {
                 // Convert the jsval to an int32 and back to a jsval in order
                 // to remove any decimal part.
                 //
-                ::int32 integer;
+                int32_t integer;
                 if (!JS_ValueToECMAInt32(cx, argv[i], &integer)) {
                     return JS_FALSE;
                 }
@@ -6282,7 +6281,7 @@ namespace {
             // Convert the jsval to an int32 and back to a jsval in order
             // to remove any decimal part.
             //
-            ::int32 i;
+            int32_t i;
             if (!JS_ValueToECMAInt32(cx, *vp, &i)) { return JS_FALSE; }
             if (!JS_NewNumberValue(cx, jsdouble(i), &mfdata->array[index])) {
                 return JS_FALSE;
@@ -6301,7 +6300,7 @@ namespace {
         MFData * const mfdata = static_cast<MFData *>(JS_GetPrivate(cx, obj));
         assert(mfdata);
 
-        uint32 new_length;
+        uint32_t new_length;
         if (!JS_ValueToECMAUint32(cx, *vp, &new_length)) { return JS_FALSE; }
 
         try {
@@ -6557,7 +6556,7 @@ namespace {
         MFData * const mfdata = static_cast<MFData *>(JS_GetPrivate(cx, obj));
         assert(mfdata);
 
-        uint32 new_length;
+        uint32_t new_length;
         if (!JS_ValueToECMAUint32(cx, *vp, &new_length)) { return JS_FALSE; }
 
         try {
@@ -6918,7 +6917,7 @@ namespace {
         MFData * const mfdata = static_cast<MFData *>(JS_GetPrivate(cx, obj));
         assert(mfdata);
 
-        uint32 new_length;
+        uint32_t new_length;
         if (!JS_ValueToECMAUint32(cx, *vp, &new_length)) { return JS_FALSE; }
 
         try {
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux