Got rid of those int/ptr warnings on AMD64. (The code was
authorRichard Rauch <rkr@olib.org>
Mon, 22 Dec 2003 22:13:20 +0000 (22:13 +0000)
committerRichard Rauch <rkr@olib.org>
Mon, 22 Dec 2003 22:13:20 +0000 (22:13 +0000)
casting an {int} to a pointer, and later retrieving the int
by another cast.  It should be safe provided that pointers
are at least as big as {int}, but GCC was giving warnings on
my system, so...fixed.)

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@413 7f0cb862-5218-0410-a997-914c9d46530a

src/freeglut_structure.c

index 71f9e45..8b0a837 100644 (file)
@@ -516,7 +516,7 @@ static void fghcbWindowByID( SFG_Window *window, SFG_Enumerator *enumerator )
     /*
      * Check the window's handle. Hope this works. Looks ugly. That's for sure.
      */
-    if( window->ID == ( int )(enumerator->data) ) /* XXX int/ptr conversion! */
+    if( window->ID == *( int *)(enumerator->data) )
     {
         enumerator->found = GL_TRUE;
         enumerator->data = window;
@@ -543,7 +543,7 @@ SFG_Window* fgWindowByID( int windowID )
      * Uses a method very similiar for fgWindowByHandle...
      */
     enumerator.found = GL_FALSE;
-    enumerator.data = ( void * )windowID; /* XXX int/pointer conversion! */
+    enumerator.data = ( void * )&windowID;
     fgEnumWindows( fghcbWindowByID, &enumerator );
     if( enumerator.found )
         return ( SFG_Window * )enumerator.data;