1,4 → 1,4 |
/* $Id: imports.c,v 1.2 2003-03-13 12:20:29 giacomo Exp $ */ |
/* $Id: imports.c,v 1.3 2003-03-18 15:10:38 giacomo Exp $ */ |
|
/* |
* Mesa 3-D graphics library |
272,7 → 272,6 |
#if defined(XFree86LOADER) && defined(IN_MODULE) |
return xf86getenv(var); |
#else |
cprintf("Called _mesa_getenv\n"); |
return getenv(var); |
#endif |
} |
361,42 → 360,39 |
#if defined(XFree86LOADER) && defined(IN_MODULE) |
return xf86atoi(s); |
#else |
return (int)atoi((char *)s); |
return atoi(s); |
#endif |
} |
|
|
int |
_mesa_sprintf( char *str, const char *fmt, ... ) |
{ |
int r; |
va_list args; |
|
va_start( args, fmt ); |
va_end( args ); |
#if defined(XFree86LOADER) && defined(IN_MODULE) |
r = xf86vsprintf( str, fmt, args ); |
#else |
cprintf("Called _mesa_sprintf\n"); |
sprintf(str,"ERROR"); |
r = 0; |
r = vsnprintf( str, MAXSTRING, fmt, args ); |
#endif |
return r; |
} |
|
|
void |
_mesa_printf( const char *fmtString, ... ) |
{ |
char s[MAXSTRING]; |
//va_list args; |
|
//va_start( args, fmtString ); |
//vsnprintf(s, MAXSTRING, fmtString, args); |
//va_end( args ); |
va_list args; |
va_start( args, fmtString ); |
vsnprintf(s, MAXSTRING, fmtString, args); |
va_end( args ); |
#if defined(XFree86LOADER) && defined(IN_MODULE) |
xf86printf("%s", s); |
#else |
cprintf("Called _mesa_printf\n"); |
cprintf("%s\n",fmtString); |
cprintf("%s", s); |
#endif |
} |
|
406,12 → 402,11 |
{ |
GLboolean debug; |
char str[MAXSTRING]; |
//va_list args; |
va_list args; |
(void) ctx; |
|
//va_start( args, fmtString ); |
//(void) vsnprintf( str, MAXSTRING, fmtString, args ); |
//va_end( args ); |
va_start( args, fmtString ); |
(void) vsnprintf( str, MAXSTRING, fmtString, args ); |
va_end( args ); |
#ifdef DEBUG |
debug = GL_TRUE; /* always print warning */ |
#else |
421,8 → 416,7 |
#if defined(XFree86LOADER) && defined(IN_MODULE) |
xf86fprintf(stderr, "Mesa warning: %s\n", str); |
#else |
cprintf("Called _mesa_warning\n"); |
cprintf("ERROR: %s\n", fmtString); |
cprintf("Mesa warning: %s\n", str); |
#endif |
} |
} |
462,6 → 456,9 |
debugEnv = _mesa_getenv("MESA_DEBUG"); |
|
#ifdef DEBUG |
if (debugEnv && _mesa_strstr(debugEnv, "silent")) |
debug = GL_FALSE; |
else |
debug = GL_TRUE; |
#else |
if (debugEnv) |
471,15 → 468,14 |
#endif |
|
if (debug) { |
/* |
va_list args; |
char where[MAXSTRING];*/ |
char where[MAXSTRING]; |
const char *errstr; |
/* |
|
va_start( args, fmtString ); |
vsnprintf( where, MAXSTRING, fmtString, args ); |
va_end( args ); |
*/ |
|
switch (error) { |
case GL_NO_ERROR: |
errstr = "GL_NO_ERROR"; |
509,7 → 505,7 |
errstr = "unknown"; |
break; |
} |
_mesa_debug(ctx, "Mesa user error: %s in %s\n", errstr); |
_mesa_debug(ctx, "Mesa user error: %s in %s\n", errstr, where); |
} |
|
_mesa_record_error(ctx, error); |
524,16 → 520,13 |
{ |
char s[MAXSTRING]; |
va_list args; |
|
/* |
va_start(args, fmtString); |
vsnprintf(s, MAXSTRING, fmtString, args); |
va_end(args);*/ |
va_end(args); |
#if defined(XFree86LOADER) && defined(IN_MODULE) |
xf86fprintf(stderr, "Mesa: %s", s); |
#else |
cprintf("Called _mesa_debug\n"); |
cprintf("ERROR: %s\n", fmtString); |
cprintf("Mesa: %s", s); |
#endif |
} |
|
599,7 → 592,7 |
default_atoi(__GLcontext *gc, const char *str) |
{ |
(void) gc; |
return (int)atoi((char *)str); |
return atoi(str); |
} |
|
static int CAPI |
606,13 → 599,10 |
default_sprintf(__GLcontext *gc, char *str, const char *fmt, ...) |
{ |
int r; |
//va_list args; |
//va_start( args, fmt ); |
//r = vsprintf( str, fmt, args ); |
//va_end( args ); |
cprintf("Called default_sprintf\n"); |
sprintf(str, "ERROR"); |
r = 0; |
va_list args; |
va_start( args, fmt ); |
r = vsnprintf( str, MAXSTRING, fmt, args ); |
va_end( args ); |
return r; |
} |
|
632,16 → 622,12 |
default_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...) |
{ |
int r; |
char s[200]; |
/* |
va_list args; |
char tmp[200]; |
va_start( args, fmt ); |
r = vsprintf(s, fmt, args ); |
r = vsnprintf(tmp, MAXSTRING, fmt, args ); |
va_end( args ); |
*/ |
cprintf("Called default_fprintf\n"); |
cprintf("ERROR: %s\n",fmt); |
r = 0; |
cprintf("%s\n",tmp); |
return r; |
} |
|