more updates from John Fay

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@515 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
brianp 2004-09-13 18:39:10 +00:00
parent 447cac3357
commit a82a0dff4a
9 changed files with 33 additions and 35 deletions

View File

@ -50,7 +50,7 @@ void FGAPIENTRY glutDisplayFunc( void (* callback)( void ) )
{
if( !callback )
fgError( "Fatal error in program. NULL display callback not "
"permitted in GLUT 3.0+ or freeglut 2.0.1+\n" );
"permitted in GLUT 3.0+ or freeglut 2.0.1+" );
SET_CALLBACK( Display );
}
@ -106,7 +106,7 @@ void FGAPIENTRY glutTimerFunc( unsigned int timeOut, void (* callback)( int ),
{
if( ! (timer = malloc(sizeof(SFG_Timer))) )
fgError( "Fatal error: "
"Memory allocation failure in glutTimerFunc()\n" );
"Memory allocation failure in glutTimerFunc()" );
}
timer->Callback = callback;

View File

@ -167,7 +167,7 @@ void FGAPIENTRY glutSetCursor( int cursorID )
break;
default:
fgWarning( "Unknown cursor type: %d\n", cursorID );
fgWarning( "Unknown cursor type: %d", cursorID );
return;
}

View File

@ -96,7 +96,7 @@ static void fghRememberState( void )
);
if( !fgDisplay.DisplayModeValid )
fgWarning( "Runtime use of XF86VidModeGetModeLine failed.\n" );
fgWarning( "Runtime use of XF86VidModeGetModeLine failed." );
# else
/*
@ -559,6 +559,7 @@ int FGAPIENTRY glutGameModeGet( GLenum eWhat )
return !!fgStructure.GameMode;
}
fgWarning( "Unknown gamemode get: %d", eWhat );
return -1;
}

View File

@ -864,8 +864,8 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode )
break ;
case 28 : /* Unrecognized */
printf ( "WARNING - Display string token not recognized: %s\n",
token );
fgWarning ( "WARNING - Display string token not recognized: %s",
token );
break ;
}

View File

@ -698,7 +698,6 @@ void fgCloseWindow( SFG_Window* window );
void fgAddToWindowDestroyList ( SFG_Window* window );
void fgCloseWindows ();
void fgDestroyWindow( SFG_Window* window );
void fgClearCallBacks( SFG_Window *window );
/* Menu creation and destruction. Defined in freeglut_structure.c */
SFG_Menu* fgCreateMenu( FGCBMenu menuCallback );

View File

