[Gmsh] Minor patch for gmsh

Mark van Doesburg mark.van.doesburg at technolution.nl
Fri Jan 9 09:41:37 CET 2009


Hello,

I've compiled the latest nightly build of gmsh on a 64 bit machine using
gcc-4.3.2 and encoutered a building problem. The attached patch allowed me
to build correctly.

regards, 

Mark van Doesburg
-------------- next part --------------
diff -ur orig/gmsh-2.3.0-cvs-20090107/contrib/TreeBrowser/Flu_Tree_Browser.cpp gmsh-2.3.0-cvs-20090107/contrib/TreeBrowser/Flu_Tree_Browser.cpp
--- orig/gmsh-2.3.0-cvs-20090107/contrib/TreeBrowser/Flu_Tree_Browser.cpp	2008-12-28 11:26:34.000000000 +0100
+++ gmsh-2.3.0-cvs-20090107/contrib/TreeBrowser/Flu_Tree_Browser.cpp	2009-01-07 23:28:15.933968480 +0100
@@ -2677,12 +2677,12 @@
   return add( path, p.c_str(), w, showLabel );
 }
 
-unsigned int Flu_Tree_Browser :: remove( const char *fullpath )
+size_t Flu_Tree_Browser :: remove( const char *fullpath )
 {
-  return( (unsigned int)root.modify( fullpath, Node::REMOVE, rdata ) );
+  return( size_t(root.modify( fullpath, Node::REMOVE, rdata )) );
 }
 
-unsigned int Flu_Tree_Browser :: remove( const char *path, const char *text )
+size_t Flu_Tree_Browser :: remove( const char *path, const char *text )
 {
   // if the path does not end in '/', add it
   std::string s = path;
@@ -2692,12 +2692,12 @@
   return remove( s.c_str() );
 }
 
-unsigned int Flu_Tree_Browser :: remove( unsigned int id )
+size_t Flu_Tree_Browser :: remove( size_t id )
 {
   return root.remove( id );
 }
 
-unsigned int Flu_Tree_Browser :: Node :: remove( unsigned int id )
+size_t Flu_Tree_Browser :: Node :: remove( size_t id )
 {
   if( id == 0 )
     return 0;
@@ -2724,12 +2724,12 @@
   return 0;
 }
 
-unsigned int Flu_Tree_Browser :: remove( Fl_Widget *w )
+size_t Flu_Tree_Browser :: remove( Fl_Widget *w )
 {
   return root.remove( w );
 }
 
-unsigned int Flu_Tree_Browser :: Node :: remove( Fl_Widget *w )
+size_t Flu_Tree_Browser :: Node :: remove( Fl_Widget *w )
 {
   if( !w )
     return 0;
@@ -2807,12 +2807,12 @@
   return find( s.c_str() );
 }
 
-Flu_Tree_Browser::Node* Flu_Tree_Browser :: find( unsigned int id )
+Flu_Tree_Browser::Node* Flu_Tree_Browser :: find( size_t id )
 {
   return root.find( id );
 }
 
-Flu_Tree_Browser::Node* Flu_Tree_Browser :: Node :: find( unsigned int id )
+Flu_Tree_Browser::Node* Flu_Tree_Browser :: Node :: find( size_t id )
 {
   if( id == 0 )
     return NULL;
@@ -2852,7 +2852,7 @@
 }
 
 
