Fix some signedness issues
This commit is contained in:
parent
8b206f012e
commit
724ff628aa
|
@ -230,7 +230,7 @@ void APIENTRY glColorMaterial(GLenum face, GLenum mode) {
|
|||
return;
|
||||
}
|
||||
|
||||
GLenum validModes[] = {GL_AMBIENT, GL_DIFFUSE, GL_AMBIENT_AND_DIFFUSE, GL_EMISSION, GL_SPECULAR, 0};
|
||||
GLint validModes[] = {GL_AMBIENT, GL_DIFFUSE, GL_AMBIENT_AND_DIFFUSE, GL_EMISSION, GL_SPECULAR, 0};
|
||||
|
||||
if(_glCheckValidEnum(mode, validModes, __func__) != 0) {
|
||||
return;
|
||||
|
|
|
@ -131,7 +131,7 @@ typedef struct {
|
|||
GLint size;
|
||||
} AttribPointer;
|
||||
|
||||
GLboolean _glCheckValidEnum(GLint param, GLenum* values, const char* func);
|
||||
GLboolean _glCheckValidEnum(GLint param, GLint* values, const char* func);
|
||||
|
||||
GLuint _glGetEnabledAttributes();
|
||||
AttribPointer* _glGetVertexAttribPointer();
|
||||
|
|
18
GL/state.c
18
GL/state.c
|
@ -110,7 +110,7 @@ static int _calcPVRBlendFactor(GLenum factor) {
|
|||
case GL_ONE:
|
||||
return PVR_BLEND_ONE;
|
||||
default:
|
||||
fprintf(stderr, "Invalid blend mode: %d\n", factor);
|
||||
fprintf(stderr, "Invalid blend mode: %u\n", (unsigned int) factor);
|
||||
return PVR_BLEND_ONE;
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ static void _updatePVRBlend(pvr_poly_cxt_t* context) {
|
|||
}
|
||||
}
|
||||
|
||||
GLboolean _glCheckValidEnum(GLint param, GLenum* values, const char* func) {
|
||||
GLboolean _glCheckValidEnum(GLint param, GLint* values, const char* func) {
|
||||
GLubyte found = 0;
|
||||
while(*values != 0) {
|
||||
if(*values == param) {
|
||||
|
@ -478,7 +478,7 @@ GLAPI void APIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor) {
|
|||
#define PT_ALPHA_REF 0x011c
|
||||
|
||||
GLAPI void APIENTRY glAlphaFunc(GLenum func, GLclampf ref) {
|
||||
GLenum validFuncs[] = {
|
||||
GLint validFuncs[] = {
|
||||
GL_GREATER,
|
||||
0
|
||||
};
|
||||
|
@ -662,20 +662,20 @@ void APIENTRY glGetIntegerv(GLenum pname, GLint *params) {
|
|||
}
|
||||
}
|
||||
|
||||
const GLbyte *glGetString(GLenum name) {
|
||||
const GLubyte *glGetString(GLenum name) {
|
||||
switch(name) {
|
||||
case GL_VENDOR:
|
||||
return "KallistiOS / Kazade";
|
||||
return (const GLubyte*) "KallistiOS / Kazade";
|
||||
|
||||
case GL_RENDERER:
|
||||
return "PowerVR2 CLX2 100mHz";
|
||||
return (const GLubyte*) "PowerVR2 CLX2 100mHz";
|
||||
|
||||
case GL_VERSION:
|
||||
return "1.2 (partial) - GLdc 1.0";
|
||||
return (const GLubyte*) "1.2 (partial) - GLdc 1.0";
|
||||
|
||||
case GL_EXTENSIONS:
|
||||
return "GL_ARB_framebuffer_object, GL_ARB_multitexture, GL_ARB_texture_rg, GL_EXT_paletted_texture, GL_EXT_shared_texture_palette, GL_KOS_multiple_shared_palette";
|
||||
return (const GLubyte*) "GL_ARB_framebuffer_object, GL_ARB_multitexture, GL_ARB_texture_rg, GL_EXT_paletted_texture, GL_EXT_shared_texture_palette, GL_KOS_multiple_shared_palette";
|
||||
}
|
||||
|
||||
return "GL_KOS_ERROR: ENUM Unsupported\n";
|
||||
return (const GLubyte*) "GL_KOS_ERROR: ENUM Unsupported\n";
|
||||
}
|
||||
|
|
16
GL/texture.c
16
GL/texture.c
|
@ -325,7 +325,7 @@ void APIENTRY glDeleteTextures(GLsizei n, GLuint *textures) {
|
|||
void APIENTRY glBindTexture(GLenum target, GLuint texture) {
|
||||
TRACE();
|
||||
|
||||
GLenum target_values [] = {GL_TEXTURE_2D, 0};
|
||||
GLint target_values [] = {GL_TEXTURE_2D, 0};
|
||||
|
||||
if(_glCheckValidEnum(target, target_values, __func__) != 0) {
|
||||
return;
|
||||
|
@ -348,9 +348,9 @@ void APIENTRY glBindTexture(GLenum target, GLuint texture) {
|
|||
void APIENTRY glTexEnvi(GLenum target, GLenum pname, GLint param) {
|
||||
TRACE();
|
||||
|
||||
GLenum target_values [] = {GL_TEXTURE_ENV, 0};
|
||||
GLenum pname_values [] = {GL_TEXTURE_ENV_MODE, 0};
|
||||
GLenum param_values [] = {GL_MODULATE, GL_DECAL, GL_REPLACE, 0};
|
||||
GLint target_values [] = {GL_TEXTURE_ENV, 0};
|
||||
GLint pname_values [] = {GL_TEXTURE_ENV_MODE, 0};
|
||||
GLint param_values [] = {GL_MODULATE, GL_DECAL, GL_REPLACE, 0};
|
||||
|
||||
GLubyte failures = 0;
|
||||
|
||||
|
@ -1074,7 +1074,7 @@ void APIENTRY glTexParameterf(GLenum target, GLenum pname, GLint param) {
|
|||
}
|
||||
|
||||
GLAPI void APIENTRY glColorTableEXT(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *data) {
|
||||
GLenum validTargets[] = {
|
||||
GLint validTargets[] = {
|
||||
GL_TEXTURE_2D,
|
||||
GL_SHARED_TEXTURE_PALETTE_EXT,
|
||||
GL_SHARED_TEXTURE_PALETTE_0_KOS,
|
||||
|
@ -1084,9 +1084,9 @@ GLAPI void APIENTRY glColorTableEXT(GLenum target, GLenum internalFormat, GLsize
|
|||
0
|
||||
};
|
||||
|
||||
GLenum validInternalFormats[] = {GL_RGB8, GL_RGBA8, 0};
|
||||
GLenum validFormats[] = {GL_RGB, GL_RGBA, 0};
|
||||
GLenum validTypes[] = {GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, 0};
|
||||
GLint validInternalFormats[] = {GL_RGB8, GL_RGBA8, 0};
|
||||
GLint validFormats[] = {GL_RGB, GL_RGBA, 0};
|
||||
GLint validTypes[] = {GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, 0};
|
||||
|
||||
if(_glCheckValidEnum(target, validTargets, __func__) != 0) {
|
||||
return;
|
||||
|
|
|
@ -369,11 +369,11 @@ __BEGIN_DECLS
|
|||
#define GLushort unsigned short
|
||||
#define GLuint unsigned int
|
||||
#define GLenum unsigned int
|
||||
#define GLsizei unsigned long
|
||||
#define GLsizei unsigned int
|
||||
#define GLfixed const unsigned int
|
||||
#define GLclampf float
|
||||
#define GLubyte unsigned char
|
||||
#define GLbitfield unsigned long
|
||||
#define GLbitfield unsigned int
|
||||
#define GLboolean unsigned char
|
||||
#define GL_FALSE 0
|
||||
#define GL_TRUE 1
|
||||
|
@ -619,7 +619,7 @@ GLAPI void APIENTRY glGetBooleanv(GLenum pname, GLboolean* params);
|
|||
GLAPI void APIENTRY glGetIntegerv(GLenum pname, GLint *params);
|
||||
GLAPI void APIENTRY glGetFloatv(GLenum pname, GLfloat *params);
|
||||
GLAPI GLboolean APIENTRY glIsEnabled(GLenum cap);
|
||||
GLAPI const GLbyte* APIENTRY glGetString(GLenum name);
|
||||
GLAPI const GLubyte* APIENTRY glGetString(GLenum name);
|
||||
|
||||
/* Error handling */
|
||||
GLAPI GLenum APIENTRY glGetError(void);
|
||||
|
|
Loading…
Reference in New Issue
Block a user