[Fresco-devel] g++ 3.4 update

Tobias Hunger <[email protected]> Sun, 9 May 2004 00:04:52 +0200
Newsgroups gmane.comp.video.fresco.devel
Message-ID <[email protected]>
This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_heaven-17078-1084054049-0001-2
Content-Type: multipart/mixed; boundary="NzB8fVQJ5HfG6fxh"
Content-Disposition: inline


--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi there!

Here's a patch to make fresco build with g++ 3.4. It is untested
(I need to build omni with gcc 3.4 and have not yet gotten around
to that yet). That's why I have not checked it in. Use with care.

THERE WILL BE PROBLEMS!

--=20
Gruss,
Tobias

------------------------------------------------------------
Tobias Hunger           The box said: 'Windows 95 or better'
[email protected]                      So I installed Linux.
------------------------------------------------------------

--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="g++-3.4_update.diff"
Content-Transfer-Encoding: quoted-printable

diff -urN -x tags -x TAGS -x .svn -x BUILD -x .cvsignore -x CVS -x 'autom4t=
e.*' -x aclocal.m4 -x acconfig.hh.in -x configure -x '*~' -x '.#*' -x Doxyf=
ile -x '*.kdevelop*' -x '*.kdevses' ./Babylon/include/Babylon/internal/trai=
ts.hh /home/hunger/c/Fresco/original/Babylon/include/Babylon/internal/trait=
s.hh
--- ./Babylon/include/Babylon/internal/traits.hh	2003-08-01 18:47:11.000000=
000 +0200
+++ /home/hunger/c/Fresco/original/Babylon/include/Babylon/internal/traits.=
hh	2004-05-05 20:24:17.000000000 +0200
@@ -85,7 +85,7 @@
     static state_type get_state(pos_type p) {} // FIXME: What should go he=
re?
 };
=20
-}; // namespace std
+} // namespace std
=20
 #endif // __GNUC__ >=3D 3
=20
diff -urN -x tags -x TAGS -x .svn -x BUILD -x .cvsignore -x CVS -x 'autom4t=
e.*' -x aclocal.m4 -x acconfig.hh.in -x configure -x '*~' -x '.#*' -x Doxyf=
ile -x '*.kdevelop*' -x '*.kdevses' ./Babylon/src/traits.cc /home/hunger/c/=
Fresco/original/Babylon/src/traits.cc
--- ./Babylon/src/traits.cc	2003-12-29 09:42:48.000000000 +0100
+++ /home/hunger/c/Fresco/original/Babylon/src/traits.cc	2004-05-08 16:13:4=
2.000000000 +0200
@@ -96,11 +96,12 @@
   return(i);
 }
=20
-
+#if defined __GNUC__ && defined __GNUC_MINOR__ && \
+    ( __GNUC__ =3D=3D 3 && __GNUC_MINOR__ < 4 )=20
=20
 void
 std::char_traits<Babylon::UCS2>::assign(char_type & c1,
-                    const char_type & c2)
+                                        const char_type & c2)
 { c1 =3D c2; }
=20
 std::char_traits<Babylon::UCS2>::char_type
@@ -294,6 +295,7 @@
     return(Babylon::UCS4(Babylon::UC_NOT_A_CHAR));
   return(i);
 }
+#endif // GCC version < 3.4
=20
 }; // namespace std
=20
diff -urN -x tags -x TAGS -x .svn -x BUILD -x .cvsignore -x CVS -x 'autom4t=
e.*' -x aclocal.m4 -x acconfig.hh.in -x configure -x '*~' -x '.#*' -x Doxyf=
ile -x '*.kdevelop*' -x '*.kdevses' ./Berlin/include/Berlin/GapBuffer.hh /h=
ome/hunger/c/Fresco/original/Berlin/include/Berlin/GapBuffer.hh
--- ./Berlin/include/Berlin/GapBuffer.hh	2004-02-08 00:36:41.000000000 +0100
+++ /home/hunger/c/Fresco/original/Berlin/include/Berlin/GapBuffer.hh	2004-=
05-08 20:52:16.000000000 +0200
@@ -56,124 +56,126 @@
       typedef typename rep_type::value_type value_type;
       typedef typename rep_type::iterator iterator;
       typedef unsigned int size_type;
