(191) Renamed "configure.in" to the officially preferred
"configure.ac".
+
+(192) Make "gcc -Wall -pedantic -Werror" happy.
# pragma comment (lib, "gdi32.lib") /* link Windows GDI lib */
# pragma comment (lib, "opengl32.lib") /* link Microsoft OpenGL lib */
# pragma comment (lib, "glu32.lib") /* link OpenGL Utility lib */
-# endif //_WIN32_WCE
+# endif /* _WIN32_WCE */
# endif
#else
if ( reshape_called )
{
sprintf ( line, "Reshape %d: %d %d\n", reshape_seq, reshape_width, reshape_height );
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, line );
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)line );
}
if ( key_called )
{
sprintf ( line, "Key %d: %d(%c) %d %d\n", key_seq, key_key, key_key, key_x, key_y );
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, line );
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)line );
}
if ( special_called )
{
sprintf ( line, "Special %d: %d(%c) %d %d\n", special_seq, special_key, special_key, special_x, special_y );
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, line );
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)line );
}
if ( visibility_called )
{
sprintf ( line, "Visibility %d: %d\n", visibility_seq, visibility_vis );
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, line );
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)line );
}
if ( keyup_called )
{
sprintf ( line, "Key Up %d: %d(%c) %d %d\n", keyup_seq, keyup_key, keyup_key, keyup_x, keyup_y );
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, line );
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)line );
}
if ( specialup_called )
{
sprintf ( line, "Special Up %d: %d(%c) %d %d\n", specialup_seq, specialup_key, specialup_key, specialup_x, specialup_y );
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, line );
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)line );
}
if ( joystick_called )
{
sprintf ( line, "Joystick %d: %d %d %d %d\n", joystick_seq, joystick_a, joystick_b, joystick_c, joystick_d );
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, line );
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)line );
}
if ( mouse_called )
{
sprintf ( line, "Mouse %d: %d %d %d %d\n", mouse_seq, mouse_button, mouse_updown, mouse_x, mouse_y );
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, line );
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)line );
}
if ( mousewheel_called )
{
sprintf ( line, "Mouse Wheel %d: %d %d %d %d\n", mousewheel_seq, mousewheel_number, mousewheel_direction, mousewheel_x, mousewheel_y );
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, line );
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)line );
}
if ( motion_called )
{
sprintf ( line, "Motion %d: %d %d\n", motion_seq, motion_x, motion_y );
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, line );
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)line );
}
if ( passivemotion_called )
{
sprintf ( line, "Passive Motion %d: %d %d\n", passivemotion_seq, passivemotion_x, passivemotion_y );
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, line );
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)line );
}
glMatrixMode ( GL_PROJECTION );
glutVisibilityFunc( Visibility );
glutKeyboardUpFunc( KeyUp );
glutSpecialUpFunc( SpecialUp );
-// glutJoystickFunc( Joystick, 100 );
+ /* glutJoystickFunc( Joystick, 100 ); */
glutMouseFunc ( Mouse ) ;
glutMouseWheelFunc ( MouseWheel ) ;
glutMotionFunc ( Motion ) ;
#include <string.h>
#include <math.h>
#ifdef WIN32
-#include <crtdbg.h> // DUMP MEMORY LEAKS
+/* DUMP MEMORY LEAKS */
+#include <crtdbg.h>
#endif
typedef struct
free ( affine ) ;
#ifdef WIN32
- _CrtDumpMemoryLeaks () ; // DUMP MEMORY LEAK INFORMATION
+ /* DUMP MEMORY LEAK INFORMATION */
+ _CrtDumpMemoryLeaks () ;
#endif
return 0; /* ANSI C requires main to return int. */
#include <time.h>
#include <GL/freeglut.h>
#ifdef WIN32
-#include <crtdbg.h> // DUMP MEMORY LEAKS
+/* DUMP MEMORY LEAKS */
+#include <crtdbg.h>
#endif
break ;
case 'm' : case 'M' : /* Modify the Lorenz parameters */
- printf ( "Please enter new value for <sigma> (default %lf, currently %lf): ", s0, sigma ) ;
+ printf ( "Please enter new value for <sigma> (default %f, currently %f): ", s0, sigma ) ;
fgets ( inputline, INPUT_LINE_LENGTH-1, stdin ) ;
sscanf ( inputline, "%lf", &sigma ) ;
- printf ( "Please enter new value for <b> (default %lf, currently %lf): ", b0, b ) ;
+ printf ( "Please enter new value for <b> (default %f, currently %f): ", b0, b ) ;
fgets ( inputline, INPUT_LINE_LENGTH-1, stdin ) ;
sscanf ( inputline, "%lf", &b ) ;
- printf ( "Please enter new value for <r> (default %lf, currently %lf): ", r0, r ) ;
+ printf ( "Please enter new value for <r> (default %f, currently %f): ", r0, r ) ;
fgets ( inputline, INPUT_LINE_LENGTH-1, stdin ) ;
sscanf ( inputline, "%lf", &r ) ;
/* Print the distance between the two points */
glColor3d ( 1.0, 1.0, 1.0 ) ; /* White */
- sprintf ( string, "Distance: %10.6lf", distance ) ;
+ sprintf ( string, "Distance: %10.6f", distance ) ;
glRasterPos2i ( 10, 10 ) ;
- glutBitmapString ( GLUT_BITMAP_HELVETICA_12, string ) ;
+ glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)string ) ;
glutSwapBuffers();
}
glutMainLoop () ;
#ifdef WIN32
- _CrtDumpMemoryLeaks () ; // DUMP MEMORY LEAK INFORMATION
+ /* DUMP MEMORY LEAK INFORMATION */
+ _CrtDumpMemoryLeaks () ;
#endif
return 0 ;
* And then drawn...
*/
glColor3f( 1, 1, 0 );
- //glutWireCube( 20.0 );
+ /* glutWireCube( 20.0 ); */
glutWireTeapot( 20.0 );
- //glutWireSpher( 15.0, 15, 15 );
- //glColor3f( 0, 1, 0 );
- //glutWireCube( 30.0 );
- //glutSolidCone( 10, 20, 10, 2 );
+ /* glutWireSpher( 15.0, 15, 15 ); */
+ /* glColor3f( 0, 1, 0 ); */
+ /* glutWireCube( 30.0 ); */
+ /* glutSolidCone( 10, 20, 10, 2 ); */
/*
* Don't forget about the model-view matrix
* need to pick a color for foreground/background---but what
* one we pick doesn't matter for GLUT_CURSOR_NONE.
*/
- static unsigned char no_cursor_bits[ 32 ];
+ static char no_cursor_bits[ 32 ];
XColor black;
no_cursor = XCreatePixmapFromBitmapData( fgDisplay.Display,
fgDisplay.RootWindow,
* A newline will simply translate the next character's insertion
* point back to the start of the line and down one line.
*/
- while( c = *string++ )
+ while( ( c = *string++ ) )
if( c == '\n' )
{
glBitmap ( 0, 0, 0, 0, -x, (float) -font->Height, NULL );
if ( !string || ! *string )
return 0;
- while( c = *string++ )
+ while( ( c = *string++) )
{
if( c != '\n' )/* Not an EOL, increment length of line */
this_line_length += *( font->Characters[ c ]);
* A newline will simply translate the next character's insertion
* point back to the start of the line and down one line.
*/
- while( c = *string++ )
+ while( ( c = *string++) )
if( c < font->Quantity )
{
if( c == '\n' )
if ( !string || ! *string )
return 0;
- while( c = *string++ )
+ while( ( c = *string++ ) )
if( c < font->Quantity )
{
if( c == '\n' ) /* EOL; reset the length of this line */
fgDestroyStructure( );
- while( timer = fgState.Timers.First )
+ while( ( timer = fgState.Timers.First ) )
{
fgListRemove( &fgState.Timers, &timer->Node );
free( timer );
}
- while( timer = fgState.FreeTimers.First )
+ while( ( timer = fgState.FreeTimers.First) )
{
fgListRemove( &fgState.FreeTimers, &timer->Node );
free( timer );
* size.
*/
- if (geometry )
+ if( geometry )
{
+ unsigned int parsedWidth, parsedHeight;
int mask = XParseGeometry( geometry,
&fgState.Position.X, &fgState.Position.Y,
- &fgState.Size.X, &fgState.Size.Y );
+ &parsedWidth, &parsedHeight );
+ /* TODO: Check for overflow? */
+ fgState.Size.X = parsedWidth;
+ fgState.Size.Y = parsedHeight;
if( (mask & (WidthValue|HeightValue)) == (WidthValue|HeightValue) )
fgState.Size.Use = GL_TRUE;
#endif /* TARGET_HOST_WINCE */
-#endif /* FREEGLUT_TEAPOT_DATA_H */
\ No newline at end of file
+#endif /* FREEGLUT_TEAPOT_DATA_H */