XMesaBuffer source = xmesa->xm_buffer;
Window rootWin = RootWindow(xmesa->display, 0);
Window child;
- int screenWidth = WidthOfScreen(DefaultScreenOfDisplay(xmesa->display));
- int dx, dy;
+ GLint screenWidth = WidthOfScreen(DefaultScreenOfDisplay(xmesa->display));
+ GLint dx, dy;
XTranslateCoordinates(xmesa->display, source->buffer, rootWin,
*x, *y, &dx, &dy, &child);
if (dx >= screenWidth) {
}
if (dx < 0) {
/* clipped on left */
- int clip = -dx;
- if (clip >= *n)
+ GLint clip = -dx;
+ if (clip >= (GLint) *n)
return -1; /* totally clipped on left */
*x += clip;
*n -= clip;
dx = 0;
return clip;
}
- if (dx + *n > screenWidth) {
+ if ((GLint) (dx + *n) > screenWidth) {
/* clipped on right */
- int clip = dx + *n - screenWidth;
+ GLint clip = dx + *n - screenWidth;
*n -= clip;
}
return 0;
print ' */'
print ''
print 'typedef struct {'
- print ' int Name_offset;'
+ print ' GLint Name_offset;'
print '#ifdef NEED_FUNCTION_POINTER'
print ' _glapi_proc Address;'
print '#endif'
- print ' unsigned int Offset;'
+ print ' GLuint Offset;'
print '} glprocs_table_t;'
print ''
print '#ifdef NEED_FUNCTION_POINTER'
base_offset += len(self.functions[k].name) + 3
- print ' NAME_FUNC_OFFSET( -1, NULL, -1 )'
+ print ' NAME_FUNC_OFFSET( -1, NULL, 0 )'
print '};'
return
#define TABLE_ENTRY(name) (_glapi_proc) NoOp##name
-static int NoOpUnused(void)
+static GLint NoOpUnused(void)
{
if (warn()) {
warning_func(NULL, "GL User Error: calling extension function without a current context\n");
#define TABLE_ENTRY(name) (_glapi_proc) gl##name
-static int glUnused(void)
+static GLint glUnused(void)
{
return 0;
}
static const glprocs_table_t *
find_entry( const char * n )
{
- unsigned i;
+ GLuint i;
- for ( i = 0 ; static_functions[i].Name_offset >= 0 ; i++ ) {
+ for (i = 0; static_functions[i].Name_offset >= 0; i++) {
const char * test_name;
test_name = gl_string_table + static_functions[i].Name_offset;
static const char *
get_static_proc_name( GLuint offset )
{
- unsigned i;
+ GLuint i;
- for ( i = 0 ; static_functions[i].Name_offset >= 0 ; i++ ) {
+ for (i = 0; static_functions[i].Name_offset >= 0; i++) {
if (static_functions[i].Offset == offset) {
return gl_string_table + static_functions[i].Name_offset;
}
GLuint offset = (pointParameterivFunc - (char *) table) / sizeof(void *);
assert(pointParameterivOffset == _gloffset_PointParameterivNV);
assert(pointParameterivOffset == offset);
- assert(_glapi_get_proc_address("glPointParameterivNV") == &glPointParameterivNV);
+ assert(_glapi_get_proc_address("glPointParameterivNV") == (_glapi_proc) &glPointParameterivNV);
}
{
GLuint setFenceOffset = _glapi_get_proc_offset("glSetFenceNV");
GLuint offset = (setFenceFunc - (char *) table) / sizeof(void *);
assert(setFenceOffset == _gloffset_SetFenceNV);
assert(setFenceOffset == offset);
- assert(_glapi_get_proc_address("glSetFenceNV") == &glSetFenceNV);
+ assert(_glapi_get_proc_address("glSetFenceNV") == (_glapi_proc) &glSetFenceNV);
}
#else
(void) table;
*/
typedef struct {
- int Name_offset;
+ GLint Name_offset;
#ifdef NEED_FUNCTION_POINTER
_glapi_proc Address;
#endif
- unsigned int Offset;
+ GLuint Offset;
} glprocs_table_t;
#ifdef NEED_FUNCTION_POINTER
NAME_FUNC_OFFSET( 17136, glBlendFuncSeparateINGR, _gloffset_BlendFuncSeparateEXT ),
NAME_FUNC_OFFSET( 17160, glPointParameterfSGIS, _gloffset_PointParameterfEXT ),
NAME_FUNC_OFFSET( 17182, glPointParameterfvSGIS, _gloffset_PointParameterfvEXT ),
- NAME_FUNC_OFFSET( -1, NULL, -1 )
+ NAME_FUNC_OFFSET( -1, NULL, 0 )
};
#undef NAME_FUNC_OFFSET
_mesa_validate_blend_equation( GLcontext *ctx,
GLenum mode, GLboolean is_separate )
{
- switch (mode) {
+ switch (mode) {
case GL_FUNC_ADD:
break;
case GL_MIN:
(*ctx->Driver.BlendEquationSeparate)( ctx, mode, mode );
}
+
void GLAPIENTRY
_mesa_BlendEquationSeparateEXT( GLenum modeRGB, GLenum modeA )
{
ctx->Driver.ColorMask( ctx, red, green, blue, alpha );
}
+
/**********************************************************************/
/** \name Initialization */
/*@{*/
void _mesa_init_color( GLcontext * ctx )
{
/* Color buffer group */
- ctx->Color.IndexMask = 0xffffffff;
+ ctx->Color.IndexMask = ~0u;
ctx->Color.ColorMask[0] = 0xff;
ctx->Color.ColorMask[1] = 0xff;
ctx->Color.ColorMask[2] = 0xff;
supported_buffer_bitmask(const GLcontext *ctx)
{
GLuint mask = DD_FRONT_LEFT_BIT; /* always have this */
- GLuint i;
+ GLint i;
if (ctx->Visual.stereoMode) {
mask |= DD_FRONT_RIGHT_BIT;
* Do error checking and compute the _DrawDestMask bitfield.
*/
destMask = draw_buffer_enum_to_bitmask(mode);
- if (destMask == ~0) {
+ if (destMask == ~0u) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(mode)");
return;
}
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (n < 1 || n > ctx->Const.MaxDrawBuffers) {
+ if (n < 1 || n > (GLsizei) ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glDrawBuffersARB(n)" );
return;
}
usedBufferMask = 0;
for (i = 0; i < n; i++) {
GLuint destMask = draw_buffer_enum_to_bitmask(buffers[i]);
- if (destMask == ~0) {
+ if (destMask == ~0u ) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffersARB(buffer)");
return;
}
_mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(mode));
srcMask = read_buffer_enum_to_bitmask(mode);
- if (srcMask == ~0) {
+ if (srcMask == ~0u) {
_mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(mode)");
return;
}
(struct _glapi_table *) _mesa_malloc(numEntries * sizeof(_glapi_proc));
if (table) {
_glapi_proc *entry = (_glapi_proc *) table;
- GLuint i;
+ GLint i;
for (i = 0; i < numEntries; i++) {
entry[i] = (_glapi_proc) generic_nop;
}
*srcX = 0;
}
/* right clipping */
- if (*srcX + *width > buffer->Width)
+ if (*srcX + *width > (GLsizei) buffer->Width)
*width -= (*srcX + *width - buffer->Width);
if (*width <= 0)
*srcY = 0;
}
/* top clipping */
- if (*srcY + *height > buffer->Height)
+ if (*srcY + *height > (GLsizei) buffer->Height)
*height -= (*srcY + *height - buffer->Height);
if (*height <= 0)
#define ISTBLACK(v) (*((unsigned long *)(v)) == 0)
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__cplusplus)
#define FX64_NATIVE 1
/* left microtile */
if (maxColL == -1) {
/* all transparent black */
- cc[0] = -1;
+ cc[0] = ~0ul;
for (i = 0; i < n_comp; i++) {
vec[0][i] = 0;
vec[1][i] = 0;
/* right microtile */
if (maxColR == -1) {
/* all transparent black */
- cc[1] = -1;
+ cc[1] = ~0ul;
for (i = 0; i < n_comp; i++) {
vec[2][i] = 0;
vec[3][i] = 0;
if (trualpha) {
fxt1_quantize_ALPHA1(cc, input);
} else if (l == 0) {
- cc[0] = cc[1] = cc[2] = -1;
+ cc[0] = cc[1] = cc[2] = ~0ul;
cc[3] = 0;
} else if (l < N_TEXELS) {
fxt1_quantize_MIXED1(cc, input);
{
unsigned int x, y;
const unsigned char *data;
- unsigned long *encoded = dest;
+ unsigned long *encoded = (unsigned long *) dest;
unsigned char *newSource = NULL;
/* Replicate image if width is not M8 or height is not M4 */
if ((width & 7) | (height & 3)) {
int newWidth = (width + 7) & ~7;
int newHeight = (height + 3) & ~3;
- newSource = malloc(comps * newWidth * newHeight * sizeof(unsigned char *));
+ newSource = (unsigned char *)
+ _mesa_malloc(comps * newWidth * newHeight * sizeof(unsigned char *));
_mesa_upscale_teximage2d(width, height, newWidth, newHeight,
- comps, source, srcRowStride, newSource);
+ comps, (const GLchan *) source,
+ srcRowStride, newSource);
source = newSource;
width = newWidth;
height = newHeight;
srcRowStride = comps * newWidth;
}
- data = source;
+ data = (const unsigned char *) source;
destRowStride = (destRowStride - width * 2) / 4;
for (y = 0; y < height; y += 4) {
unsigned int offs = 0 + (y + 0) * srcRowStride;
return NULL;
}
- buf = ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- GL_READ_ONLY_ARB, unpack->BufferObj);
+ buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ GL_READ_ONLY_ARB, unpack->BufferObj);
if (!buf) {
_mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped");
return NULL;
return NULL;
}
- buf = ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- GL_READ_ONLY_ARB, packing->BufferObj);
+ buf = (GLubyte*) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
+ GL_READ_ONLY_ARB, packing->BufferObj);
if (!buf) {
_mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped");
return NULL;
make_empty_list(&p->codegen_list);
p->buf_size = 2048;
- p->buf = MALLOC(p->buf_size);
+ p->buf = (char *) MALLOC(p->buf_size);
}