-      iterator gbegin() { return begin() + my_gapbegin;}
-      iterator gend() { return begin() + my_gapend;}
-      iterator cursor() { return begin() + my_cursor;}
+      iterator gbegin() { return this->begin() + my_gapbegin; }
+      iterator gend() { return this->begin() + my_gapend; }
+      iterator cursor() { return this->begin() + my_cursor; }
       void newgap()
       {
-      rep_type::insert(gbegin(), gapsize, value_type(0));
-      my_gapend +=3D gapsize;
+          rep_type::insert(gbegin(), gapsize, value_type(0));
+          my_gapend +=3D gapsize;
       }
       void movegap(int d)
       {
-      if (d > 0)
-      {
-          if (gend() + d > end())
-          rep_type::insert(end(), size_type(gend() + d - end()),
-                   value_type(0));
-          copy(gend(), gend() + d, gbegin());
-      }
-      else
-          copy(rep_type::reverse_iterator(gbegin()),
-           rep_type::reverse_iterator(gbegin() + d),
-           rep_type::reverse_iterator(gend()));
-      my_gapbegin +=3D d, my_gapend +=3D d;
+          if (d > 0)
+          {
+              if (gend() + d > this->end())
+                  rep_type::insert(this->end(),
+                                   size_type(gend() + d - this->end()),
+                                   value_type(0));
+              copy(gend(), gend() + d, gbegin());
+          }
+          else
+              copy(typename rep_type::reverse_iterator(gbegin()),
+                   typename rep_type::reverse_iterator(gbegin() + d),
+                   typename rep_type::reverse_iterator(gend()));
+          my_gapbegin +=3D d, my_gapend +=3D d;
       }
       size_type gap() { return my_gapend - my_gapbegin; }
       void editing()
       { size_type d =3D my_cursor - my_gapbegin; if (d !=3D 0) movegap(d);=
 }
       void compact()
-      { size_type d =3D end() - gend(); if (d > 0) movegap(d); }
+      { size_type d =3D this->end() - gend(); if (d > 0) movegap(d); }
     public:
-      GapBuffer() : my_cursor(0), my_gapbegin(0), my_gapend(0) {}
-      size_type size() { compact(); return gbegin() - begin(); }
+      GapBuffer() : my_cursor(0), my_gapbegin(0), my_gapend(0) { }
+      size_type size() { compact(); return gbegin() - this->begin(); }
       void forward()
       {
-      if (my_cursor =3D=3D my_gapbegin && gend() !=3D end())
-          my_cursor +=3D gap();
-      else if (cursor() < end()) my_cursor++;
+          if (my_cursor =3D=3D my_gapbegin && gend() !=3D this->end())
+              my_cursor +=3D gap();
+          else if (cursor() < this->end()) my_cursor++;
       }
       void backward()
       {
-      if (my_cursor =3D=3D my_gapend)
+          if (my_cursor =3D=3D my_gapend)
 	      if (gap())
-		      my_cursor -=3D gap();
+                  my_cursor -=3D gap();
 	      else
-		      my_cursor--;
-      else if (cursor() > begin()) my_cursor--;
+                  my_cursor--;
+          else if (cursor() > this->begin()) my_cursor--;
       }
       void shift(size_type d)
       {
-      size_type tmp =3D my_cursor + d;
-      if ((my_cursor > my_gapend && tmp > my_gapend) ||
-          (my_cursor <=3D my_gapbegin && tmp <=3D my_gapbegin))
-          my_cursor =3D tmp;
-      else if (d < 0) my_cursor +=3D d - gap();
-      else my_cursor +=3D d + gap();
+          size_type tmp =3D my_cursor + d;
+          if ((my_cursor > my_gapend && tmp > my_gapend) ||
+              (my_cursor <=3D my_gapbegin && tmp <=3D my_gapbegin))
+              my_cursor =3D tmp;
+          else if (d < 0) my_cursor +=3D d - gap();
+          else my_cursor +=3D d + gap();
       }
       size_type position()
