[gtkmathview] + patches from Vincent Untz



commit 0bc2cfa0a47aed2c8a63abd989cb8da4dcceb2ec
Author: Luca <luca ant local>
Date:   Tue Apr 10 16:39:57 2012 +0200

    + patches from Vincent Untz

 CONTRIBUTORS                                   |    4 ++++
 mathmlps/main.cc                               |    7 +++++++
 mathmlsvg/SMS.cc                               |    1 +
 mathmlsvg/main.cc                              |    7 +++++++
 src/frontend/common/TemplateBuilder.hh         |    7 ++++---
 src/frontend/common/TemplateElementIterator.hh |    2 +-
 6 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 8bc4e00..e9e594a 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -43,3 +43,7 @@ In no particular order:
 
 * Matthew Wiebe
   patch for non-italicized lowercase greek letters in ComputerModernShaper.cc
+
+* Vincent Untz
+  patch for gcc 4.7 support
+  patch for missing return in mathmlsvg
diff --git a/mathmlps/main.cc b/mathmlps/main.cc
index 6d1f58e..31e3144 100644
--- a/mathmlps/main.cc
+++ b/mathmlps/main.cc
@@ -25,6 +25,13 @@
 #include <cassert>
 #include <cstring>
 #include <fstream>
+#ifdef __linux__
+/* to get getopt on Linux */
+#ifndef __USE_POSIX2
+#define __USE_POSIX2
+#endif
+#endif
+#include <unistd.h>
 
 #include <popt.h>
 
diff --git a/mathmlsvg/SMS.cc b/mathmlsvg/SMS.cc
index 1f1f9d1..6113f26 100644
--- a/mathmlsvg/SMS.cc
+++ b/mathmlsvg/SMS.cc
@@ -708,6 +708,7 @@ SMS::fun_depart(const HandlerArgs& args) const
   if (asLocation(args[0], loc1) && asLocation(args[1], loc2))
   // delete "return 0" and insert here the code
     return 0;
+  return 0;
 }
 
 SmartPtr<Value>
diff --git a/mathmlsvg/main.cc b/mathmlsvg/main.cc
index fcc9f5c..0cc5515 100644
--- a/mathmlsvg/main.cc
+++ b/mathmlsvg/main.cc
@@ -25,6 +25,13 @@
 #include <cassert>
 #include <cstring>
 #include <fstream>
+#ifdef __linux__
+/* to get getopt on Linux */
+#ifndef __USE_POSIX2
+#define __USE_POSIX2
+#endif
+#endif
+#include <unistd.h>
 
 #include <popt.h>
 
diff --git a/src/frontend/common/TemplateBuilder.hh b/src/frontend/common/TemplateBuilder.hh
index 308d830..f4fb202 100644
--- a/src/frontend/common/TemplateBuilder.hh
+++ b/src/frontend/common/TemplateBuilder.hh
@@ -51,12 +51,13 @@ protected:
   SmartPtr<typename ElementBuilder::type>
   getElement(const typename Model::Element& el) const
   {
-    if (SmartPtr<typename ElementBuilder::type> elem = smart_cast<typename ElementBuilder::type>(linkerAssoc(el)))
+    SmartPtr<typename ElementBuilder::type> elem;
+    if (elem = smart_cast<typename ElementBuilder::type>(this->linkerAssoc(el)))
       return elem;
     else
       {
-	SmartPtr<typename ElementBuilder::type> elem = ElementBuilder::type::create(ElementBuilder::getContext(*this));
-	linkerAdd(el, elem);
+	elem = ElementBuilder::type::create(ElementBuilder::getContext(*this));
+	this->linkerAdd(el, elem);
 	return elem;
       }
   }
diff --git a/src/frontend/common/TemplateElementIterator.hh b/src/frontend/common/TemplateElementIterator.hh
index 0e86198..3ab3094 100644
--- a/src/frontend/common/TemplateElementIterator.hh
+++ b/src/frontend/common/TemplateElementIterator.hh
@@ -47,7 +47,7 @@ protected:
   findValidNodeForward(const typename Model::Node& p0) const
   {
     for (typename Model::Node p = p0; p; p = Model::getNextSibling(p))
-      if (valid(p)) return Model::asElement(p);
+      if (this->valid(p)) return Model::asElement(p);
     return typename Model::Element();
   }
     



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