-bool Flu_Tree_Browser :: Node :: findPath( unsigned int id, RData &rdata )
+bool Flu_Tree_Browser :: Node :: findPath( size_t id, RData &rdata )
 {
   if( _id == id )
     {
@@ -2926,7 +2926,7 @@
   return false;
 }
 
-const char* Flu_Tree_Browser :: find_path( unsigned int id )
+const char* Flu_Tree_Browser :: find_path( size_t id )
 {
   // degenerate case: the root is always id==0
   if( id == 0 )
diff -ur orig/gmsh-2.3.0-cvs-20090107/contrib/TreeBrowser/Flu_Tree_Browser.h gmsh-2.3.0-cvs-20090107/contrib/TreeBrowser/Flu_Tree_Browser.h
--- orig/gmsh-2.3.0-cvs-20090107/contrib/TreeBrowser/Flu_Tree_Browser.h	2008-12-28 20:47:58.000000000 +0100
+++ gmsh-2.3.0-cvs-20090107/contrib/TreeBrowser/Flu_Tree_Browser.h	2009-01-07 23:28:31.149383979 +0100
@@ -250,7 +250,7 @@
 
   //! Find the entry identified by unique id \b id
   /*! \return a pointer to the Node of the found entry, or NULL if no matching entry was found */
-  Node* find( unsigned int id );
+  Node* find( size_t id );
 
   //! Search for Node \b n in the tree
   /*! \return a pointer to \b n if it is found, or NULL if it is not in the tree */
@@ -277,7 +277,7 @@
 
   //! \return the full path of the entry identified by unique id \b id, or the empty string if no matching entry was found
   /*! \note the returned value is only valid until the next time find_path() is called */
-  const char* find_path( unsigned int id );
+  const char* find_path( size_t id );
 
   //! \return the full path of the entry containing the widget \b w, or the empty string if no matching entry was found
   /*! \note the returned value is only valid until the next time find_path() is called */
@@ -417,23 +417,23 @@
 
   //! Remove the entry identified by path \b fullpath from the tree
   /*! \return the unique id of the removed entry, or \c 0 if no matching entry was found */
-  unsigned int remove( const char *fullpath );
+  size_t remove( const char *fullpath );
 
   //! Remove entry \b name in path \b path from the tree
   /*! \return the unique id of the removed entry, or \c 0 if no matching entry was found */
-  unsigned int remove( const char *path, const char *name );
+  size_t remove( const char *path, const char *name );
 
   //! Remove the entry identified by unique id \b id from the tree
   /*! \return the unique id of the removed entry, or \c 0 if no matching entry was found */
-  unsigned int remove( unsigned int id );
+  size_t remove( size_t id );
 
   //! Remove the entry containing the widget \b w from the tree. Note that the widget is automatically destroyed
   /*! \return the unique id of the removed entry, or \c 0 if no matching entry was found */
-  unsigned int remove( Fl_Widget *w );
+  size_t remove( Fl_Widget *w );
 
   //! Remove Node \b n from the tree
   /*! \return the id of \b n on successful removal, or \c 0 if \b n is not in the tree */
-  inline unsigned int remove( Node* n )
+  inline size_t remove( Node* n )
     { if( !n ) return 0; else return remove( n->id() ); }
 
   //! Override of Fl_Widget::resize
@@ -579,11 +579,11 @@
   //! Override of Fl_Widget::when. Currently only FL_WHEN_NEVER, FL_WHEN_CHANGED, and FL_WHEN_NOT_CHANGED are supported. Default value is FL_WHEN_CHANGED
   /*! When the callback occurs, you can use callback_reason() to determine exactly what cause the callback and callback_node()
     to get the node that was affected. */
-  //inline void when( unsigned int w )
+  //inline void when( size_t w )
   //{ rdata.when = w; }
 
   //! Override of Fl_Widget::when
-  //inline unsigned int when() const
+  //inline size_t when() const
   //{ return rdata.when; }
 
   //! Set the gap between the widget and the icon that precedes it. Default is 2
@@ -643,7 +643,7 @@
     int delta, shadedIndex, counter, searchIndex, branchIconW, dragPos, dragWhere;
     Fl_Color lineColor, bgColor, selectionColor;
     bool forceResize;  // force the browser to resize on the next draw (which forces a recalculation of the tree layout)
-    unsigned int nextId;  // monotonically increasing id of each entry
+    size_t nextId;  // monotonically increasing id of each entry
     std::string path;  // used to construct the full path during a findPath() operation
     std::vector<int> branchConnectors;
 
@@ -664,7 +664,7 @@
     int browserX, browserY, browserW, browserH;
     Node *root;
     Flu_Tree_Browser *tree;
-    unsigned int cbReason;
+    size_t cbReason;
     Node *cbNode, *lastOpenBranch;
   };
 
@@ -819,7 +819,7 @@
 
       //! Find the entry identified by unique id \b id
       /*! \return a pointer to the Node of the found entry, or NULL if no matching entry was found */
-      Node* find( unsigned int id );
+      Node* find( size_t id );
 
       //! Find the entry containing the widget \b w
       /*! \return a pointer to the Node of the found entry, or NULL if no matching entry was found */
@@ -865,7 +865,7 @@
 	{ return CHECK(ICON_AT_END); }
 
       //! Get the unique ID of this node
-      inline unsigned int id() const
+      inline size_t id() const
 	{ return _id; }
 
       //! Get the index this node is (as a child) in its parent's list
@@ -1018,20 +1018,20 @@
 
       //! Remove the entry identified by path \b fullpath from this node
       /*! \return the unique id of the removed entry, or \c 0 if no matching entry was found */
-      inline unsigned int remove( const char *fullpath )
-	{ return( (unsigned int)modify( fullpath, REMOVE, tree->rdata ) ); }
+      inline size_t remove( const char *fullpath )
+	{ return( (size_t)modify( fullpath, REMOVE, tree->rdata ) ); }
 
       //! Remove the entry identified by unique id \b id from this node
       /*! \return the unique id of the removed entry, or \c 0 if no matching entry was found */
-      unsigned int remove( unsigned int id );
+      size_t remove( size_t id );
 
       //! Remove the node containing the widget \b w from this node. Note that the widget is automatically destroyed
       /*! \return the unique id of the removed entry, or \c 0 if no matching entry was found */
-      unsigned int remove( Fl_Widget *w );
+      size_t remove( Fl_Widget *w );
 
       //! Remove Node \b n
       /*! \return the id of \b n on successful removal, or \c 0 if \b n is present */
-      inline unsigned int remove( Node* n )
+      inline size_t remove( Node* n )
 	{ if( !n ) return 0; else return remove( n->id() ); }
 
       //! Select this entry and all child entries
@@ -1109,7 +1109,7 @@
       void draw( RData &rdata, bool measure );
 
       // recursively finding the full path of the node identified by id
-      bool findPath( unsigned int id, RData &rdata );
+      bool findPath( size_t id, RData &rdata );
 
       // recursively finding the full path of the node containing w
       bool findPath( Fl_Widget *w, RData &rdata );
@@ -1123,7 +1123,7 @@
 	  void *CBData;
 	};
 
-      unsigned int _id; // the unique id of this node
+      size_t _id; // the unique id of this node
       unsigned short flags;
       NodeList _children;
       Node *_parent;
Only in gmsh-2.3.0-cvs-20090107/contrib/TreeBrowser/: Flu_Tree_Browser.o