-/* $Id: osmesa.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
+/* $Id: osmesa.c,v 1.2 1999/10/13 18:43:46 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
- osmesa = (OSMesaContext) calloc( 1, sizeof(struct osmesa_context) );
+ osmesa = (OSMesaContext) CALLOC_STRUCT(osmesa_context);
if (osmesa) {
osmesa->gl_visual = gl_create_visual( rgbmode,
swalpha, /* software alpha */
(void *) osmesa, GL_TRUE );
if (!osmesa->gl_ctx) {
gl_destroy_visual( osmesa->gl_visual );
- free(osmesa);
+ FREE(osmesa);
return NULL;
}
osmesa->gl_buffer = gl_create_framebuffer( osmesa->gl_visual );
if (!osmesa->gl_buffer) {
gl_destroy_visual( osmesa->gl_visual );
gl_destroy_context( osmesa->gl_ctx );
- free(osmesa);
+ FREE(osmesa);
return NULL;
}
osmesa->format = format;
gl_destroy_visual( ctx->gl_visual );
gl_destroy_framebuffer( ctx->gl_buffer );
gl_destroy_context( ctx->gl_ctx );
- free( ctx );
+ FREE( ctx );
}
}
-/* $Id: accum.c,v 1.5 1999/10/11 04:20:25 joukj Exp $ */
+/* $Id: accum.c,v 1.6 1999/10/13 18:42:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLint n;
if (ctx->Buffer->Accum) {
- GL_FREE( ctx->Buffer->Accum );
+ FREE( ctx->Buffer->Accum );
ctx->Buffer->Accum = NULL;
}
/* allocate accumulation buffer if not already present */
n = ctx->Buffer->Width * ctx->Buffer->Height * 4 * sizeof(GLaccum);
- ctx->Buffer->Accum = (GLaccum *) GL_ALLOC( n );
+ ctx->Buffer->Accum = (GLaccum *) MALLOC( n );
if (!ctx->Buffer->Accum) {
/* unable to setup accumulation buffer */
gl_error( ctx, GL_OUT_OF_MEMORY, "glAccum" );
if (!ctx->Buffer->Accum) {
/* try to alloc accumulation buffer */
ctx->Buffer->Accum = (GLaccum *)
- GL_ALLOC( buffersize * 4 * sizeof(GLaccum) );
+ MALLOC( buffersize * 4 * sizeof(GLaccum) );
}
if (ctx->Buffer->Accum) {
-/* $Id: attrib.c,v 1.7 1999/10/11 04:20:55 joukj Exp $ */
+/* $Id: attrib.c,v 1.8 1999/10/13 18:42:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
static struct gl_attrib_node *new_attrib_node( GLbitfield kind )
{
- struct gl_attrib_node *an = GL_ALLOC_STRUCT(gl_attrib_node);
+ struct gl_attrib_node *an = MALLOC_STRUCT(gl_attrib_node);
if (an) {
an->kind = kind;
}
if (mask & GL_ACCUM_BUFFER_BIT) {
struct gl_accum_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_accum_attrib );
+ attr = MALLOC_STRUCT( gl_accum_attrib );
MEMCPY( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) );
newnode = new_attrib_node( GL_ACCUM_BUFFER_BIT );
newnode->data = attr;
if (mask & GL_COLOR_BUFFER_BIT) {
struct gl_colorbuffer_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_colorbuffer_attrib );
+ attr = MALLOC_STRUCT( gl_colorbuffer_attrib );
MEMCPY( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) );
newnode = new_attrib_node( GL_COLOR_BUFFER_BIT );
newnode->data = attr;
if (mask & GL_CURRENT_BIT) {
struct gl_current_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_current_attrib );
+ attr = MALLOC_STRUCT( gl_current_attrib );
MEMCPY( attr, &ctx->Current, sizeof(struct gl_current_attrib) );
newnode = new_attrib_node( GL_CURRENT_BIT );
newnode->data = attr;
if (mask & GL_DEPTH_BUFFER_BIT) {
struct gl_depthbuffer_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_depthbuffer_attrib );
+ attr = MALLOC_STRUCT( gl_depthbuffer_attrib );
MEMCPY( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) );
newnode = new_attrib_node( GL_DEPTH_BUFFER_BIT );
newnode->data = attr;
if (mask & GL_ENABLE_BIT) {
struct gl_enable_attrib *attr;
GLuint i;
- attr = GL_ALLOC_STRUCT( gl_enable_attrib );
+ attr = MALLOC_STRUCT( gl_enable_attrib );
/* Copy enable flags from all other attributes into the enable struct. */
attr->AlphaTest = ctx->Color.AlphaEnabled;
attr->AutoNormal = ctx->Eval.AutoNormal;
if (mask & GL_EVAL_BIT) {
struct gl_eval_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_eval_attrib );
+ attr = MALLOC_STRUCT( gl_eval_attrib );
MEMCPY( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) );
newnode = new_attrib_node( GL_EVAL_BIT );
newnode->data = attr;
if (mask & GL_FOG_BIT) {
struct gl_fog_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_fog_attrib );
+ attr = MALLOC_STRUCT( gl_fog_attrib );
MEMCPY( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) );
newnode = new_attrib_node( GL_FOG_BIT );
newnode->data = attr;
if (mask & GL_HINT_BIT) {
struct gl_hint_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_hint_attrib );
+ attr = MALLOC_STRUCT( gl_hint_attrib );
MEMCPY( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) );
newnode = new_attrib_node( GL_HINT_BIT );
newnode->data = attr;
if (mask & GL_LIGHTING_BIT) {
struct gl_light_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_light_attrib );
+ attr = MALLOC_STRUCT( gl_light_attrib );
MEMCPY( attr, &ctx->Light, sizeof(struct gl_light_attrib) );
newnode = new_attrib_node( GL_LIGHTING_BIT );
newnode->data = attr;
if (mask & GL_LINE_BIT) {
struct gl_line_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_line_attrib );
+ attr = MALLOC_STRUCT( gl_line_attrib );
MEMCPY( attr, &ctx->Line, sizeof(struct gl_line_attrib) );
newnode = new_attrib_node( GL_LINE_BIT );
newnode->data = attr;
if (mask & GL_LIST_BIT) {
struct gl_list_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_list_attrib );
+ attr = MALLOC_STRUCT( gl_list_attrib );
MEMCPY( attr, &ctx->List, sizeof(struct gl_list_attrib) );
newnode = new_attrib_node( GL_LIST_BIT );
newnode->data = attr;
if (mask & GL_PIXEL_MODE_BIT) {
struct gl_pixel_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_pixel_attrib );
+ attr = MALLOC_STRUCT( gl_pixel_attrib );
MEMCPY( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) );
newnode = new_attrib_node( GL_PIXEL_MODE_BIT );
newnode->data = attr;
if (mask & GL_POINT_BIT) {
struct gl_point_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_point_attrib );
+ attr = MALLOC_STRUCT( gl_point_attrib );
MEMCPY( attr, &ctx->Point, sizeof(struct gl_point_attrib) );
newnode = new_attrib_node( GL_POINT_BIT );
newnode->data = attr;
if (mask & GL_POLYGON_BIT) {
struct gl_polygon_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_polygon_attrib );
+ attr = MALLOC_STRUCT( gl_polygon_attrib );
MEMCPY( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) );
newnode = new_attrib_node( GL_POLYGON_BIT );
newnode->data = attr;
if (mask & GL_POLYGON_STIPPLE_BIT) {
GLuint *stipple;
- stipple = (GLuint *) GL_ALLOC( 32*sizeof(GLuint) );
+ stipple = (GLuint *) MALLOC( 32*sizeof(GLuint) );
MEMCPY( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) );
newnode = new_attrib_node( GL_POLYGON_STIPPLE_BIT );
newnode->data = stipple;
if (mask & GL_SCISSOR_BIT) {
struct gl_scissor_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_scissor_attrib );
+ attr = MALLOC_STRUCT( gl_scissor_attrib );
MEMCPY( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) );
newnode = new_attrib_node( GL_SCISSOR_BIT );
newnode->data = attr;
if (mask & GL_STENCIL_BUFFER_BIT) {
struct gl_stencil_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_stencil_attrib );
+ attr = MALLOC_STRUCT( gl_stencil_attrib );
MEMCPY( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) );
newnode = new_attrib_node( GL_STENCIL_BUFFER_BIT );
newnode->data = attr;
ctx->Texture.Unit[u].CurrentD[2]->RefCount++;
ctx->Texture.Unit[u].CurrentD[3]->RefCount++;
}
- attr = GL_ALLOC_STRUCT( gl_texture_attrib );
+ attr = MALLOC_STRUCT( gl_texture_attrib );
MEMCPY( attr, &ctx->Texture, sizeof(struct gl_texture_attrib) );
/* copy state of the currently bound texture objects */
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (mask & GL_TRANSFORM_BIT) {
struct gl_transform_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_transform_attrib );
+ attr = MALLOC_STRUCT( gl_transform_attrib );
MEMCPY( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) );
newnode = new_attrib_node( GL_TRANSFORM_BIT );
newnode->data = attr;
if (mask & GL_VIEWPORT_BIT) {
struct gl_viewport_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_viewport_attrib );
+ attr = MALLOC_STRUCT( gl_viewport_attrib );
MEMCPY( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) );
newnode = new_attrib_node( GL_VIEWPORT_BIT );
newnode->data = attr;
}
next = attr->next;
- GL_FREE( attr->data );
- GL_FREE( attr );
+ FREE( attr->data );
+ FREE( attr );
attr = next;
}
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
struct gl_pixelstore_attrib *attr;
/* packing attribs */
- attr = GL_ALLOC_STRUCT( gl_pixelstore_attrib );
+ attr = MALLOC_STRUCT( gl_pixelstore_attrib );
MEMCPY( attr, &ctx->Pack, sizeof(struct gl_pixelstore_attrib) );
newnode = new_attrib_node( GL_CLIENT_PACK_BIT );
newnode->data = attr;
newnode->next = head;
head = newnode;
/* unpacking attribs */
- attr = GL_ALLOC_STRUCT( gl_pixelstore_attrib );
+ attr = MALLOC_STRUCT( gl_pixelstore_attrib );
MEMCPY( attr, &ctx->Unpack, sizeof(struct gl_pixelstore_attrib) );
newnode = new_attrib_node( GL_CLIENT_UNPACK_BIT );
newnode->data = attr;
}
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
struct gl_array_attrib *attr;
- attr = GL_ALLOC_STRUCT( gl_array_attrib );
+ attr = MALLOC_STRUCT( gl_array_attrib );
MEMCPY( attr, &ctx->Array, sizeof(struct gl_array_attrib) );
newnode = new_attrib_node( GL_CLIENT_VERTEX_ARRAY_BIT );
newnode->data = attr;
}
next = attr->next;
- GL_FREE( attr->data );
- GL_FREE( attr );
+ FREE( attr->data );
+ FREE( attr );
attr = next;
}
-/* $Id: context.c,v 1.14 1999/10/10 13:04:54 brianp Exp $ */
+/* $Id: context.c,v 1.15 1999/10/13 18:42:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
- * Memory allocation functions. Called via the GL_ALLOC, GL_CALLOC and
- * GL_FREE macros when DEBUG symbol is defined.
+ * Memory allocation functions. Called via the MALLOC, CALLOC and
+ * FREE macros when DEBUG symbol is defined.
* You might want to set breakpoints on these functions or plug in
* other memory allocation functions. The Mesa sources should only
- * use the GL_ALLOC and GL_FREE macros (which could also be overriden).
+ * use the MALLOC and FREE macros (which could also be overriden).
*
* XXX these functions should probably go into a new glmemory.c file.
*/
/*
* Allocate memory (uninitialized)
*/
-void *gl_alloc(size_t bytes)
+void *gl_malloc(size_t bytes)
{
return malloc(bytes);
}
struct gl_shared_state *ss;
GLboolean outOfMemory;
- ss = GL_CALLOC_STRUCT(gl_shared_state);
+ ss = CALLOC_STRUCT(gl_shared_state);
if (!ss)
return NULL;
gl_free_texture_object(ss, ss->DefaultD[2]);
if (ss->DefaultD[3])
gl_free_texture_object(ss, ss->DefaultD[3]);
- GL_FREE(ss);
+ FREE(ss);
return NULL;
}
else {
}
DeleteHashTable(ss->TexObjects);
- GL_FREE(ss);
+ FREE(ss);
}
map->Order = 1;
map->u1 = 0.0;
map->u2 = 1.0;
- map->Points = (GLfloat *) GL_ALLOC(n * sizeof(GLfloat));
+ map->Points = (GLfloat *) MALLOC(n * sizeof(GLfloat));
if (map->Points) {
GLint i;
for (i=0;i<n;i++)
map->u2 = 1.0;
map->v1 = 0.0;
map->v2 = 1.0;
- map->Points = (GLfloat *) GL_ALLOC(n * sizeof(GLfloat));
+ map->Points = (GLfloat *) MALLOC(n * sizeof(GLfloat));
if (map->Points) {
GLint i;
for (i=0;i<n;i++)
return NULL;
}
- vis = (GLvisual *) GL_CALLOC( sizeof(GLvisual) );
+ vis = (GLvisual *) CALLOC( sizeof(GLvisual) );
if (!vis) {
return NULL;
}
void gl_destroy_visual( GLvisual *vis )
{
- GL_FREE( vis );
+ FREE( vis );
}
/* misc one-time initializations */
one_time_init();
- ctx = (GLcontext *) GL_CALLOC( sizeof(GLcontext) );
+ ctx = (GLcontext *) CALLOC( sizeof(GLcontext) );
if (!ctx) {
return NULL;
}
ctx->VB = gl_vb_create_for_immediate( ctx );
if (!ctx->VB) {
- GL_FREE( ctx );
+ FREE( ctx );
return NULL;
}
ctx->input = ctx->VB->IM;
ctx->PB = gl_alloc_pb();
if (!ctx->PB) {
- GL_FREE( ctx->VB );
- GL_FREE( ctx );
+ FREE( ctx->VB );
+ FREE( ctx );
return NULL;
}
/* allocate new group of display lists */
ctx->Shared = alloc_shared_state();
if (!ctx->Shared) {
- GL_FREE(ctx->VB);
- GL_FREE(ctx->PB);
- GL_FREE(ctx);
+ FREE(ctx->VB);
+ FREE(ctx->PB);
+ FREE(ctx);
return NULL;
}
}
gl_reset_input( ctx );
- ctx->ShineTabList = GL_ALLOC_STRUCT( gl_shine_tab );
+ ctx->ShineTabList = MALLOC_STRUCT( gl_shine_tab );
make_empty_list( ctx->ShineTabList );
for (i = 0 ; i < 10 ; i++) {
- struct gl_shine_tab *s = GL_ALLOC_STRUCT( gl_shine_tab );
+ struct gl_shine_tab *s = MALLOC_STRUCT( gl_shine_tab );
s->shininess = -1;
s->refcount = 0;
insert_at_tail( ctx->ShineTabList, s );
#ifdef GL_VERSION_1_1
if (!alloc_proxy_textures(ctx)) {
free_shared_state(ctx, ctx->Shared);
- GL_FREE(ctx->VB);
- GL_FREE(ctx->PB);
- GL_FREE(ctx);
+ FREE(ctx->VB);
+ FREE(ctx->PB);
+ FREE(ctx);
return NULL;
}
#endif
gl_matrix_dtr( &ctx->ProjectionStack[i] );
}
- GL_FREE( ctx->PB );
+ FREE( ctx->PB );
if(ctx->input != ctx->VB->IM)
gl_immediate_free( ctx->input );
}
foreach_s( s, tmps, ctx->ShineTabList ) {
- GL_FREE( s );
+ FREE( s );
}
- GL_FREE( ctx->ShineTabList );
+ FREE( ctx->ShineTabList );
/* Free proxy texture objects */
gl_free_texture_object( NULL, ctx->Texture.Proxy1D );
/* Free evaluator data */
if (ctx->EvalMap.Map1Vertex3.Points)
- GL_FREE( ctx->EvalMap.Map1Vertex3.Points );
+ FREE( ctx->EvalMap.Map1Vertex3.Points );
if (ctx->EvalMap.Map1Vertex4.Points)
- GL_FREE( ctx->EvalMap.Map1Vertex4.Points );
+ FREE( ctx->EvalMap.Map1Vertex4.Points );
if (ctx->EvalMap.Map1Index.Points)
- GL_FREE( ctx->EvalMap.Map1Index.Points );
+ FREE( ctx->EvalMap.Map1Index.Points );
if (ctx->EvalMap.Map1Color4.Points)
- GL_FREE( ctx->EvalMap.Map1Color4.Points );
+ FREE( ctx->EvalMap.Map1Color4.Points );
if (ctx->EvalMap.Map1Normal.Points)
- GL_FREE( ctx->EvalMap.Map1Normal.Points );
+ FREE( ctx->EvalMap.Map1Normal.Points );
if (ctx->EvalMap.Map1Texture1.Points)
- GL_FREE( ctx->EvalMap.Map1Texture1.Points );
+ FREE( ctx->EvalMap.Map1Texture1.Points );
if (ctx->EvalMap.Map1Texture2.Points)
- GL_FREE( ctx->EvalMap.Map1Texture2.Points );
+ FREE( ctx->EvalMap.Map1Texture2.Points );
if (ctx->EvalMap.Map1Texture3.Points)
- GL_FREE( ctx->EvalMap.Map1Texture3.Points );
+ FREE( ctx->EvalMap.Map1Texture3.Points );
if (ctx->EvalMap.Map1Texture4.Points)
- GL_FREE( ctx->EvalMap.Map1Texture4.Points );
+ FREE( ctx->EvalMap.Map1Texture4.Points );
if (ctx->EvalMap.Map2Vertex3.Points)
- GL_FREE( ctx->EvalMap.Map2Vertex3.Points );
+ FREE( ctx->EvalMap.Map2Vertex3.Points );
if (ctx->EvalMap.Map2Vertex4.Points)
- GL_FREE( ctx->EvalMap.Map2Vertex4.Points );
+ FREE( ctx->EvalMap.Map2Vertex4.Points );
if (ctx->EvalMap.Map2Index.Points)
- GL_FREE( ctx->EvalMap.Map2Index.Points );
+ FREE( ctx->EvalMap.Map2Index.Points );
if (ctx->EvalMap.Map2Color4.Points)
- GL_FREE( ctx->EvalMap.Map2Color4.Points );
+ FREE( ctx->EvalMap.Map2Color4.Points );
if (ctx->EvalMap.Map2Normal.Points)
- GL_FREE( ctx->EvalMap.Map2Normal.Points );
+ FREE( ctx->EvalMap.Map2Normal.Points );
if (ctx->EvalMap.Map2Texture1.Points)
- GL_FREE( ctx->EvalMap.Map2Texture1.Points );
+ FREE( ctx->EvalMap.Map2Texture1.Points );
if (ctx->EvalMap.Map2Texture2.Points)
- GL_FREE( ctx->EvalMap.Map2Texture2.Points );
+ FREE( ctx->EvalMap.Map2Texture2.Points );
if (ctx->EvalMap.Map2Texture3.Points)
- GL_FREE( ctx->EvalMap.Map2Texture3.Points );
+ FREE( ctx->EvalMap.Map2Texture3.Points );
if (ctx->EvalMap.Map2Texture4.Points)
- GL_FREE( ctx->EvalMap.Map2Texture4.Points );
+ FREE( ctx->EvalMap.Map2Texture4.Points );
/* Free cache of immediate buffers. */
while (ctx->nr_im_queued-- > 0) {
struct immediate * next = ctx->freed_im_queue->next;
- GL_FREE( ctx->freed_im_queue );
+ FREE( ctx->freed_im_queue );
ctx->freed_im_queue = next;
}
gl_extensions_dtr(ctx);
- GL_FREE( (void *) ctx );
+ FREE( (void *) ctx );
#ifndef THREADS
if (ctx==CC) {
{
GLframebuffer *buffer;
- buffer = (GLframebuffer *) GL_CALLOC( sizeof(GLframebuffer) );
+ buffer = (GLframebuffer *) CALLOC( sizeof(GLframebuffer) );
if (!buffer) {
return NULL;
}
{
if (buffer) {
if (buffer->Depth) {
- GL_FREE( buffer->Depth );
+ FREE( buffer->Depth );
}
if (buffer->Accum) {
- GL_FREE( buffer->Accum );
+ FREE( buffer->Accum );
}
if (buffer->Stencil) {
- GL_FREE( buffer->Stencil );
+ FREE( buffer->Stencil );
}
if (buffer->FrontLeftAlpha) {
- GL_FREE( buffer->FrontLeftAlpha );
+ FREE( buffer->FrontLeftAlpha );
}
if (buffer->BackLeftAlpha) {
- GL_FREE( buffer->BackLeftAlpha );
+ FREE( buffer->BackLeftAlpha );
}
if (buffer->FrontRightAlpha) {
- GL_FREE( buffer->FrontRightAlpha );
+ FREE( buffer->FrontRightAlpha );
}
if (buffer->BackRightAlpha) {
- GL_FREE( buffer->BackRightAlpha );
+ FREE( buffer->BackRightAlpha );
}
- GL_FREE(buffer);
+ FREE(buffer);
}
}
-/* $Id: depth.c,v 1.6 1999/10/11 04:22:11 joukj Exp $ */
+/* $Id: depth.c,v 1.7 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
{
/* deallocate current depth buffer if present */
if (ctx->Buffer->Depth) {
- GL_FREE(ctx->Buffer->Depth);
+ FREE(ctx->Buffer->Depth);
ctx->Buffer->Depth = NULL;
}
/* allocate new depth buffer, but don't initialize it */
- ctx->Buffer->Depth = (GLdepth *) GL_ALLOC( ctx->Buffer->Width
+ ctx->Buffer->Depth = (GLdepth *) MALLOC( ctx->Buffer->Width
* ctx->Buffer->Height
* sizeof(GLdepth) );
if (!ctx->Buffer->Depth) {
-/* $Id: dlist.c,v 1.8 1999/10/10 12:51:29 brianp Exp $ */
+/* $Id: dlist.c,v 1.9 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* This block is full. Allocate a new block and chain to it */
n = ctx->CurrentBlock + ctx->CurrentPos;
n[0].opcode = OPCODE_CONTINUE;
- newblock = (Node *) GL_ALLOC( sizeof(Node) * BLOCK_SIZE );
+ newblock = (Node *) MALLOC( sizeof(Node) * BLOCK_SIZE );
if (!newblock) {
gl_error( ctx, GL_OUT_OF_MEMORY, "Building display list" );
return NULL;
*/
static Node *make_empty_list( void )
{
- Node *n = (Node *) GL_ALLOC( sizeof(Node) );
+ Node *n = (Node *) MALLOC( sizeof(Node) );
n[0].opcode = OPCODE_END_OF_LIST;
return n;
}
n += InstSize[n[0].opcode];
break;
case OPCODE_POLYGON_STIPPLE:
- GL_FREE( n[1].data );
+ FREE( n[1].data );
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_IMAGE1D:
break;
case OPCODE_CONTINUE:
n = (Node *) n[1].next;
- GL_FREE( block );
+ FREE( block );
block = n;
break;
case OPCODE_END_OF_LIST:
- GL_FREE( block );
+ FREE( block );
done = GL_TRUE;
break;
default:
if (n) {
n[1].e = map;
n[2].i = mapsize;
- n[3].data = (void *) GL_ALLOC( mapsize * sizeof(GLfloat) );
+ n[3].data = (void *) MALLOC( mapsize * sizeof(GLfloat) );
MEMCPY( n[3].data, (void *) values, mapsize * sizeof(GLfloat) );
}
if (ctx->ExecuteFlag) {
n = alloc_instruction( ctx, OPCODE_POLYGON_STIPPLE, 1 );
if (n) {
void *data;
- n[1].data = GL_ALLOC( 32 * 4 );
+ n[1].data = MALLOC( 32 * 4 );
data = n[1].data; /* This needed for Acorn compiler */
MEMCPY( data, pattern, 32 * 4 );
}
if (!n || !new_im) {
if (n)
- GL_FREE(n);
+ FREE(n);
if (new_im)
gl_immediate_free(new_im);
return;
/* Do some easy optimizations of the cassette.
*/
if (im->v.Obj.size < 4 && im->Count > 15) {
- im->Bounds = (GLfloat (*)[3]) GL_ALLOC(6 * sizeof(GLfloat));
+ im->Bounds = (GLfloat (*)[3]) MALLOC(6 * sizeof(GLfloat));
(gl_calc_bound_tab[im->v.Obj.size])( im->Bounds, &im->v.Obj );
}
/* Allocate new display list */
ctx->CurrentListNum = list;
- ctx->CurrentBlock = (Node *) GL_ALLOC( sizeof(Node) * BLOCK_SIZE );
+ ctx->CurrentBlock = (Node *) MALLOC( sizeof(Node) * BLOCK_SIZE );
ctx->CurrentListPtr = ctx->CurrentBlock;
ctx->CurrentPos = 0;
/* KW: Put back the old input pointer.
*/
- GL_FREE( ctx->input );
+ FREE( ctx->input );
SET_IMMEDIATE( ctx, ctx->VB->IM );
gl_reset_input( ctx );
-/* $Id: enums.c,v 1.2 1999/10/10 12:51:29 brianp Exp $ */
+/* $Id: enums.c,v 1.3 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
static void sort_enums( void )
{
int i;
- index1 = (enum_elt **)GL_ALLOC( Elements(all_enums) * sizeof(enum_elt *) );
+ index1 = (enum_elt **)MALLOC( Elements(all_enums) * sizeof(enum_elt *) );
sorted = 1;
qsort( all_enums, Elements(all_enums), sizeof(*all_enums),
-/* $Id: eval.c,v 1.3 1999/10/10 12:54:04 brianp Exp $ */
+/* $Id: eval.c,v 1.4 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
return NULL;
}
- buffer = (GLfloat *) GL_ALLOC(uorder * size * sizeof(GLfloat));
+ buffer = (GLfloat *) MALLOC(uorder * size * sizeof(GLfloat));
if(buffer)
for(i=0, p=buffer; i<uorder; i++, points+=ustride)
return NULL;
}
- buffer = (GLfloat *) GL_ALLOC(uorder * size * sizeof(GLfloat));
+ buffer = (GLfloat *) MALLOC(uorder * size * sizeof(GLfloat));
if(buffer)
for(i=0, p=buffer; i<uorder; i++, points+=ustride)
hsize = (uorder > vorder ? uorder : vorder)*size;
if(hsize>dsize)
- buffer = (GLfloat *) GL_ALLOC((uorder*vorder*size+hsize)*sizeof(GLfloat));
+ buffer = (GLfloat *) MALLOC((uorder*vorder*size+hsize)*sizeof(GLfloat));
else
- buffer = (GLfloat *) GL_ALLOC((uorder*vorder*size+dsize)*sizeof(GLfloat));
+ buffer = (GLfloat *) MALLOC((uorder*vorder*size+dsize)*sizeof(GLfloat));
/* compute the increment value for the u-loop */
uinc = ustride - vorder*vstride;
hsize = (uorder > vorder ? uorder : vorder)*size;
if(hsize>dsize)
- buffer = (GLfloat *) GL_ALLOC((uorder*vorder*size+hsize)*sizeof(GLfloat));
+ buffer = (GLfloat *) MALLOC((uorder*vorder*size+hsize)*sizeof(GLfloat));
else
- buffer = (GLfloat *) GL_ALLOC((uorder*vorder*size+dsize)*sizeof(GLfloat));
+ buffer = (GLfloat *) MALLOC((uorder*vorder*size+dsize)*sizeof(GLfloat));
/* compute the increment value for the u-loop */
uinc = ustride - vorder*vstride;
else {
/* The control points in the display list are not currently */
/* being used. */
- GL_FREE( data );
+ FREE( data );
}
}
if (map2) {
else {
/* The control points in the display list are not currently */
/* being used. */
- GL_FREE( data );
+ FREE( data );
}
}
ctx->EvalMap.Map1Vertex3.du = 1.0 / (u2 - u1);
if (ctx->EvalMap.Map1Vertex3.Points
&& !ctx->EvalMap.Map1Vertex3.Retain) {
- GL_FREE( ctx->EvalMap.Map1Vertex3.Points );
+ FREE( ctx->EvalMap.Map1Vertex3.Points );
}
ctx->EvalMap.Map1Vertex3.Points = (GLfloat *) points;
ctx->EvalMap.Map1Vertex3.Retain = retain;
ctx->EvalMap.Map1Vertex4.du = 1.0 / (u2 - u1);
if (ctx->EvalMap.Map1Vertex4.Points
&& !ctx->EvalMap.Map1Vertex4.Retain) {
- GL_FREE( ctx->EvalMap.Map1Vertex4.Points );
+ FREE( ctx->EvalMap.Map1Vertex4.Points );
}
ctx->EvalMap.Map1Vertex4.Points = (GLfloat *) points;
ctx->EvalMap.Map1Vertex4.Retain = retain;
ctx->EvalMap.Map1Index.du = 1.0 / (u2 - u1);
if (ctx->EvalMap.Map1Index.Points
&& !ctx->EvalMap.Map1Index.Retain) {
- GL_FREE( ctx->EvalMap.Map1Index.Points );
+ FREE( ctx->EvalMap.Map1Index.Points );
}
ctx->EvalMap.Map1Index.Points = (GLfloat *) points;
ctx->EvalMap.Map1Index.Retain = retain;
ctx->EvalMap.Map1Color4.du = 1.0 / (u2 - u1);
if (ctx->EvalMap.Map1Color4.Points
&& !ctx->EvalMap.Map1Color4.Retain) {
- GL_FREE( ctx->EvalMap.Map1Color4.Points );
+ FREE( ctx->EvalMap.Map1Color4.Points );
}
ctx->EvalMap.Map1Color4.Points = (GLfloat *) points;
ctx->EvalMap.Map1Color4.Retain = retain;
ctx->EvalMap.Map1Normal.du = 1.0 / (u2 - u1);
if (ctx->EvalMap.Map1Normal.Points
&& !ctx->EvalMap.Map1Normal.Retain) {
- GL_FREE( ctx->EvalMap.Map1Normal.Points );
+ FREE( ctx->EvalMap.Map1Normal.Points );
}
ctx->EvalMap.Map1Normal.Points = (GLfloat *) points;
ctx->EvalMap.Map1Normal.Retain = retain;
ctx->EvalMap.Map1Texture1.du = 1.0 / (u2 - u1);
if (ctx->EvalMap.Map1Texture1.Points
&& !ctx->EvalMap.Map1Texture1.Retain) {
- GL_FREE( ctx->EvalMap.Map1Texture1.Points );
+ FREE( ctx->EvalMap.Map1Texture1.Points );
}
ctx->EvalMap.Map1Texture1.Points = (GLfloat *) points;
ctx->EvalMap.Map1Texture1.Retain = retain;
ctx->EvalMap.Map1Texture2.du = 1.0 / (u2 - u1);
if (ctx->EvalMap.Map1Texture2.Points
&& !ctx->EvalMap.Map1Texture2.Retain) {
- GL_FREE( ctx->EvalMap.Map1Texture2.Points );
+ FREE( ctx->EvalMap.Map1Texture2.Points );
}
ctx->EvalMap.Map1Texture2.Points = (GLfloat *) points;
ctx->EvalMap.Map1Texture2.Retain = retain;
ctx->EvalMap.Map1Texture3.du = 1.0 / (u2 - u1);
if (ctx->EvalMap.Map1Texture3.Points
&& !ctx->EvalMap.Map1Texture3.Retain) {
- GL_FREE( ctx->EvalMap.Map1Texture3.Points );
+ FREE( ctx->EvalMap.Map1Texture3.Points );
}
ctx->EvalMap.Map1Texture3.Points = (GLfloat *) points;
ctx->EvalMap.Map1Texture3.Retain = retain;
ctx->EvalMap.Map1Texture4.du = 1.0 / (u2 - u1);
if (ctx->EvalMap.Map1Texture4.Points
&& !ctx->EvalMap.Map1Texture4.Retain) {
- GL_FREE( ctx->EvalMap.Map1Texture4.Points );
+ FREE( ctx->EvalMap.Map1Texture4.Points );
}
ctx->EvalMap.Map1Texture4.Points = (GLfloat *) points;
ctx->EvalMap.Map1Texture4.Retain = retain;
ctx->EvalMap.Map2Vertex3.dv = 1.0 / (v2 - v1);
if (ctx->EvalMap.Map2Vertex3.Points
&& !ctx->EvalMap.Map2Vertex3.Retain) {
- GL_FREE( ctx->EvalMap.Map2Vertex3.Points );
+ FREE( ctx->EvalMap.Map2Vertex3.Points );
}
ctx->EvalMap.Map2Vertex3.Retain = retain;
ctx->EvalMap.Map2Vertex3.Points = (GLfloat *) points;
ctx->EvalMap.Map2Vertex4.dv = 1.0 / (v2 - v1);
if (ctx->EvalMap.Map2Vertex4.Points
&& !ctx->EvalMap.Map2Vertex4.Retain) {
- GL_FREE( ctx->EvalMap.Map2Vertex4.Points );
+ FREE( ctx->EvalMap.Map2Vertex4.Points );
}
ctx->EvalMap.Map2Vertex4.Points = (GLfloat *) points;
ctx->EvalMap.Map2Vertex4.Retain = retain;
ctx->EvalMap.Map2Index.dv = 1.0 / (v2 - v1);
if (ctx->EvalMap.Map2Index.Points
&& !ctx->EvalMap.Map2Index.Retain) {
- GL_FREE( ctx->EvalMap.Map2Index.Points );
+ FREE( ctx->EvalMap.Map2Index.Points );
}
ctx->EvalMap.Map2Index.Retain = retain;
ctx->EvalMap.Map2Index.Points = (GLfloat *) points;
ctx->EvalMap.Map2Color4.dv = 1.0 / (v2 - v1);
if (ctx->EvalMap.Map2Color4.Points
&& !ctx->EvalMap.Map2Color4.Retain) {
- GL_FREE( ctx->EvalMap.Map2Color4.Points );
+ FREE( ctx->EvalMap.Map2Color4.Points );
}
ctx->EvalMap.Map2Color4.Retain = retain;
ctx->EvalMap.Map2Color4.Points = (GLfloat *) points;
ctx->EvalMap.Map2Normal.dv = 1.0 / (v2 - v1);
if (ctx->EvalMap.Map2Normal.Points
&& !ctx->EvalMap.Map2Normal.Retain) {
- GL_FREE( ctx->EvalMap.Map2Normal.Points );
+ FREE( ctx->EvalMap.Map2Normal.Points );
}
ctx->EvalMap.Map2Normal.Retain = retain;
ctx->EvalMap.Map2Normal.Points = (GLfloat *) points;
ctx->EvalMap.Map2Texture1.dv = 1.0 / (v2 - v1);
if (ctx->EvalMap.Map2Texture1.Points
&& !ctx->EvalMap.Map2Texture1.Retain) {
- GL_FREE( ctx->EvalMap.Map2Texture1.Points );
+ FREE( ctx->EvalMap.Map2Texture1.Points );
}
ctx->EvalMap.Map2Texture1.Retain = retain;
ctx->EvalMap.Map2Texture1.Points = (GLfloat *) points;
ctx->EvalMap.Map2Texture2.dv = 1.0 / (v2 - v1);
if (ctx->EvalMap.Map2Texture2.Points
&& !ctx->EvalMap.Map2Texture2.Retain) {
- GL_FREE( ctx->EvalMap.Map2Texture2.Points );
+ FREE( ctx->EvalMap.Map2Texture2.Points );
}
ctx->EvalMap.Map2Texture2.Retain = retain;
ctx->EvalMap.Map2Texture2.Points = (GLfloat *) points;
ctx->EvalMap.Map2Texture3.dv = 1.0 / (v2 - v1);
if (ctx->EvalMap.Map2Texture3.Points
&& !ctx->EvalMap.Map2Texture3.Retain) {
- GL_FREE( ctx->EvalMap.Map2Texture3.Points );
+ FREE( ctx->EvalMap.Map2Texture3.Points );
}
ctx->EvalMap.Map2Texture3.Retain = retain;
ctx->EvalMap.Map2Texture3.Points = (GLfloat *) points;
ctx->EvalMap.Map2Texture4.dv = 1.0 / (v2 - v1);
if (ctx->EvalMap.Map2Texture4.Points
&& !ctx->EvalMap.Map2Texture4.Retain) {
- GL_FREE( ctx->EvalMap.Map2Texture4.Points );
+ FREE( ctx->EvalMap.Map2Texture4.Points );
}
ctx->EvalMap.Map2Texture4.Retain = retain;
ctx->EvalMap.Map2Texture4.Points = (GLfloat *) points;
GLuint count = VB->Count;
if (!flags) {
- VB->EvaluatedFlags = (GLuint *) GL_ALLOC(VB->Size * sizeof(GLuint));
+ VB->EvaluatedFlags = (GLuint *) MALLOC(VB->Size * sizeof(GLuint));
flags = VB->Flag = VB->EvaluatedFlags;
}
-/* $Id: extensions.c,v 1.6 1999/10/10 12:54:04 brianp Exp $ */
+/* $Id: extensions.c,v 1.7 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
if (ctx->Extensions.ext_string == 0)
{
- struct extension *t = GL_ALLOC_STRUCT(extension);
+ struct extension *t = MALLOC_STRUCT(extension);
t->enabled = state;
strncpy(t->name, name, MAX_EXT_NAMELEN);
t->name[MAX_EXT_NAMELEN] = 0;
struct extension *i, *nexti;
if (ctx->Extensions.ext_string) {
- GL_FREE( ctx->Extensions.ext_string );
+ FREE( ctx->Extensions.ext_string );
ctx->Extensions.ext_string = 0;
}
if (ctx->Extensions.ext_list) {
foreach_s( i, nexti, ctx->Extensions.ext_list ) {
remove_from_list( i );
- GL_FREE( i );
+ FREE( i );
}
- GL_FREE(ctx->Extensions.ext_list);
+ FREE(ctx->Extensions.ext_list);
ctx->Extensions.ext_list = 0;
}
}
GLuint i;
ctx->Extensions.ext_string = 0;
- ctx->Extensions.ext_list = GL_ALLOC_STRUCT(extension);
+ ctx->Extensions.ext_list = MALLOC_STRUCT(extension);
make_empty_list( ctx->Extensions.ext_list );
for (i = 0 ; i < Elements(default_extensions) ; i++) {
if (len == 0)
return "";
- str = (char *)GL_ALLOC(len * sizeof(char));
+ str = (char *)MALLOC(len * sizeof(char));
ctx->Extensions.ext_string = str;
foreach (i, ctx->Extensions.ext_list)
-/* $Id: hash.c,v 1.2 1999/10/08 09:27:10 keithw Exp $ */
+/* $Id: hash.c,v 1.3 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
-
-
#ifdef PC_HEADER
#include "all.h"
#else
#include "GL/xf86glx.h"
#endif
#include "hash.h"
+#include "macros.h"
#endif
*/
struct HashTable *NewHashTable(void)
{
- return (struct HashTable *) calloc(sizeof (struct HashTable), 1);
+ return CALLOC_STRUCT(HashTable);
}
struct HashEntry *entry = table->Table[i];
while (entry) {
struct HashEntry *next = entry->Next;
- free(entry);
+ FREE(entry);
entry = next;
}
}
- free(table);
+ FREE(table);
}
}
/* alloc and insert new table entry */
- entry = (struct HashEntry *) calloc(sizeof(struct HashEntry), 1);
+ entry = MALLOC_STRUCT(HashEntry);
entry->Key = key;
entry->Data = data;
entry->Next = table->Table[pos];
else {
table->Table[pos] = entry->Next;
}
- free(entry);
+ FREE(entry);
return;
}
prev = entry;
-/* $Id: image.c,v 1.5 1999/10/10 13:04:17 brianp Exp $ */
+/* $Id: image.c,v 1.6 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
static struct gl_image *alloc_image( void )
{
- return GL_CALLOC_STRUCT(gl_image);
+ return CALLOC_STRUCT(gl_image);
}
void gl_free_image( struct gl_image *image )
{
if (image->Data) {
- GL_FREE(image->Data);
+ FREE(image->Data);
}
- GL_FREE(image);
+ FREE(image);
}
image->Format = GL_DEPTH_COMPONENT;
if (type==GL_UNSIGNED_SHORT) {
image->Type = GL_UNSIGNED_SHORT;
- image->Data = GL_ALLOC( width * height * sizeof(GLushort));
+ image->Data = MALLOC( width * height * sizeof(GLushort));
}
else if (type==GL_UNSIGNED_INT) {
image->Type = GL_UNSIGNED_INT;
- image->Data = GL_ALLOC( width * height * sizeof(GLuint));
+ image->Data = MALLOC( width * height * sizeof(GLuint));
}
else {
image->Type = GL_FLOAT;
- image->Data = GL_ALLOC( width * height * sizeof(GLfloat));
+ image->Data = MALLOC( width * height * sizeof(GLfloat));
}
image->RefCount = 0;
if (!image->Data)
image->Components = 1;
image->Format = GL_STENCIL_INDEX;
image->Type = GL_UNSIGNED_BYTE;
- image->Data = GL_ALLOC( width * height * sizeof(GLubyte));
+ image->Data = MALLOC( width * height * sizeof(GLubyte));
image->RefCount = 0;
if (!image->Data)
return image;
/* Alloc dest storage */
bytes = ((width+7)/8 * height);
if (bytes>0 && pixels!=NULL) {
- buffer = (GLubyte *) GL_ALLOC( bytes );
+ buffer = (GLubyte *) MALLOC( bytes );
if (!buffer) {
return NULL;
}
GL_COLOR_INDEX, GL_BITMAP,
0, i, 0 );
if (!src) {
- GL_FREE(buffer);
+ FREE(buffer);
return NULL;
}
MEMCPY( dst, src, width_in_bytes );
image->RefCount = 0;
}
else {
- GL_FREE( buffer );
+ FREE( buffer );
return NULL;
}
components = gl_components_in_format( format );
width_in_bytes = width * components * sizeof(GLubyte);
- buffer = (GLubyte *) GL_ALLOC( height * width_in_bytes * depth );
+ buffer = (GLubyte *) MALLOC( height * width_in_bytes * depth );
if (!buffer) {
return NULL;
}
pixels, width, height, format, GL_UNSIGNED_BYTE,
d, i, 0 );
if (!src) {
- GL_FREE(buffer);
+ FREE(buffer);
return NULL;
}
MEMCPY( dst, src, width_in_bytes );
image->RefCount = 0;
}
else {
- GL_FREE( buffer );
+ FREE( buffer );
}
return image;
else
image->Format = format;
image->Type = GL_FLOAT;
- image->Data = GL_ALLOC( elems_per_row * height * depth * sizeof(GLfloat));
+ image->Data = MALLOC( elems_per_row * height * depth * sizeof(GLfloat));
image->RefCount = 0;
if (!image->Data)
return image;
-/* $Id: macros.h,v 1.4 1999/10/11 04:22:57 joukj Exp $ */
+/* $Id: macros.h,v 1.5 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
* XXX these should probably go into a new glmemory.h file.
*/
#ifdef DEBUG
-extern void *gl_alloc(size_t bytes);
+extern void *gl_malloc(size_t bytes);
extern void *gl_calloc(size_t bytes);
extern void gl_free(void *ptr);
-#define GL_ALLOC(BYTES) gl_alloc(BYTES)
-#define GL_CALLOC(BYTES) gl_calloc(BYTES)
-#define GL_ALLOC_STRUCT(T) (struct T *) GL_ALLOC(sizeof(struct T))
-#define GL_CALLOC_STRUCT(T) (struct T *) GL_CALLOC(sizeof(struct T))
-#define GL_FREE(PTR) gl_free(PTR)
+#define MALLOC(BYTES) gl_malloc(BYTES)
+#define CALLOC(BYTES) gl_calloc(BYTES)
+#define MALLOC_STRUCT(T) (struct T *) gl_malloc(sizeof(struct T))
+#define CALLOC_STRUCT(T) (struct T *) gl_calloc(sizeof(struct T))
+#define FREE(PTR) gl_free(PTR)
#else
-#define GL_ALLOC(BYTES) (void *) malloc(BYTES)
-#define GL_CALLOC(BYTES) (void *) calloc(1, BYTES)
-#define GL_ALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T))
-#define GL_CALLOC_STRUCT(T) (struct T *) calloc(1,sizeof(struct T))
-#define GL_FREE(PTR) free(PTR)
+#define MALLOC(BYTES) (void *) malloc(BYTES)
+#define CALLOC(BYTES) (void *) calloc(1, BYTES)
+#define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T))
+#define CALLOC_STRUCT(T) (struct T *) calloc(1,sizeof(struct T))
+#define FREE(PTR) free(PTR)
#endif
-/* $Id: matrix.c,v 1.6 1999/10/10 12:56:45 brianp Exp $ */
+/* $Id: matrix.c,v 1.7 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
void gl_matrix_dtr( GLmatrix *m )
{
if (m->inv != 0) {
- GL_FREE(m->inv);
+ FREE(m->inv);
m->inv = 0;
}
}
void gl_matrix_alloc_inv( GLmatrix *m )
{
if (m->inv == 0) {
- m->inv = (GLfloat *)GL_ALLOC(16*sizeof(GLfloat));
+ m->inv = (GLfloat *)MALLOC(16*sizeof(GLfloat));
MEMCPY( m->inv, Identity, 16 * sizeof(GLfloat) );
}
}
-/* $Id: stencil.c,v 1.5 1999/10/10 12:56:45 brianp Exp $ */
+/* $Id: stencil.c,v 1.6 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* deallocate current stencil buffer if present */
if (ctx->Buffer->Stencil) {
- GL_FREE(ctx->Buffer->Stencil);
+ FREE(ctx->Buffer->Stencil);
ctx->Buffer->Stencil = NULL;
}
/* allocate new stencil buffer */
- ctx->Buffer->Stencil = (GLstencil *) GL_ALLOC(buffersize * sizeof(GLstencil));
+ ctx->Buffer->Stencil = (GLstencil *) MALLOC(buffersize * sizeof(GLstencil));
if (!ctx->Buffer->Stencil) {
/* out of memory */
gl_set_enable( ctx, GL_STENCIL_TEST, GL_FALSE );
-/* $Id: teximage.c,v 1.3 1999/10/10 12:56:45 brianp Exp $ */
+/* $Id: teximage.c,v 1.4 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
struct gl_texture_image *gl_alloc_texture_image( void )
{
- return GL_CALLOC_STRUCT(gl_texture_image);
+ return CALLOC_STRUCT(gl_texture_image);
}
void gl_free_texture_image( struct gl_texture_image *teximage )
{
if (teximage->Data) {
- GL_FREE( teximage->Data );
+ FREE( teximage->Data );
}
- GL_FREE( teximage );
+ FREE( teximage );
}
texImage->Height2 = 1 << texImage->HeightLog2;
texImage->Depth2 = 1 << texImage->DepthLog2;
texImage->MaxLog2 = MAX2( texImage->WidthLog2, texImage->HeightLog2 );
- texImage->Data = (GLubyte *) GL_ALLOC( numPixels * components + EXTRA_BYTE );
+ texImage->Data = (GLubyte *) MALLOC( numPixels * components + EXTRA_BYTE );
if (!texImage->Data) {
/* out of memory */
/* XXX should we really allocate memory for the image or let it be NULL? */
/*texImage->Data = NULL;*/
- texImage->Data = (GLubyte *) GL_ALLOC( numPixels * components + EXTRA_BYTE );
+ texImage->Data = (GLubyte *) MALLOC( numPixels * components + EXTRA_BYTE );
/*
* Let's see if anyone finds this. If glTexImage2D() is called with
/*
* Allocate image struct and image data buffer
*/
- image = GL_ALLOC_STRUCT( gl_image );
+ image = MALLOC_STRUCT( gl_image );
if (image) {
image->Width = width;
image->Height = height;
image->Format = format;
image->Type = GL_UNSIGNED_BYTE;
image->RefCount = 0;
- image->Data = (GLubyte *) GL_ALLOC( width * height * components );
+ image->Data = (GLubyte *) MALLOC( width * height * components );
if (!image->Data) {
- GL_FREE(image);
+ FREE(image);
return NULL;
}
}
-/* $Id: texobj.c,v 1.5 1999/10/10 13:04:17 brianp Exp $ */
+/* $Id: texobj.c,v 1.6 1999/10/13 18:42:50 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
}
/* free this object */
- GL_FREE( t );
+ FREE( t );
}