@ -241,8 +241,7 @@ static int fghJoystickFindUSBdev(char *name, char *out, int outlen)
return 1;
} else if (errno == EACCES) {
if (!protection_warned) {
fprintf(stderr, "Can't open %s for read!\n",
buf);
fgWarning ( "Can't open %s for read!", buf );
protection_warned = 1;
}
}
@ -263,7 +262,7 @@ static int fghJoystickInitializeHID(struct os_specific_s *os,
if ( ( rd = hid_get_report_desc( os->fd ) ) == 0 )
{
fprintf( stderr, "error: %s: %s", os->fname, strerror( errno ) );
fgWarning ( "error: %s: %s", os->fname, strerror( errno ) );
return FALSE;
}
@ -273,8 +272,7 @@ static int fghJoystickInitializeHID(struct os_specific_s *os,
if( ioctl( os->fd, USB_GET_REPORT_ID, &report_id ) < 0)
{
/*** XXX {report_id} may not be the right variable? ***/
fprintf( stderr, "error: %s%d: %s",
UHIDDEV, report_id, strerror( errno ) );
fgWarning ( "error: %s%d: %s", UHIDDEV, report_id, strerror( errno ) );
return FALSE;
}
@ -724,7 +722,7 @@ static void fghJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
break;
default:
fgWarning ( "%s", "PLIB_JS: Unrecognised /dev/js return!?!" );
fgWarning ( "PLIB_JS: Unrecognised /dev/js return!?!" );
/* use the old values */
@ -851,7 +849,7 @@ static int fghJoystickFindDevices ( SFG_Joystick *joy, mach_port_t masterPort )
rv = IOServiceGetMatchingServices(masterPort, hidMatch, &hidIterator);
if (rv != kIOReturnSuccess || !hidIterator) {
fgWarning( "%s", "no joystick (HID) devices found" );
fgWarning( "no joystick (HID) devices found" );
return;
}
@ -894,13 +892,13 @@ static CFDictionaryRef fghJoystickGetCFProperties ( SFG_Joystick *joy, io_object
rv = IORegistryEntryGetParentEntry (ioDev, kIOServicePlane, &parent1);
if (rv != kIOReturnSuccess) {
fgWarning ( "%s", "error getting device entry parent");
fgWarning ( "error getting device entry parent");
return NULL;
}
rv = IORegistryEntryGetParentEntry (parent1, kIOServicePlane, &parent2);
if (rv != kIOReturnSuccess) {
fgWarning ( "%s", "error getting device entry parent 2");
fgWarning ( "error getting device entry parent 2");
return NULL;
}
#endif
@ -908,7 +906,7 @@ static CFDictionaryRef fghJoystickGetCFProperties ( SFG_Joystick *joy, io_object
rv = IORegistryEntryCreateCFProperties( ioDev /*parent2*/,
&cfProperties, kCFAllocatorDefault, kNilOptions);
if (rv != kIOReturnSuccess || !cfProperties) {
fgWarning ( "%s", "error getting device properties");
fgWarning ( "error getting device properties");
return NULL;
}
@ -974,14 +972,14 @@ static void fghJoystickParseElement ( SFG_Joystick *joy, CFDictionaryRef element
break;
default:
printf("input type element has weird usage (%x)\n", usage);
fgWarning ( "input type element has weird usage (%x)", usage);
break;
}
} else if (page == kHIDPage_Button) {
printf(" button\n");
fghJoystickAddButtonElement((CFDictionaryRef) element);
} else
printf("input type element has weird page (%x)\n", page);
fgWarning ( "input type element has weird page (%x)", page);
break;
case kIOHIDElementTypeCollection:
@ -1239,7 +1237,7 @@ static void fghJoystickOpen( SFG_Joystick* joy )
#if TARGET_HOST_MAC_OSX
if( joy->id >= numDevices )
{
fgWarning( "%s", "device index out of range in fgJoystickOpen()" );
fgWarning( "device index out of range in fgJoystickOpen()" );
return;
}
@ -1251,7 +1249,7 @@ static void fghJoystickOpen( SFG_Joystick* joy )
if( rv != kIOReturnSuccess )
{
fgWarning( "%s", "error creating plugin for io device" );
fgWarning( "error creating plugin for io device" );
return;
}
@ -1262,7 +1260,7 @@ static void fghJoystickOpen( SFG_Joystick* joy )
);
if( pluginResult != S_OK )
fgWarning ( "%s", "QI-ing IO plugin to HID Device interface failed" );
fgWarning ( "QI-ing IO plugin to HID Device interface failed" );
( *plugin )->Release( plugin ); /* don't leak a ref */
if( joy->hidDev == NULL )
@ -1358,7 +1356,7 @@ static void fghJoystickOpen( SFG_Joystick* joy )
joy->os->fd = open( joy->os->fname, O_RDONLY | O_NONBLOCK);
if( joy->os->fd < 0 && errno == EACCES )
fgWarning ( "%s exists but is not readable by you\n", joy->os->fname );
fgWarning ( "%s exists but is not readable by you", joy->os->fname );
joy->error =( joy->os->fd < 0 );
@ -1533,10 +1531,10 @@ static void fghJoystickOpen( SFG_Joystick* joy )
void fgJoystickInit( int ident )
{
if( ident >= MAX_NUM_JOYSTICKS )
fgError( "Too large a joystick number" );
fgError( "Too large a joystick number: %d", ident );
if( fgJoystick[ ident ] )
fgError( "illegal attempt to initialize joystick device" );
fgError( "illegal attempt to initialize joystick device again" );
fgJoystick[ ident ] =
( SFG_Joystick * )calloc( sizeof( SFG_Joystick ), 1 );
@ -1566,7 +1564,7 @@ void fgJoystickInit( int ident )
IOReturn rv = IOMasterPort( bootstrap_port, &masterPort );
if( rv != kIOReturnSuccess )
{
fgWarning( "%s", "error getting master Mach port" );
fgWarning( "error getting master Mach port" );
return;
}
fghJoystickFindDevices( masterPort );
@ -1589,7 +1587,7 @@ void fgJoystickInit( int ident )
!CFStringGetCString( ( CFStringRef )ref, name, 128,
CFStringGetSystemEncoding( ) ) )
{
fgWarning( "%s", "error getting device name" );
fgWarning( "error getting device name" );
name[ 0 ] = '\0';
}
#endif

View File

@ -502,7 +502,7 @@ static void fghSleepForEvents( void )
err = select( socket+1, &fdset, NULL, NULL, &wait );
if( -1 == err )
fgWarning ( "freeglut select() error: %d\n", errno );
fgWarning ( "freeglut select() error: %d", errno );
}
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
MsgWaitForMultipleObjects( 0, NULL, FALSE, msec, QS_ALLEVENTS );
@ -696,7 +696,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
break;
default:
fgWarning( "Uknown X visibility state: %d",
fgWarning( "Unknown X visibility state: %d",
event.xvisibility.state );
break;
}
@ -1953,7 +1953,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam,
default:
#if _DEBUG
fgWarning( "Unknown wParam type 0x%x\n", wParam );
fgWarning( "Unknown wParam type 0x%x", wParam );
#endif
break;
}

View File

@ -118,7 +118,7 @@ void FGAPIENTRY glutSetOption( GLenum eWhat, int value )
break;
default:
fgWarning( "glutSetOption(): missing enum handle %i\n", eWhat );
fgWarning( "glutSetOption(): missing enum handle %d", eWhat );
break;
}
}
@ -454,7 +454,7 @@ int FGAPIENTRY glutGet( GLenum eWhat )
break;
default:
fgWarning( "glutGet(): missing enum handle %i\n", eWhat );
fgWarning( "glutGet(): missing enum handle %d", eWhat );
break;
}
return -1;
@ -555,7 +555,7 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat )
return GLUT_KEY_REPEAT_DEFAULT;
default:
fgWarning( "glutDeviceGet(): missing enum handle %i\n", eWhat );
fgWarning( "glutDeviceGet(): missing enum handle %d", eWhat );
break;
}
@ -649,7 +649,7 @@ int FGAPIENTRY glutLayerGet( GLenum eWhat )
#endif
default:
fgWarning( "glutLayerGet(): missing enum handle %i\n", eWhat );
fgWarning( "glutLayerGet(): missing enum handle %d", eWhat );
break;
}

View File

@ -725,7 +725,7 @@ void FGAPIENTRY glutSetWindow( int ID )
window = fgWindowByID( ID );
if( window == NULL )
{
fgWarning( "glutSetWindow(): window ID %i not found!", ID );
fgWarning( "glutSetWindow(): window ID %d not found!", ID );
return;
}