Hi!

Find attached a patch that fixes a conversion error to unsigned int on
systems where sizeof(void*) != sizeof(unsigned int).

In other words, this fixes the build issue on amd64, I've tested it with
Linux on amd64 (and i386 to make sure nothing breaks), but it may also
be necessary for 64bits OSX (Snow Leopard on Xserve).

It's a quick&dirty approach, I was able to start animata and load
something from the example directory (I haven't used animata before, so
I don't know how to work with it, yet).

If the patch survives your testing, please feel free to include it in
your svn. If FLU is upstream code, please also forward it to your
upstream.


HTH

PS: Somebody has now pointed out a patch in
<http://code.google.com/p/animata/issues/detail?id=38>. It's almost the
same, though uintptr_t is the generic approach required by C99 and
doesn't rely on the coincidence that sizeof(unsigned long) matches
sizeof(void*).

-- 
mail: a...@thur.de      http://adi.thur.de      PGP/GPG: key via keyserver

I haven't lost my mind; it's backed up on tape somewhere!
Index: src/libs/FLU/Flu_Tree_Browser.cpp
===================================================================
--- src/libs/FLU/Flu_Tree_Browser.cpp	(revision 49)
+++ src/libs/FLU/Flu_Tree_Browser.cpp	(working copy)
@@ -2981,12 +2981,12 @@
   return add( path, p.c_str(), w, showLabel );
 }
 
-unsigned int Flu_Tree_Browser :: remove( const char *fullpath )
+uintptr_t Flu_Tree_Browser :: remove( const char *fullpath )
 {
-  return( (unsigned int)root.modify( fullpath, Node::REMOVE, rdata ) );
+  return( (uintptr_t) root.modify( fullpath, Node::REMOVE, rdata ) );
 }
 
-unsigned int Flu_Tree_Browser :: remove( const char *path, const char *text )
+uintptr_t Flu_Tree_Browser :: remove( const char *path, const char *text )
 {
   // if the path does not end in '/', add it
   FluSimpleString s = path;
@@ -2996,12 +2996,12 @@
   return remove( s.c_str() );
 }
 
-unsigned int Flu_Tree_Browser :: remove( unsigned int id )
+uintptr_t Flu_Tree_Browser :: remove( unsigned int id )
 {
   return root.remove( id );
 }
 
-unsigned int Flu_Tree_Browser :: Node :: remove( unsigned int id )
+uintptr_t Flu_Tree_Browser :: Node :: remove( unsigned int id )
 {
   if( id == 0 )
     return 0;
@@ -3028,12 +3028,12 @@
   return 0;
 }
 
-unsigned int Flu_Tree_Browser :: remove( Fl_Widget *w )
+uintptr_t Flu_Tree_Browser :: remove( Fl_Widget *w )
 {
   return root.remove( w );
 }
 
-unsigned int Flu_Tree_Browser :: Node :: remove( Fl_Widget *w )
+uintptr_t Flu_Tree_Browser :: Node :: remove( Fl_Widget *w )
 {
   if( !w )
     return 0;
Index: src/libs/FLU/Flu_Tree_Browser.h
===================================================================
--- src/libs/FLU/Flu_Tree_Browser.h	(revision 49)
+++ src/libs/FLU/Flu_Tree_Browser.h	(working copy)
@@ -19,6 +19,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <stdint.h>
 
 //#define USE_FLU_DND
 
@@ -436,23 +437,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 );
+  uintptr_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 );
+  uintptr_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 );
+  uintptr_t remove( unsigned int 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 );
+  uintptr_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 uintptr_t remove( Node* n )
     { if( !n ) return 0; else return remove( n->id() ); }
 
   //! Override of Fl_Widget::resize
@@ -1077,20 +1078,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 uintptr_t remove( const char *fullpath )
+	{ return( (uintptr_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 );
+      uintptr_t remove( unsigned int 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 );
+      uintptr_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 uintptr_t remove( Node* n )
 	{ if( !n ) return 0; else return remove( n->id() ); }
 
       //! Select this entry and all child entries
_______________________________________________
animata-devel mailing list
animata-devel@lists.kitchenbudapest.hu
http://lists.kitchenbudapest.hu/cgi-bin/mailman/listinfo/animata-devel

Reply via email to