cleaned up a bunch of warnings

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1573 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2013-04-01 15:40:51 +00:00
parent b7bbf6277e
commit 2811836c94
6 changed files with 14 additions and 12 deletions

View File

@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
static int sequence_number = 0 ;
@ -80,15 +81,19 @@ Mod2Text(int mods, char *text)
if (mods&GLUT_ACTIVE_CTRL)
strcat(text,"CTRL");
if (mods&GLUT_ACTIVE_SHIFT)
{
if (text[0])
strcat(text,"+SHIFT");
else
strcat(text,"SHIFT");
}
if (mods&GLUT_ACTIVE_ALT)
{
if (text[0])
strcat(text,"+ALT");
else
strcat(text,"ALT");
}
if (!text[0])
strcat(text,"none");
@ -213,7 +218,7 @@ Display(void)
static void
Warning(const char *fmt, va_list ap)
{
printf("%6d Warning callback:\n");
printf("%6d Warning callback:\n",++sequence_number);
/* print warning message */
vprintf(fmt, ap);
@ -223,7 +228,7 @@ static void
Error(const char *fmt, va_list ap)
{
char dummy_string[STRING_LENGTH];
printf("%6d Error callback:\n");
printf("%6d Error callback:\n",++sequence_number);
/* print warning message */
vprintf(fmt, ap);

View File

@ -311,8 +311,6 @@ void readConfigFile ( char *fnme )
int
main(int argc, char *argv[])
{
int fractal_window ;
glutInitWindowSize(500, 250);
glutInitWindowPosition ( 140, 140 );
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE );
@ -323,7 +321,7 @@ main(int argc, char *argv[])
else
readConfigFile ( "fractals.dat" ) ;
fractal_window = glutCreateWindow( window_title );
glutCreateWindow( window_title );
glClearColor(1.0, 1.0, 1.0, 1.0);

View File

@ -355,8 +355,6 @@ void readConfigFile ( char *fnme )
int
main(int argc, char *argv[])
{
int fractal_window ;
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE );
glutInitWindowSize(500, 250);
@ -368,7 +366,7 @@ main(int argc, char *argv[])
else
readConfigFile ( "fractals.dat" ) ;
fractal_window = glutCreateWindow( window_title );
glutCreateWindow( window_title );
glClearColor(1.0, 1.0, 1.0, 1.0);

View File

@ -220,8 +220,7 @@ void mouse_cb ( int button, int updown, int x, int y )
{
if ( updown == GLUT_DOWN )
{
double dist = 1.0e20 ; /* A very large number */
dist = 0.0 ; /* so we don't get "unused variable" compiler warning */
/*double dist = 1.0e20 ; A very large number */
/* The idea here is that we go into "pick" mode and pick the nearest point
to the mouse click position. Unfortunately I don't have the time to implement
it at the moment. */

View File

@ -852,10 +852,12 @@ static void special (int key, int x, int y)
/* Cuboctahedron can't be shown when in shader mode, skip it */
if (useShader && NUMBEROF (table)-1 == ( unsigned )function_index)
{
if (key==GLUT_KEY_PAGE_UP)
function_index = 0;
else
function_index -= 1;
}
}

View File

@ -533,7 +533,7 @@ static void fghcbMenuByID( SFG_Menu *menu,
return;
/* Check the menu's ID. */
if( menu->ID == (int)(enumerator->data) )
if( menu->ID == *( int *)(enumerator->data) )
{
enumerator->found = GL_TRUE;
enumerator->data = menu;
@ -552,7 +552,7 @@ SFG_Menu* fgMenuByID( int menuID )
/* This is easy and makes use of the menus enumeration defined above */
enumerator.found = GL_FALSE;
enumerator.data = (void *)menuID;
enumerator.data = (void *)&menuID;
fgEnumMenus( fghcbMenuByID, &enumerator );
if( enumerator.found )