Got rid of those int/ptr warnings on AMD64. (The code was

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: https://svn.code.sf.net/p/freeglut/code/trunk@413 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
rkrolib 2003-12-22 22:13:20 +00:00
parent 69c32f5e17
commit 38fb597973

View 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. * 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->found = GL_TRUE;
enumerator->data = window; enumerator->data = window;
@ -543,7 +543,7 @@ SFG_Window* fgWindowByID( int windowID )
* Uses a method very similiar for fgWindowByHandle... * Uses a method very similiar for fgWindowByHandle...
*/ */
enumerator.found = GL_FALSE; enumerator.found = GL_FALSE;
enumerator.data = ( void * )windowID; /* XXX int/pointer conversion! */ enumerator.data = ( void * )&windowID;
fgEnumWindows( fghcbWindowByID, &enumerator ); fgEnumWindows( fghcbWindowByID, &enumerator );
if( enumerator.found ) if( enumerator.found )
return ( SFG_Window * )enumerator.data; return ( SFG_Window * )enumerator.data;