-      { return my_cursor > my_gapend ? my_cursor - gap() : my_cursor;}
-      void position(size_type p) { shift(p - my_cursor);}
+      { return my_cursor > my_gapend ? my_cursor - gap() : my_cursor; }
+      void position(size_type p) { shift(p - my_cursor); }
       void insert(value_type u)
       {
-      editing();
-      if (!gap()) newgap();
-      *cursor() =3D u;
-      my_cursor++, my_gapbegin++;
+          editing();
+          if (!gap()) newgap();
+          *cursor() =3D u;
+          my_cursor++, my_gapbegin++;
       }
       void insert(value_type *u, size_type n)
       {
-      editing();
-      rep_type::insert(cursor(), u, u + n);
-      my_cursor +=3D n, my_gapbegin +=3D n, my_gapend +=3D n;
+          editing();
+          rep_type::insert(cursor(), u, u + n);
+          my_cursor +=3D n, my_gapbegin +=3D n, my_gapend +=3D n;
       }
       void remove_backward(size_type n)
       {
-      if (my_cursor <=3D my_gapbegin)
-      {
-          if (my_cursor < n) n =3D my_cursor;
-          erase(cursor() - n, cursor());
-          my_cursor -=3D n, my_gapbegin -=3D n, my_gapend -=3D n;
-      }
-      else if (my_cursor - my_gapend > n)
-      {
-          erase(cursor() - n, cursor());
-          my_cursor -=3D n;
-      }
-      else
-      {
-          size_type d =3D my_cursor - my_gapend;
-          erase(gbegin() - (n - d), gbegin());
-          erase(cursor() - d, cursor());
-          my_gapbegin -=3D n - d, my_gapend -=3D n - d;
-          my_cursor -=3D n;
-      }
+          if (my_cursor <=3D my_gapbegin)
+          {
+              if (my_cursor < n) n =3D my_cursor;
+              erase(cursor() - n, cursor());
+              my_cursor -=3D n, my_gapbegin -=3D n, my_gapend -=3D n;
+          }
+          else if (my_cursor - my_gapend > n)
+          {
+              erase(cursor() - n, cursor());
+              my_cursor -=3D n;
+          }
+          else
+          {
+              size_type d =3D my_cursor - my_gapend;
+              erase(gbegin() - (n - d), gbegin());
+              erase(cursor() - d, cursor());
+              my_gapbegin -=3D n - d, my_gapend -=3D n - d;
+              my_cursor -=3D n;
+          }
       }
       void remove_forward(size_type n)
       {
-      if (my_cursor >=3D my_gapend)
-      {
-          if (size_type(end() - cursor()) < n) n =3D end() - cursor();
-          erase(cursor(), cursor() + n);
-      }
-      else if (my_gapbegin - my_cursor > n)
-      {
-          erase(cursor(), cursor() + n);
-          my_gapbegin -=3D n, my_gapend -=3D n;
-      }
-      else
-      {
-          size_type d =3D my_gapbegin - my_cursor;
-          erase(gend(), gend() + (n - d));
-          erase(cursor(), cursor() + d);
-          my_gapbegin -=3D d, my_gapend -=3D d;
-      }
+          if (my_cursor >=3D my_gapend)
+          {
+              if (size_type(this->end() - cursor()) < n)
+                  n =3D this->end() - cursor();
+              erase(cursor(), cursor() + n);
+          }
+          else if (my_gapbegin - my_cursor > n)
+          {
+              erase(cursor(), cursor() + n);
+              my_gapbegin -=3D n, my_gapend -=3D n;
+          }
+          else
+          {
+              size_type d =3D my_gapbegin - my_cursor;
+              erase(gend(), gend() + (n - d));
+              erase(cursor(), cursor() + d);
+              my_gapbegin -=3D d, my_gapend -=3D d;
+          }
       }
-      const value_type *get() { compact(); return &*begin(); }
+      const value_type *get() { compact(); return &*(this->begin()); }
       void clear_buffer()
       {
-      position(0);
-      remove_forward(size());
+          position(0);
+          remove_forward(size());
       }
     private:
       size_type my_cursor;
