CONFIG_NAME = darwin
# Compiler and flags
-CC = cc
-CXX = cc
+CC = c++
+CXX = c++
CFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
CXXFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
+MKLIB_OPTIONS = -cplusplus
+
# Library names (actual file names)
GL_LIB_NAME = libGL.dylib
GLU_LIB_NAME = libGLU.dylib
*/
xmvis->vishandle = vinfo;
/* Allocate more space for additional visual */
- VisualTable = _mesa_realloc( VisualTable,
+ VisualTable = (XMesaVisual *) _mesa_realloc( VisualTable,
sizeof(XMesaVisual) * NumVisuals,
sizeof(XMesaVisual) * (NumVisuals + 1));
/* add xmvis to the list */
p.program = program;
p.program->Base.Instructions =
- _mesa_malloc(sizeof(struct prog_instruction) * MAX_INSTRUCTIONS);
+ (struct prog_instruction*) _mesa_malloc(sizeof(struct prog_instruction) * MAX_INSTRUCTIONS);
p.program->Base.NumInstructions = 0;
p.program->Base.Target = GL_FRAGMENT_PROGRAM_ARB;
p.program->NumTexIndirections = 1; /* correct? */
return 1;
}
- *File = src->param_binding_type;
+ *File = (enum register_file) src->param_binding_type;
switch (*(*inst)++) {
case ARRAY_INDEX_ABSOLUTE:
if (parse_param_use (ctx, inst, vc_head, Program, &src))
return 1;
- *File = src->param_binding_type;
+ *File = (enum register_file) src->param_binding_type;
*Index = src->param_binding_begin;
break;
}
/* XXX: We have to handle offsets someplace in here! -- or are those above? */
case vt_param:
- *File = src->param_binding_type;
+ *File = (enum register_file) src->param_binding_type;
*Index = src->param_binding_begin;
break;
GLuint i;
ASSERT(target == GL_FRAGMENT_PROGRAM_ARB);
- if (!_mesa_parse_arb_program(ctx, target, str, len, &ap)) {
+ if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len, &ap)) {
/* Error in the program. Just return. */
return;
}
ASSERT(target == GL_VERTEX_PROGRAM_ARB);
- if (!_mesa_parse_arb_program(ctx, target, str, len, &ap)) {
+ if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len, &ap)) {
/* Error in the program. Just return. */
return;
}
for (len = 0; str[len] != '\''; len++) /* find closing quote */
;
parseState->pos += len + 1;
- msg = _mesa_malloc(len + 1);
+ msg = (GLubyte*) _mesa_malloc(len + 1);
_mesa_memcpy(msg, str, len);
msg[len] = 0;
for (len = 0; str[len] != '\''; len++) /* find closing quote */
;
parseState->pos += len + 1;
- msg = _mesa_malloc(len + 1);
+ msg = (GLubyte*) _mesa_malloc(len + 1);
_mesa_memcpy(msg, str, len);
msg[len] = 0;
paramList->Size * sizeof(struct program_parameter));
tmp = paramList->ParameterValues;
- paramList->ParameterValues = ALIGN_MALLOC(paramList->Size * 4 * sizeof(GLfloat), 16);
+ paramList->ParameterValues = (GLfloat(*)[4]) ALIGN_MALLOC(paramList->Size * 4 * sizeof(GLfloat), 16);
if (tmp) {
_mesa_memcpy(paramList->ParameterValues, tmp,
n * 4 * sizeof(GLfloat));
char tmp[30];
append(str, "state.");
- append_token(str, state[0]);
+ append_token(str, (enum state_index) state[0]);
switch (state[0]) {
case STATE_MATERIAL:
append_face(str, state[1]);
- append_token(str, state[2]);
+ append_token(str, (enum state_index) state[2]);
break;
case STATE_LIGHT:
append(str, "light");
append_index(str, state[1]); /* light number [i]. */
- append_token(str, state[2]); /* coefficients */
+ append_token(str, (enum state_index) state[2]); /* coefficients */
break;
case STATE_LIGHTMODEL_AMBIENT:
append(str, "lightmodel.ambient");
case STATE_LIGHTPROD:
append_index(str, state[1]); /* light number [i]. */
append_face(str, state[2]);
- append_token(str, state[3]);
+ append_token(str, (enum state_index) state[3]);
break;
case STATE_TEXGEN:
append_index(str, state[1]); /* tex unit [i] */
- append_token(str, state[2]); /* plane coef */
+ append_token(str, (enum state_index) state[2]); /* plane coef */
break;
case STATE_TEXENV_COLOR:
append_index(str, state[1]); /* tex unit [i] */
/* state[3] = first column to fetch */
/* state[4] = last column to fetch */
/* state[5] = transpose, inverse or invtrans */
- const enum state_index mat = state[1];
+ const enum state_index mat = (enum state_index) state[1];
const GLuint index = (GLuint) state[2];
const GLuint first = (GLuint) state[3];
const GLuint last = (GLuint) state[4];
- const enum state_index modifier = state[5];
+ const enum state_index modifier = (enum state_index) state[5];
append_token(str, mat);
if (index)
append_index(str, index);
case STATE_VERTEX_PROGRAM:
/* state[1] = {STATE_ENV, STATE_LOCAL} */
/* state[2] = parameter index */
- append_token(str, state[1]);
+ append_token(str, (enum state_index) state[1]);
append_index(str, state[2]);
break;
case STATE_INTERNAL:
print_dst_reg(const struct prog_dst_register *dstReg)
{
_mesa_printf(" %s[%d]%s",
- program_file_string(dstReg->File),
+ program_file_string((enum register_file) dstReg->File),
dstReg->Index,
writemask_string(dstReg->WriteMask));
}
print_src_reg(const struct prog_src_register *srcReg)
{
_mesa_printf("%s[%d]%s",
- program_file_string(srcReg->File),
+ program_file_string((enum register_file) srcReg->File),
srcReg->Index,
swizzle_string(srcReg->Swizzle,
srcReg->NegateBase, GL_FALSE));
if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) {
_mesa_printf(", ");
_mesa_printf("%s[%d]%s",
- program_file_string(inst->SrcReg[0].File),
+ program_file_string((enum register_file) inst->SrcReg[0].File),
inst->SrcReg[0].Index,
swizzle_string(inst->SrcReg[0].Swizzle,
inst->SrcReg[0].NegateBase, GL_FALSE));
_mesa_printf("_SAT");
print_dst_reg(&inst->DstReg);
_mesa_printf("%s[%d], %s;\n",
- program_file_string(inst->SrcReg[0].File),
+ program_file_string((enum register_file) inst->SrcReg[0].File),
inst->SrcReg[0].Index,
swizzle_string(inst->SrcReg[0].Swizzle,
inst->SrcReg[0].NegateBase, GL_TRUE));
if (inst->DstReg.File != PROGRAM_UNDEFINED) {
_mesa_printf(" %s[%d]%s",
- program_file_string(inst->DstReg.File),
+ program_file_string((enum register_file) inst->DstReg.File),
inst->DstReg.Index,
writemask_string(inst->DstReg.WriteMask));
}
zbuffer = zbuffer16;
}
else {
- zbuffer = rb->GetPointer(ctx, rb, span->x, span->y);
+ zbuffer = (GLushort*) rb->GetPointer(ctx, rb, span->x, span->y);
if (!zbuffer) {
rb->GetRow(ctx, rb, count, span->x, span->y, zbuffer16);
zbuffer = zbuffer16;
zbuffer = zbuffer32;
}
else {
- zbuffer = rb->GetPointer(ctx, rb, span->x, span->y);
+ zbuffer = (GLuint*) rb->GetPointer(ctx, rb, span->x, span->y);
if (!zbuffer) {
rb->GetRow(ctx, rb, count, span->x, span->y, zbuffer32);
zbuffer = zbuffer32;
}
#endif
- stencil = rb->GetPointer(ctx, rb, x, y);
+ stencil = (GLstencil *) rb->GetPointer(ctx, rb, x, y);
if (!stencil) {
rb->GetRow(ctx, rb, n, x, y, stencilRow);
stencil = stencilRow;
if (rb->DataType == GL_UNSIGNED_BYTE) {
GLint i, j;
for (i = 0; i < height; i++) {
- GLubyte *stencil = rb->GetPointer(ctx, rb, x, y + i);
+ GLubyte *stencil = (GLubyte*) rb->GetPointer(ctx, rb, x, y + i);
for (j = 0; j < width; j++) {
stencil[j] = (stencil[j] & invMask) | clearVal;
}
else {
GLint i, j;
for (i = 0; i < height; i++) {
- GLushort *stencil = rb->GetPointer(ctx, rb, x, y + i);
+ GLushort *stencil = (GLushort*) rb->GetPointer(ctx, rb, x, y + i);
for (j = 0; j < width; j++) {
stencil[j] = (stencil[j] & invMask) | clearVal;
}
if (width == rb->Width && rb->DataType == GL_UNSIGNED_BYTE) {
/* optimized case */
/* Note: bottom-to-top raster assumed! */
- GLubyte *stencil = rb->GetPointer(ctx, rb, x, y);
+ GLubyte *stencil = (GLubyte *) rb->GetPointer(ctx, rb, x, y);
GLuint len = width * height * sizeof(GLubyte);
_mesa_memset(stencil, clearVal, len);
}
_mesa_memset(stencil, clearVal, width);
}
else {
- _mesa_memset16(stencil, clearVal, width);
+ _mesa_memset16((short unsigned int*) stencil, clearVal, width);
}
}
}
_tnl_vtx_init( ctx );
if (ctx->_MaintainTnlProgram) {
- tnl->vp_cache = MALLOC(sizeof(*tnl->vp_cache));
+ tnl->vp_cache = (struct tnl_cache *) MALLOC(sizeof(*tnl->vp_cache));
tnl->vp_cache->size = 5;
tnl->vp_cache->n_items = 0;
- tnl->vp_cache->items = MALLOC(tnl->vp_cache->size *
- sizeof(*tnl->vp_cache->items));
+ tnl->vp_cache->items = (struct tnl_cache_item**)
+ _mesa_malloc(tnl->vp_cache->size * sizeof(*tnl->vp_cache->items));
_mesa_memset(tnl->vp_cache->items, 0, tnl->vp_cache->size *
sizeof(*tnl->vp_cache->items));
GLuint attr_count;
GLboolean match_strides;
- struct {
+ struct attr_type {
GLuint format;
GLuint size;
GLuint stride;
static void print_ALU( union instruction op )
{
- _mesa_printf("%s ", _mesa_opcode_string(op.alu.opcode));
+ _mesa_printf("%s ", _mesa_opcode_string((enum prog_opcode) op.alu.opcode));
print_reg(0, op.alu.dst);
_mesa_printf(", ");
print_reg(op.alu.file0, op.alu.idx0);
- if (_mesa_num_inst_src_regs(op.alu.opcode) > 1) {
+ if (_mesa_num_inst_src_regs((enum prog_opcode) op.alu.opcode) > 1) {
_mesa_printf(", ");
print_reg(op.alu.file1, op.alu.idx1);
}
static void free_tnl_data( struct vertex_program *program )
{
- struct tnl_compiled_program *p = program->TnlData;
+ struct tnl_compiled_program *p = (struct tnl_compiled_program *) program->TnlData;
if (p->compiled_func)
_mesa_free((void *)p->compiled_func);
_mesa_free(p);
*/
m->VB = VB;
- m->File[0] = ALIGN_MALLOC(REG_MAX * sizeof(GLfloat) * 4, 16);
+ m->File[0] = (GLfloat(*)[4])ALIGN_MALLOC(REG_MAX * sizeof(GLfloat) * 4, 16);
/* Initialize regs where necessary:
*/
fastpath->attr_count = vtx->attr_count;
fastpath->match_strides = match_strides;
fastpath->func = vtx->emit;
- fastpath->attr = MALLOC(vtx->attr_count * sizeof(fastpath->attr[0]));
+ fastpath->attr = (struct attr_type *)
+ _mesa_malloc(vtx->attr_count * sizeof(fastpath->attr[0]));
for (i = 0; i < vtx->attr_count; i++) {
fastpath->attr[i].format = vtx->attr[i].format;
/* Note: dest should not be adjusted for non-zero 'start' values:
*/
- vtx->emit( ctx, end - start, dest );
+ vtx->emit( ctx, end - start, (GLubyte*) dest );
return (void *)((GLubyte *)dest + vtx->vertex_size * (end - start));
}
return;
}
- inst->Opcode = op;
+ inst->Opcode = (enum prog_opcode) op;
inst->StringPos = 0;
inst->Data = 0;
p.temp_reserved = ~((1<<max_temps)-1);
p.program->Base.Instructions
- = MALLOC(sizeof(struct prog_instruction) * MAX_INSN);
+ = (struct prog_instruction*) MALLOC(sizeof(struct prog_instruction) * MAX_INSN);
p.program->Base.String = 0;
p.program->Base.NumInstructions =
p.program->Base.NumTemporaries =
GLuint size, i;
size = cache->size * 3;
- items = MALLOC(size * sizeof(*items));
+ items = (struct tnl_cache_item**) _mesa_malloc(size * sizeof(*items));
_mesa_memset(items, 0, size * sizeof(*items));
for (i = 0; i < cache->size; i++)
void *key,
void *data )
{
- struct tnl_cache_item *c = MALLOC(sizeof(*c));
+ struct tnl_cache_item *c = (struct tnl_cache_item*) _mesa_malloc(sizeof(*c));
c->hash = hash;
c->key = key;
c->data = data;