projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removing more Win64 build warnings from joystick code
[freeglut]
/
src
/
freeglut_init.c
diff --git
a/src/freeglut_init.c
b/src/freeglut_init.c
index
fbf9065
..
83c02ab
100644
(file)
--- a/
src/freeglut_init.c
+++ b/
src/freeglut_init.c
@@
-65,11
+65,7
@@
SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */
0, /* FPSInterval */
0, /* SwapCount */
0, /* SwapTime */
0, /* FPSInterval */
0, /* SwapCount */
0, /* SwapTime */
-#if TARGET_HOST_MS_WINDOWS
- { 0, GL_FALSE }, /* Time */
-#else
- { { 0, 0 }, GL_FALSE },
-#endif
+ 0, /* Time */
{ NULL, NULL }, /* Timers */
{ NULL, NULL }, /* FreeTimers */
NULL, /* IdleCallback */
{ NULL, NULL }, /* Timers */
{ NULL, NULL }, /* FreeTimers */
NULL, /* IdleCallback */
@@
-285,8
+281,6
@@
void fgDeinitialize( void )
fgState.GameModeDepth = 16;
fgState.GameModeRefresh = 72;
fgState.GameModeDepth = 16;
fgState.GameModeRefresh = 72;
- fgState.Time.Set = GL_FALSE;
-
fgListInit( &fgState.Timers );
fgListInit( &fgState.FreeTimers );
fgListInit( &fgState.Timers );
fgListInit( &fgState.FreeTimers );
@@
-524,7
+518,8
@@
void FGAPIENTRY glutInit( int* pargc, char** argv )
fgCreateStructure( );
fgCreateStructure( );
- fgElapsedTime( );
+ /* Get start time */
+ fgState.Time = fgSystemTime();
/* check if GLUT_FPS env var is set */
#ifndef _WIN32_WCE
/* check if GLUT_FPS env var is set */
#ifndef _WIN32_WCE
@@
-658,6
+653,14
@@
void FGAPIENTRY glutInit( int* pargc, char** argv )
}
/*
}
/*
+ * Undoes all the "glutInit" stuff
+ */
+void FGAPIENTRY glutExit ( void )
+{
+ fgDeinitialize ();
+}
+
+/*
* Sets the default initial window position for new windows
*/
void FGAPIENTRY glutInitWindowPosition( int x, int y )
* Sets the default initial window position for new windows
*/
void FGAPIENTRY glutInitWindowPosition( int x, int y )
@@
-717,7
+720,7
@@
void FGAPIENTRY glutInitDisplayString( const char* displayMode )
* delimited by blanks or tabs.
*/
char *token ;
* delimited by blanks or tabs.
*/
char *token ;
- int len = strlen ( displayMode );
+ size_t len = strlen ( displayMode );
char *buffer = (char *)malloc ( (len+1) * sizeof(char) );
memcpy ( buffer, displayMode, len );
buffer[len] = '\0';
char *buffer = (char *)malloc ( (len+1) * sizeof(char) );
memcpy ( buffer, displayMode, len );
buffer[len] = '\0';
@@
-727,9
+730,16
@@
void FGAPIENTRY glutInitDisplayString( const char* displayMode )
{
/* Process this token */
int i ;
{
/* Process this token */
int i ;
+
+ /* Temporary fix: Ignore any length specifications and at least
+ * process the basic token
+ * TODO: Fix this permanently
+ */
+ size_t cleanlength = strcspn ( token, "=<>~!" );
+
for ( i = 0; i < NUM_TOKENS; i++ )
{
for ( i = 0; i < NUM_TOKENS; i++ )
{
- if ( strcmp ( token, Tokens[i] ) == 0 ) break ;
+ if ( strncmp ( token, Tokens[i], cleanlength ) == 0 ) break ;
}
switch ( i )
}
switch ( i )