diff -urN -x tags -x TAGS -x .svn -x BUILD -x .cvsignore -x CVS -x 'autom4t=
e.*' -x aclocal.m4 -x acconfig.hh.in -x configure -x '*~' -x '.#*' -x Doxyf=
ile -x '*.kdevelop*' -x '*.kdevses' ./Berlin/include/Berlin/QuadTree.hh /ho=
me/hunger/c/Fresco/original/Berlin/include/Berlin/QuadTree.hh
--- ./Berlin/include/Berlin/QuadTree.hh	2004-01-13 23:34:20.000000000 +0100
+++ /home/hunger/c/Fresco/original/Berlin/include/Berlin/QuadTree.hh	2004-0=
5-08 20:15:43.000000000 +0200
@@ -48,7 +48,7 @@
       move_down(QTNode<T, I> *n) : node(n) {}
       bool operator()(I i)
       {
-          QTNode<T, I>::index idx =3D node->where(i);
+          typename QTNode<T, I>::index idx =3D node->where(i);
           if (idx !=3D QTNode<T, I>::fence)
           {
           node->my_quadrants[idx]->insert(i);
@@ -315,7 +315,7 @@
       else my_quadrants[idx]->remove(i);
       my_elements--;
      =20
-      if (my_boundingbox.touches(i->bbox(), epsilon))
+      if (my_boundingbox.touches(i->bbox(), Geometry::epsilon))
       {
       my_boundingbox.clear();
       bool first =3D true;
diff -urN -x tags -x TAGS -x .svn -x BUILD -x .cvsignore -x CVS -x 'autom4t=
e.*' -x aclocal.m4 -x acconfig.hh.in -x configure -x '*~' -x '.#*' -x Doxyf=
ile -x '*.kdevelop*' -x '*.kdevses' ./Berlin/include/Berlin/ServerImpl.hh /=
home/hunger/c/Fresco/original/Berlin/include/Berlin/ServerImpl.hh
--- ./Berlin/include/Berlin/ServerImpl.hh	2003-12-29 09:42:51.000000000 +01=
00
+++ /home/hunger/c/Fresco/original/Berlin/include/Berlin/ServerImpl.hh	2004=
-05-08 20:03:42.000000000 +0200
@@ -154,17 +154,19 @@
       typename K::_var_type reference;
       try
       {
-      reference =3D K::_narrow(Fresco::Kit_var(kit->_this()));
+          reference =3D K::_narrow(Fresco::Kit_var(kit->_this()));
       }
       catch (CORBA::Exception &e)
       {
-      std::cerr << "Cannot narrow reference: " << e << std::endl;
-      return K::_nil();
+          // FIXEM: Report more information on exception (s. H&V p. 321)
+          std::cerr << "Cannot narrow reference to CORBA exception."
+                    << std::endl;
+          return K::_nil();
       }
       if (CORBA::is_nil(reference))
       {
-      std::cerr << "Reference has incorrect type" << std::endl;
-      return K::_nil();
+          std::cerr << "Reference has incorrect type" << std::endl;
+          return K::_nil();
       }
       my_kits.push_back(kit);
       return reference._retn();
diff -urN -x tags -x TAGS -x .svn -x BUILD -x .cvsignore -x CVS -x 'autom4t=
e.*' -x aclocal.m4 -x acconfig.hh.in -x configure -x '*~' -x '.#*' -x Doxyf=
ile -x '*.kdevelop*' -x '*.kdevses' ./Berlin/src/PNG.cc /home/hunger/c/Fres=
co/original/Berlin/src/PNG.cc
--- ./Berlin/src/PNG.cc	2004-01-13 23:34:21.000000000 +0100
+++ /home/hunger/c/Fresco/original/Berlin/src/PNG.cc	2004-05-08 16:59:52.00=
0000000 +0200
@@ -129,7 +129,8 @@
 inline void PNG::Encoder::flush(png_structp png_ptr)=20
 {
     std::streambuf *sbuf =3D static_cast<std::streambuf *>(png_ptr->io_ptr=
);
-#ifdef __GLIBCPP__
+#if defined __GLIBCPP__ || (defined __GNUC__ && defined __GNUC_MINOR__ && \
+                            (__GNUC__ =3D=3D 3 && __GNUC_MINOR__ >=3D 4))
     sbuf->pubsync();
 #else
     sbuf->sync();

--NzB8fVQJ5HfG6fxh--

--=_heaven-17078-1084054049-0001-2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Transfer-Encoding: 7bit
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAnVmEv0FZW3NyoqURAnrOAJ961MOV5/dwYYO38QnulBq0ZdjS1ACgqOts
PuU5ZHVQtLFZ9J9lFZgpXfA=
=S9FV
-----END PGP SIGNATURE-----

--=_heaven-17078-1084054049-0001-2--