#if defined(GLX_USE_TLS)
return CurrentContext;
#elif defined(THREADS)
- return _glthread_GetTSD(&ContextTSD);
+ return (GLXContext) _glthread_GetTSD(&ContextTSD);
#else
return CurrentContext;
#endif
_mesa_free_colortable_data(table);
if (width > 0) {
- table->TableF = _mesa_malloc(comps * width * sizeof(GLfloat));
- table->TableUB = _mesa_malloc(comps * width * sizeof(GLubyte));
+ table->TableF = (GLfloat *) _mesa_malloc(comps * width * sizeof(GLfloat));
+ table->TableUB = (GLubyte *) _mesa_malloc(comps * width * sizeof(GLubyte));
if (!table->TableF || !table->TableUB) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorTable");
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
if (count > 0) {
- unsigned i;
+ GLint i;
const GLfloat * p = params;
for (i = 0 ; i < count ; i++) {
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
if (count > 0) {
- unsigned i;
+ GLint i;
const GLfloat * p = params;
for (i = 0 ; i < count ; i++) {
return dlopen(libname, flags);
#endif
#else
- return (GenericFunc) NULL;
+ return NULL;
#endif /* USE_EXTERNAL_DXTN_LIB */
}
const struct state_key *key,
void *data )
{
- struct texenvprog_cache_item *c = MALLOC(sizeof(*c));
+ struct texenvprog_cache_item *c
+ = (struct texenvprog_cache_item *) MALLOC(sizeof(*c));
c->hash = hash;
c->key = _mesa_malloc(sizeof(*key));
memcpy(c->key, key, sizeof(*key));
- c->data = data;
+ c->data = (struct gl_fragment_program *) data;
if (cache->n_items > cache->size * 1.5) {
if (cache->size < 1000)
= _mesa_lookup_texture(ctx, textures[i]);
if (delObj) {
- GLboolean delete;
+ GLboolean deleted;
_mesa_lock_texture(ctx, delObj);
* XXX all RefCount accesses should be protected by a mutex.
*/
delObj->RefCount--;
- delete = (delObj->RefCount == 0);
+ deleted = (delObj->RefCount == 0);
_mesa_unlock_texture(ctx, delObj);
/* We know that refcount went to zero above, so this is
* the only pointer left to delObj, so we don't have to
* worry about locking any more:
*/
- if (delete) {
+ if (deleted) {
ASSERT(delObj->Name != 0); /* Never delete default tex objs */
ASSERT(ctx->Driver.DeleteTexture);
(*ctx->Driver.DeleteTexture)(ctx, delObj);
const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
- unsigned i;
+ GLint i;
GLfloat * dest;
ASSERT_OUTSIDE_BEGIN_END(ctx);
{
GET_CURRENT_CONTEXT(ctx);
struct gl_program *prog;
- unsigned i;
+ GLint i;
ASSERT_OUTSIDE_BEGIN_END(ctx);
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
void
_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog)
{
- GLint i;
+ GLuint i;
_mesa_printf("NumInstructions=%d\n", prog->NumInstructions);
_mesa_printf("NumTemporaries=%d\n", prog->NumTemporaries);
ensure_infolog_created(slang_info_log ** infolog)
{
if (*infolog == NULL) {
- *infolog = slang_alloc_malloc(sizeof(slang_info_log));
+ *infolog = (slang_info_log *) slang_alloc_malloc(sizeof(slang_info_log));
if (*infolog == NULL)
return;
slang_info_log_construct(*infolog);
}
/* clipping not supported */
- if (srcX < 0 || srcX + width > srcFb->Width ||
- srcY < 0 || srcY + height > srcFb->Height ||
+ if (srcX < 0 || srcX + width > (GLint) srcFb->Width ||
+ srcY < 0 || srcY + height > (GLint) srcFb->Height ||
dstX < dstFb->_Xmin || dstX + width > dstFb->_Xmax ||
dstY < dstFb->_Ymin || dstY + height > dstFb->_Ymax) {
return GL_FALSE;
GLint dx = -x;
GLint i;
for (i = 0; i < dx; i++)
- depth[i] = 0.0;
+ depth[i] = 0;
x = 0;
n -= dx;
depth += dx;
GLint dx = x + n - (GLint) rb->Width;
GLint i;
for (i = 0; i < dx; i++)
- depth[n - i - 1] = 0.0;
+ depth[n - i - 1] = 0;
n -= dx;
}
if (n <= 0) {
*/
if (format == GL_RGBA && type == rbType) {
- const GLubyte *src = _mesa_image_address2d(&unpack, pixels, width,
- height, format, type, 0, 0);
+ const GLubyte *src
+ = (const GLubyte *) _mesa_image_address2d(&unpack, pixels, width,
+ height, format, type, 0, 0);
const GLint srcStride = _mesa_image_row_stride(&unpack, width,
format, type);
if (simpleZoom) {
}
if (format == GL_RGB && type == rbType) {
- const GLubyte *src = _mesa_image_address2d(&unpack, pixels, width,
- height, format, type, 0, 0);
+ const GLubyte *src
+ = (const GLubyte *) _mesa_image_address2d(&unpack, pixels, width,
+ height, format, type, 0, 0);
const GLint srcStride = _mesa_image_row_stride(&unpack, width,
format, type);
if (simpleZoom) {
/* if the span is wider than MAX_WIDTH we have to do it in chunks */
while (skipPixels < width) {
const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
- const GLubyte *source = _mesa_image_address2d(unpack, pixels,
- width, height, format, type, 0, skipPixels);
+ const GLubyte *source
+ = (const GLubyte *) _mesa_image_address2d(unpack, pixels,
+ width, height, format,
+ type, 0, skipPixels);
GLint row;
for (row = 0; row < height; row++) {
/* clipping should have been done already */
ASSERT(x >= 0);
ASSERT(y >= 0);
- ASSERT(x + width <= rb->Width);
- ASSERT(y + height <= rb->Height);
+ ASSERT(x + width <= (GLint) rb->Width);
+ ASSERT(y + height <= (GLint) rb->Height);
/* width should never be > MAX_WIDTH since we did clipping earlier */
ASSERT(width <= MAX_WIDTH);
ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB);
/* clipping should have already been done */
- ASSERT(x + width <= rb->Width);
- ASSERT(y + height <= rb->Height);
+ ASSERT(x + width <= (GLint) rb->Width);
+ ASSERT(y + height <= (GLint) rb->Height);
/* check for things we can't handle here */
if (transferOps ||
if (format == GL_RGBA && rb->DataType == type) {
const GLint dstStride = _mesa_image_row_stride(packing, width,
format, type);
- GLubyte *dest = _mesa_image_address2d(packing, pixels, width, height,
- format, type, 0, 0);
+ GLubyte *dest
+ = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
GLint row;
ASSERT(rb->GetRow);
for (row = 0; row < height; row++) {
type == GL_UNSIGNED_BYTE) {
const GLint dstStride = _mesa_image_row_stride(packing, width,
format, type);
- GLubyte *dest = _mesa_image_address2d(packing, pixels, width, height,
- format, type, 0, 0);
+ GLubyte *dest
+ = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
GLint row;
ASSERT(rb->GetRow);
for (row = 0; row < height; row++) {
= _mesa_image_row_stride(packing, width, format, type);
GLfloat (*rgba)[4] = swrast->SpanArrays->color.sz4.rgba;
GLint row;
- GLubyte *dst = _mesa_image_address2d(packing, pixels, width, height,
- format, type, 0, 0);
+ GLubyte *dst
+ = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
for (row = 0; row < height; row++, y++) {
GLuint i, inCount = 0, inStart = 0;
for (i = 0; i < count; i++) {
- if (x[i] >= 0 && y[i] >= 0 && x[i] < rb->Width && y[i] < rb->Height) {
+ if (x[i] >= 0 && y[i] >= 0 &&
+ x[i] < (GLint) rb->Width &&
+ y[i] < (GLint) rb->Height) {
/* inside */
if (inCount == 0)
inStart = i;
{
GLint skip = 0;
- if (y < 0 || y >= rb->Height)
+ if (y < 0 || (GLint) y >= rb->Height)
return; /* above or below */
- if (x + (GLint) count <= 0 || x >= rb->Width)
+ if (x + (GLint) count <= 0 || x >= (GLint) rb->Width)
return; /* entirely left or right */
if (x + count > rb->Width) {
#ifdef DEBUG
/* check that array indices really fall inside [start, end] range */
{
- GLuint i;
+ GLint i;
for (i = 0; i < count; i++) {
if (ui_indices[i] < start || ui_indices[i] > end) {
_mesa_warning(ctx, "Invalid array index in "
{
struct compilation cp;
struct tnl_compiled_program *p = CALLOC_STRUCT(tnl_compiled_program);
- GLuint i;
+ GLint i;
if (program->TnlData)
free_tnl_data( program );
call_func( p, m );
}
else {
+ GLint j;
for (j = 0; j < p->nr_instructions; j++) {
union instruction inst = p->instructions[j];
opcode_func[inst.alu.opcode]( m, inst );