Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 86 → Rev 85

/shark/trunk/ports/mesa/src/imports.c
1,4 → 1,4
/* $Id: imports.c,v 1.3 2003-03-18 15:10:38 giacomo Exp $ */
/* $Id: imports.c,v 1.2 2003-03-13 12:20:29 giacomo Exp $ */
 
/*
* Mesa 3-D graphics library
272,6 → 272,7
#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86getenv(var);
#else
cprintf("Called _mesa_getenv\n");
return getenv(var);
#endif
}
360,39 → 361,42
#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86atoi(s);
#else
return atoi(s);
return (int)atoi((char *)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
r = vsnprintf( str, MAXSTRING, fmt, args );
cprintf("Called _mesa_sprintf\n");
sprintf(str,"ERROR");
r = 0;
#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("%s", s);
cprintf("Called _mesa_printf\n");
cprintf("%s\n",fmtString);
#endif
}
 
402,11 → 406,12
{
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
416,7 → 421,8
#if defined(XFree86LOADER) && defined(IN_MODULE)
xf86fprintf(stderr, "Mesa warning: %s\n", str);
#else
cprintf("Mesa warning: %s\n", str);
cprintf("Called _mesa_warning\n");
cprintf("ERROR: %s\n", fmtString);
#endif
}
}
456,9 → 462,6
debugEnv = _mesa_getenv("MESA_DEBUG");
 
#ifdef DEBUG
if (debugEnv && _mesa_strstr(debugEnv, "silent"))
debug = GL_FALSE;
else
debug = GL_TRUE;
#else
if (debugEnv)
468,14 → 471,15
#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";
505,7 → 509,7
errstr = "unknown";
break;
}
_mesa_debug(ctx, "Mesa user error: %s in %s\n", errstr, where);
_mesa_debug(ctx, "Mesa user error: %s in %s\n", errstr);
}
 
_mesa_record_error(ctx, error);
520,13 → 524,16
{
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("Mesa: %s", s);
cprintf("Called _mesa_debug\n");
cprintf("ERROR: %s\n", fmtString);
#endif
}
 
592,7 → 599,7
default_atoi(__GLcontext *gc, const char *str)
{
(void) gc;
return atoi(str);
return (int)atoi((char *)str);
}
 
static int CAPI
599,10 → 606,13
default_sprintf(__GLcontext *gc, char *str, const char *fmt, ...)
{
int r;
va_list args;
va_start( args, fmt );
r = vsnprintf( str, MAXSTRING, fmt, args );
va_end( args );
//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;
return r;
}
 
622,12 → 632,16
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 = vsnprintf(tmp, MAXSTRING, fmt, args );
r = vsprintf(s, fmt, args );
va_end( args );
cprintf("%s\n",tmp);
*/
cprintf("Called default_fprintf\n");
cprintf("ERROR: %s\n",fmt);
r = 0;
return r;
}
 
/shark/trunk/ports/mesa/src/imports.h
1,4 → 1,4
/* $Id: imports.h,v 1.3 2003-03-18 15:10:38 giacomo Exp $ */
/* $Id: imports.h,v 1.2 2003-03-13 12:20:29 giacomo Exp $ */
 
/*
* Mesa 3-D graphics library
39,9 → 39,6
#define CALLOC(BYTES) _mesa_calloc(BYTES)
#define MALLOC_STRUCT(T) (struct T *) _mesa_malloc(sizeof(struct T))
#define CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T))
#ifdef FREE
#undef FREE
#endif
#define FREE(PTR) _mesa_free(PTR)
 
#define ALIGN_MALLOC(BYTES, N) _mesa_align_malloc(BYTES, N)
175,7 → 172,6
extern void
_mesa_printf( const char *fmtString, ... );
 
 
extern void
_mesa_warning( __GLcontext *gc, const char *fmtString, ... );
 
/shark/trunk/ports/mesa/src/glheader.h
1,4 → 1,4
/* $Id: glheader.h,v 1.2 2003-03-18 15:10:38 giacomo Exp $ */
/* $Id: glheader.h,v 1.1 2003-02-28 11:42:02 pj Exp $ */
 
/*
* Mesa 3-D graphics library
/shark/trunk/ports/mesa/src-glut.dos/pc_hw/pc_hw.h
16,13 → 16,7
/*
* misc C definitions
*/
#ifdef FALSE
#undef FALSE
#endif
#define FALSE 0
#ifdef TRUE
#undef TRUE
#endif
#define TRUE !FALSE
 
#define MIN(x,y) (((x) < (y)) ? (x) : (y))