static GLvoid
emit_create (emit ** em)
{
- *em = mem_alloc (sizeof (emit));
+ *em = (emit *) mem_alloc (sizeof (emit));
if (*em) {
(**em).m_emit_type = et_byte;
(**em).m_byte = 0;
static GLvoid
error_create (error ** er)
{
- *er = mem_alloc (sizeof (error));
+ *er = (error *) mem_alloc (sizeof (error));
if (*er) {
(**er).m_text = NULL;
(**er).m_token_name = NULL;
static GLvoid
spec_create (spec ** sp)
{
- *sp = mem_alloc (sizeof (spec));
+ *sp = (spec *) mem_alloc (sizeof (spec));
if (*sp) {
(**sp).m_spec_type = st_false;
(**sp).m_byte[0] = '\0';
static GLvoid
defntn_create (defntn ** de)
{
- *de = mem_alloc (sizeof (defntn));
+ *de = (defntn *) mem_alloc (sizeof (defntn));
if (*de) {
(**de).m_oper = op_none;
(**de).m_specs = NULL;
static GLvoid
dict_create (dict ** di)
{
- *di = mem_alloc (sizeof (dict));
+ *di = (dict *) mem_alloc (sizeof (dict));
if (*di) {
(**di).m_defntns = NULL;
(**di).m_syntax = NULL;
static GLvoid
barray_create (barray ** ba)
{
- *ba = mem_alloc (sizeof (barray));
+ *ba = (barray *) mem_alloc (sizeof (barray));
if (*ba) {
(**ba).data = NULL;
(**ba).len = 0;
return 0;
}
else {
- new_pointer =
+ new_pointer = (GLubyte *)
mem_realloc ((**ba).data, (**ba).len * sizeof (GLubyte),
nlen * sizeof (GLubyte));
if (new_pointer) {
static GLvoid
map_str_create (map_str ** ma)
{
- *ma = mem_alloc (sizeof (map_str));
+ *ma = (map_str *) mem_alloc (sizeof (map_str));
if (*ma) {
(**ma).key = NULL;
(**ma).data = NULL;
static GLvoid
map_byte_create (map_byte ** ma)
{
- *ma = mem_alloc (sizeof (map_byte));
+ *ma = (map_byte *) mem_alloc (sizeof (map_byte));
if (*ma) {
(**ma).key = NULL;
(**ma).data = 0;
static GLvoid
map_def_create (map_def ** ma)
{
- *ma = mem_alloc (sizeof (map_def));
+ *ma = (map_def *) mem_alloc (sizeof (map_def));
if (*ma) {
(**ma).key = NULL;
(**ma).data = NULL;
{
/* reallocate the string in 16-length increments */
if ((*len & 0x0F) == 0x0F || *ptr == NULL) {
- GLubyte *tmp = mem_realloc (*ptr, (*len) * sizeof (GLubyte),
+ GLubyte *tmp = (GLubyte *) mem_realloc (*ptr, (*len) * sizeof (GLubyte),
((*len + 1 + 1 +
0x0F) & ~0x0F) * sizeof (GLubyte));
if (tmp == NULL)
if (ba != NULL) {
if (match (di, text + ind, &filter_index, er->m_token, &ba, 0) ==
mr_matched && filter_index) {
- str = mem_alloc (filter_index + 1);
+ str = (GLubyte *) mem_alloc (filter_index + 1);
if (str != NULL) {
_mesa_strncpy ((char *) str, (char *) (text + ind),
filter_index);
static GLvoid
grammar_load_state_create (grammar_load_state ** gr)
{
- *gr = mem_alloc (sizeof (grammar_load_state));
+ *gr = (grammar_load_state *) mem_alloc (sizeof (grammar_load_state));
if (*gr) {
(**gr).di = NULL;
(**gr).syntax_symbol = NULL;
return 0;
}
- *production = mem_alloc (ba->len * sizeof (GLubyte));
+ *production = (GLubyte *) mem_alloc (ba->len * sizeof (GLubyte));
if (*production == NULL) {
barray_destroy (&ba);
return 0;
static GLvoid
var_cache_create (struct var_cache **va)
{
- *va = _mesa_malloc (sizeof (struct var_cache));
+ *va = (struct var_cache *) _mesa_malloc (sizeof (struct var_cache));
if (*va) {
(**va).name = NULL;
(**va).type = vt_none;
- (**va).attrib_binding = -1;
+ (**va).attrib_binding = ~0;
(**va).attrib_is_generic = 0;
- (**va).temp_binding = -1;
- (**va).output_binding = -1;
- (**va).output_binding_idx = -1;
- (**va).param_binding_type = -1;
- (**va).param_binding_begin = -1;
- (**va).param_binding_length = -1;
+ (**va).temp_binding = ~0;
+ (**va).output_binding = ~0;
+ (**va).output_binding_idx = ~0;
+ (**va).param_binding_type = ~0;
+ (**va).param_binding_begin = ~0;
+ (**va).param_binding_length = ~0;
(**va).alias_binding = NULL;
(**va).next = NULL;
}
{
*coord = parse_integer (inst, Program);
- if ((*coord < 0) || (*coord >= ctx->Const.MaxClipPlanes)) {
+ if ((*coord < 0) || (*coord >= (GLint) ctx->Const.MaxClipPlanes)) {
_mesa_set_program_error (ctx, Program->Position,
"Invalid clip plane index");
_mesa_error (ctx, GL_INVALID_OPERATION, "Invalid clip plane index");
case MATRIX_TEXTURE:
*matrix = STATE_TEXTURE;
*matrix_idx = parse_integer (inst, Program);
- if (*matrix_idx >= ctx->Const.MaxTextureUnits) {
+ if (*matrix_idx >= (GLint) ctx->Const.MaxTextureUnits) {
_mesa_set_program_error (ctx, Program->Position,
"Invalid Texture Unit");
_mesa_error (ctx, GL_INVALID_OPERATION,
case MATRIX_PROGRAM:
*matrix = STATE_PROGRAM;
*matrix_idx = parse_integer (inst, Program);
- if (*matrix_idx >= ctx->Const.MaxProgramMatrices) {
+ if (*matrix_idx >= (GLint) ctx->Const.MaxProgramMatrices) {
_mesa_set_program_error (ctx, Program->Position,
"Invalid Program Matrix");
_mesa_error (ctx, GL_INVALID_OPERATION,
state_tokens[1] = parse_integer (inst, Program);
/* Check the value of state_tokens[1] against the # of lights */
- if (state_tokens[1] >= ctx->Const.MaxLights) {
+ if (state_tokens[1] >= (GLint) ctx->Const.MaxLights) {
_mesa_set_program_error (ctx, Program->Position,
"Invalid Light Number");
_mesa_error (ctx, GL_INVALID_OPERATION,
state_tokens[1] = parse_integer (inst, Program);
/* Check the value of state_tokens[1] against the # of lights */
- if (state_tokens[1] >= ctx->Const.MaxLights) {
+ if (state_tokens[1] >= (GLint) ctx->Const.MaxLights) {
_mesa_set_program_error (ctx, Program->Position,
"Invalid Light Number");
_mesa_error (ctx, GL_INVALID_OPERATION,
/* Check state_tokens[2] against the number of ENV parameters available */
if (((Program->type == GL_FRAGMENT_PROGRAM_ARB) &&
- (state_tokens[2] >= ctx->Const.MaxFragmentProgramEnvParams))
+ (state_tokens[2] >= (GLint) ctx->Const.MaxFragmentProgramEnvParams))
||
((Program->type == GL_VERTEX_PROGRAM_ARB) &&
- (state_tokens[2] >= ctx->Const.MaxVertexProgramEnvParams))) {
+ (state_tokens[2] >= (GLint) ctx->Const.MaxVertexProgramEnvParams))) {
_mesa_set_program_error (ctx, Program->Position,
"Invalid Program Env Parameter");
_mesa_error (ctx, GL_INVALID_OPERATION,
/* Check state_tokens[2] against the number of LOCAL parameters available */
if (((Program->type == GL_FRAGMENT_PROGRAM_ARB) &&
- (state_tokens[2] >= ctx->Const.MaxFragmentProgramLocalParams))
+ (state_tokens[2] >= (GLint) ctx->Const.MaxFragmentProgramLocalParams))
||
((Program->type == GL_VERTEX_PROGRAM_ARB) &&
- (state_tokens[2] >= ctx->Const.MaxVertexProgramLocalParams))) {
+ (state_tokens[2] >= (GLint) ctx->Const.MaxVertexProgramLocalParams))) {
_mesa_set_program_error (ctx, Program->Position,
"Invalid Program Local Parameter");
_mesa_error (ctx, GL_INVALID_OPERATION,
{
int a;
struct var_cache *curr;
- GLubyte explicit[MAX_VERTEX_PROGRAM_ATTRIBS],
- generic[MAX_VERTEX_PROGRAM_ATTRIBS];
-
+ GLboolean explicitAttrib[MAX_VERTEX_PROGRAM_ATTRIBS],
+ genericAttrib[MAX_VERTEX_PROGRAM_ATTRIBS];
+
for (a=0; a<MAX_VERTEX_PROGRAM_ATTRIBS; a++) {
- explicit[a] = 0;
- generic[a] = 0;
+ explicitAttrib[a] = GL_FALSE;
+ genericAttrib[a] = GL_FALSE;
}
curr = vc_head;
while (curr) {
if (curr->type == vt_attrib) {
if (curr->attrib_is_generic)
- generic[ curr->attrib_binding_idx ] = 1;
+ genericAttrib[ curr->attrib_binding_idx ] = GL_TRUE;
else
- explicit[ curr->attrib_binding_idx ] = 1;
+ explicitAttrib[ curr->attrib_binding_idx ] = GL_TRUE;
}
-
- curr = curr->next;
+
+ curr = curr->next;
}
-
+
for (a=0; a<MAX_VERTEX_PROGRAM_ATTRIBS; a++) {
- if ((explicit[a]) && (generic[a]))
- return 1;
+ if ((explicitAttrib[a]) && (genericAttrib[a]))
+ return 1;
}
return 0;
attrib_var = parse_string (inst, vc_head, Program, &found);
Program->Position = parse_position (inst);
if (found) {
- error_msg =
+ error_msg = (char *)
_mesa_malloc (_mesa_strlen ((char *) attrib_var->name) + 40);
_mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
attrib_var->name);
idx =
_mesa_add_state_reference (Program->Parameters,
state_tokens);
- if (param_var->param_binding_begin == -1)
+ if (param_var->param_binding_begin == ~0U)
param_var->param_binding_begin = idx;
param_var->param_binding_length++;
Program->Base.NumParameters++;
else {
idx =
_mesa_add_state_reference (Program->Parameters, state_tokens);
- if (param_var->param_binding_begin == -1)
+ if (param_var->param_binding_begin == ~0U)
param_var->param_binding_begin = idx;
param_var->param_binding_length++;
Program->Base.NumParameters++;
if (parse_program_single_item (ctx, inst, Program, state_tokens))
return 1;
idx = _mesa_add_state_reference (Program->Parameters, state_tokens);
- if (param_var->param_binding_begin == -1)
+ if (param_var->param_binding_begin == ~0U)
param_var->param_binding_begin = idx;
param_var->param_binding_length++;
Program->Base.NumParameters++;
idx =
_mesa_add_named_constant (Program->Parameters,
(char *) param_var->name, const_values);
- if (param_var->param_binding_begin == -1)
+ if (param_var->param_binding_begin == ~0U)
param_var->param_binding_begin = idx;
param_var->param_binding_length++;
Program->Base.NumParameters++;
Program->Position = parse_position (inst);
if (found) {
- error_msg = _mesa_malloc (_mesa_strlen ((char *) param_var->name) + 40);
+ error_msg = (char *) _mesa_malloc (_mesa_strlen ((char *) param_var->name) + 40);
_mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
param_var->name);
temp_var = parse_string (inst, vc_head, Program, &found);
Program->Position = parse_position (inst);
if (found) {
- error_msg =
+ error_msg = (char *)
_mesa_malloc (_mesa_strlen ((char *) temp_var->name) + 40);
_mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
temp_var->name);
Program->Position = parse_position (inst);
if (found) {
char *error_msg;
- error_msg =
+ error_msg = (char *)
_mesa_malloc (_mesa_strlen ((char *) output_var->name) + 40);
_mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
output_var->name);
Program->Position = parse_position (inst);
if (found) {
- error_msg =
+ error_msg = (char *)
_mesa_malloc (_mesa_strlen ((char *) temp_var->name) + 40);
_mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
temp_var->name);
if (!found)
{
- error_msg =
- _mesa_malloc (_mesa_strlen ((char *) temp_var->name) + 40);
- _mesa_sprintf (error_msg, "Alias value %s is not defined",
- temp_var->alias_binding->name);
-
- _mesa_set_program_error (ctx, Program->Position, error_msg);
- _mesa_error (ctx, GL_INVALID_OPERATION, error_msg);
-
- _mesa_free (error_msg);
- return 1;
+ error_msg = (char *)
+ _mesa_malloc (_mesa_strlen ((char *) temp_var->name) + 40);
+ _mesa_sprintf (error_msg, "Alias value %s is not defined",
+ temp_var->alias_binding->name);
+
+ _mesa_set_program_error (ctx, Program->Position, error_msg);
+ _mesa_error (ctx, GL_INVALID_OPERATION, error_msg);
+
+ _mesa_free (error_msg);
+ return 1;
}
return 0;
temp_var = parse_string (inst, vc_head, Program, &found);
Program->Position = parse_position (inst);
if (found) {
- error_msg =
+ error_msg = (char *)
_mesa_malloc (_mesa_strlen ((char *) temp_var->name) + 40);
_mesa_sprintf (error_msg, "Duplicate Varible Declaration: %s",
temp_var->name);
GLint a, b;
GLubyte swz[4]; /* FP's swizzle mask is a GLubyte, while VP's is GLuint */
GLuint texcoord;
- GLubyte class, type, code;
+ GLubyte instClass, type, code;
/* No condition codes in ARB_fp */
fp->UpdateCondRegister = 0;
fp->StringPos = Program->Position;
/* F_ALU_INST or F_TEX_INST */
- class = *(*inst)++;
+ instClass = *(*inst)++;
/* F_ALU_{VECTOR, SCALAR, BINSC, BIN, TRI, SWZ},
* F_TEX_{SAMPLE, KIL}
code = *(*inst)++;
/* Increment the correct count */
- switch (class) {
+ switch (instClass) {
case F_ALU_INST:
Program->NumAluInstructions++;
break;