/* _slang_compile() */
+
+/* Debugging aid, print file/line where parsing error is detected */
+#define RETURN0 \
+ do { \
+ if (0) \
+ printf("slang error at %s:%d\n", __FILE__, __LINE__); \
+ return 0; \
+ } while (0)
+
+
static void
parse_identifier_str(slang_parse_ctx * C, char **id)
{
_mesa_strlen(exponent) + 3) * sizeof(char));
if (whole == NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
slang_string_copy(whole, integral);
{
if (*C->I != REVISION) {
slang_info_log_error(C->L, "Internal compiler error.");
- return 0;
+ RETURN0;
}
C->I++;
return 1;
o.structs = st->structs;
if (!parse_type_specifier(C, &o, sp))
- return 0;
+ RETURN0;
do {
slang_atom a_name;
slang_variable *var = slang_variable_scope_grow(st->fields);
if (!var) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
a_name = parse_identifier(C);
if (_slang_locate_variable(st->fields, a_name, GL_FALSE)) {
slang_info_log_error(C->L, "duplicate field '%s'", (char *) a_name);
- return 0;
+ RETURN0;
}
if (!parse_struct_field_var(C, &o, var, a_name, sp))
- return 0;
+ RETURN0;
}
while (*C->I++ != FIELD_NONE);
/* parse struct name (if any) and make sure it is unique in current scope */
a_name = parse_identifier(C);
if (a_name == SLANG_ATOM_NULL)
- return 0;
+ RETURN0;
name = slang_atom_pool_id(C->atoms, a_name);
if (name[0] != '\0'
&& slang_struct_scope_find(O->structs, a_name, 0) != NULL) {
slang_info_log_error(C->L, "%s: duplicate type name.", name);
- return 0;
+ RETURN0;
}
/* set-up a new struct */
*st = (slang_struct *) _slang_alloc(sizeof(slang_struct));
if (*st == NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
if (!slang_struct_construct(*st)) {
_slang_free(*st);
*st = NULL;
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
(**st).a_name = a_name;
(**st).structs->outer_scope = O->structs;
slang_type_specifier_ctr(&sp);
if (!parse_struct_field(C, O, *st, &sp)) {
slang_type_specifier_dtr(&sp);
- return 0;
+ RETURN0;
}
slang_type_specifier_dtr(&sp);
}
* sizeof(slang_struct));
if (O->structs->structs == NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
s = &O->structs->structs[O->structs->num_structs];
if (!slang_struct_construct(s))
- return 0;
+ RETURN0;
O->structs->num_structs++;
if (!slang_struct_copy(s, *st))
- return 0;
+ RETURN0;
}
return 1;
*variant = SLANG_INVARIANT;
return 1;
default:
- return 0;
+ RETURN0;
}
}
*centroid = SLANG_CENTROID;
return 1;
default:
- return 0;
+ RETURN0;
}
}
*qual = SLANG_QUAL_FIXEDINPUT;
break;
default:
- return 0;
+ RETURN0;
}
return 1;
}
case TYPE_SPECIFIER_STRUCT:
spec->type = SLANG_SPEC_STRUCT;
if (!parse_struct(C, O, &spec->_struct))
- return 0;
+ RETURN0;
break;
case TYPE_SPECIFIER_TYPENAME:
spec->type = SLANG_SPEC_STRUCT;
a_name = parse_identifier(C);
if (a_name == NULL)
- return 0;
+ RETURN0;
stru = slang_struct_scope_find(O->structs, a_name, 1);
if (stru == NULL) {
slang_info_log_error(C->L, "undeclared type name '%s'",
slang_atom_pool_id(C->atoms, a_name));
- return 0;
+ RETURN0;
}
spec->_struct = (slang_struct *) _slang_alloc(sizeof(slang_struct));
if (spec->_struct == NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
if (!slang_struct_construct(spec->_struct)) {
_slang_free(spec->_struct);
spec->_struct = NULL;
- return 0;
+ RETURN0;
}
if (!slang_struct_copy(spec->_struct, stru))
- return 0;
+ RETURN0;
}
break;
default:
- return 0;
+ RETURN0;
}
return 1;
}
*precision = SLANG_PREC_HIGH;
return 1;
default:
- return 0;
+ RETURN0;
}
}
slang_fully_specified_type * type)
{
if (!parse_type_variant(C, &type->variant))
- return 0;
+ RETURN0;
if (!parse_type_centroid(C, &type->centroid))
- return 0;
+ RETURN0;
if (!parse_type_qualifier(C, &type->qualifier))
- return 0;
+ RETURN0;
if (!parse_type_precision(C, &type->precision))
- return 0;
+ RETURN0;
if (!parse_type_specifier(C, O, &type->specifier))
- return 0;
+ RETURN0;
if (!O->allow_invariant && type->variant == SLANG_INVARIANT) {
slang_info_log_error(C->L,
"'invariant' keyword not allowed (perhaps set #version 120)");
- return 0;
+ RETURN0;
}
if (!O->allow_centroid && type->centroid == SLANG_CENTROID) {
slang_info_log_error(C->L,
"'centroid' keyword not allowed (perhaps set #version 120)");
- return 0;
+ RETURN0;
}
else if (type->centroid == SLANG_CENTROID &&
type->qualifier != SLANG_QUAL_VARYING) {
slang_info_log_error(C->L,
"'centroid' keyword only allowed for varying vars");
- return 0;
+ RETURN0;
}
type->variant == SLANG_INVARIANT) {
slang_info_log_error(C->L,
"invariant qualifer only allowed for varying vars");
- return 0;
+ RETURN0;
}
*/
/* only default is allowed */
if (type->precision != SLANG_PREC_DEFAULT) {
slang_info_log_error(C->L, "precision qualifiers not allowed");
- return 0;
+ RETURN0;
}
}
oper->type = SLANG_OPER_BLOCK_NO_NEW_SCOPE;
while (*C->I != OP_END)
if (!parse_child_operation(C, O, oper, 1))
- return 0;
+ RETURN0;
C->I++;
break;
case OP_BLOCK_BEGIN_NEW_SCOPE:
o.vars = oper->locals;
while (*C->I != OP_END)
if (!parse_child_operation(C, &o, oper, 1))
- return 0;
+ RETURN0;
C->I++;
}
break;
* than one declarators
*/
if (!parse_declaration(C, O))
- return 0;
+ RETURN0;
if (first_var < O->vars->num_variables) {
const unsigned int num_vars = O->vars->num_variables - first_var;
unsigned int i;
oper->children = slang_operation_new(num_vars);
if (oper->children == NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
for (i = first_var; i < O->vars->num_variables; i++) {
slang_operation *o = &oper->children[i - first_var];
if (!legal_identifier(o->a_id)) {
slang_info_log_error(C->L, "illegal variable name '%s'",
(char *) o->a_id);
- return 0;
+ RETURN0;
}
}
}
oper->type = SLANG_OPER_ASM;
oper->a_id = parse_identifier(C);
if (oper->a_id == SLANG_ATOM_NULL)
- return 0;
+ RETURN0;
while (*C->I != OP_END) {
if (!parse_child_operation(C, O, oper, 0))
- return 0;
+ RETURN0;
}
C->I++;
break;
case OP_RETURN:
oper->type = SLANG_OPER_RETURN;
if (!parse_child_operation(C, O, oper, 0))
- return 0;
+ RETURN0;
break;
case OP_EXPRESSION:
oper->type = SLANG_OPER_EXPRESSION;
if (!parse_child_operation(C, O, oper, 0))
- return 0;
+ RETURN0;
break;
case OP_IF:
oper->type = SLANG_OPER_IF;
if (!parse_child_operation(C, O, oper, 0))
- return 0;
+ RETURN0;
if (!parse_child_operation(C, O, oper, 1))
- return 0;
+ RETURN0;
if (!parse_child_operation(C, O, oper, 1))
- return 0;
+ RETURN0;
break;
case OP_WHILE:
{
oper->type = SLANG_OPER_WHILE;
o.vars = oper->locals;
if (!parse_child_operation(C, &o, oper, 1))
- return 0;
+ RETURN0;
if (!parse_child_operation(C, &o, oper, 1))
- return 0;
+ RETURN0;
}
break;
case OP_DO:
oper->type = SLANG_OPER_DO;
if (!parse_child_operation(C, O, oper, 1))
- return 0;
+ RETURN0;
if (!parse_child_operation(C, O, oper, 0))
- return 0;
+ RETURN0;
break;
case OP_FOR:
{
oper->type = SLANG_OPER_FOR;
o.vars = oper->locals;
if (!parse_child_operation(C, &o, oper, 1))
- return 0;
+ RETURN0;
if (!parse_child_operation(C, &o, oper, 1))
- return 0;
+ RETURN0;
if (!parse_child_operation(C, &o, oper, 0))
- return 0;
+ RETURN0;
if (!parse_child_operation(C, &o, oper, 1))
- return 0;
+ RETURN0;
}
break;
case OP_PRECISION:
}
break;
default:
- return 0;
+ RETURN0;
}
return 1;
}
op->children = slang_operation_new(n);
if (op->children == NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
op->num_children = n;
*total_ops * sizeof(slang_operation));
if (*ops == NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
return 1;
}
(num_ops + 1) * sizeof(slang_operation));
if (ops == NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
op = &ops[num_ops];
if (!slang_operation_construct(op)) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
num_ops++;
op->locals->outer_scope = O->vars;
case OP_PUSH_BOOL:
op->type = SLANG_OPER_LITERAL_BOOL;
if (!parse_number(C, &number))
- return 0;
+ RETURN0;
op->literal[0] =
op->literal[1] =
op->literal[2] =
case OP_PUSH_INT:
op->type = SLANG_OPER_LITERAL_INT;
if (!parse_number(C, &number))
- return 0;
+ RETURN0;
op->literal[0] =
op->literal[1] =
op->literal[2] =
case OP_PUSH_FLOAT:
op->type = SLANG_OPER_LITERAL_FLOAT;
if (!parse_float(C, &op->literal[0]))
- return 0;
+ RETURN0;
op->literal[1] =
op->literal[2] =
op->literal[3] = op->literal[0];
op->type = SLANG_OPER_IDENTIFIER;
op->a_id = parse_identifier(C);
if (op->a_id == SLANG_ATOM_NULL)
- return 0;
+ RETURN0;
break;
case OP_SEQUENCE:
op->type = SLANG_OPER_SEQUENCE;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_ASSIGN:
op->type = SLANG_OPER_ASSIGN;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_ADDASSIGN:
op->type = SLANG_OPER_ADDASSIGN;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_SUBASSIGN:
op->type = SLANG_OPER_SUBASSIGN;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_MULASSIGN:
op->type = SLANG_OPER_MULASSIGN;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_DIVASSIGN:
op->type = SLANG_OPER_DIVASSIGN;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
/*case OP_MODASSIGN: */
/*case OP_LSHASSIGN: */
case OP_SELECT:
op->type = SLANG_OPER_SELECT;
if (!handle_nary_expression(C, op, &ops, &num_ops, 3))
- return 0;
+ RETURN0;
break;
case OP_LOGICALOR:
op->type = SLANG_OPER_LOGICALOR;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_LOGICALXOR:
op->type = SLANG_OPER_LOGICALXOR;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_LOGICALAND:
op->type = SLANG_OPER_LOGICALAND;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
/*case OP_BITOR: */
/*case OP_BITXOR: */
case OP_EQUAL:
op->type = SLANG_OPER_EQUAL;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_NOTEQUAL:
op->type = SLANG_OPER_NOTEQUAL;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_LESS:
op->type = SLANG_OPER_LESS;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_GREATER:
op->type = SLANG_OPER_GREATER;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_LESSEQUAL:
op->type = SLANG_OPER_LESSEQUAL;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_GREATEREQUAL:
op->type = SLANG_OPER_GREATEREQUAL;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
/*case OP_LSHIFT: */
/*case OP_RSHIFT: */
case OP_ADD:
op->type = SLANG_OPER_ADD;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_SUBTRACT:
op->type = SLANG_OPER_SUBTRACT;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_MULTIPLY:
op->type = SLANG_OPER_MULTIPLY;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_DIVIDE:
op->type = SLANG_OPER_DIVIDE;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
/*case OP_MODULUS: */
case OP_PREINCREMENT:
op->type = SLANG_OPER_PREINCREMENT;
if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
- return 0;
+ RETURN0;
break;
case OP_PREDECREMENT:
op->type = SLANG_OPER_PREDECREMENT;
if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
- return 0;
+ RETURN0;
break;
case OP_PLUS:
op->type = SLANG_OPER_PLUS;
if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
- return 0;
+ RETURN0;
break;
case OP_MINUS:
op->type = SLANG_OPER_MINUS;
if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
- return 0;
+ RETURN0;
break;
case OP_NOT:
op->type = SLANG_OPER_NOT;
if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
- return 0;
+ RETURN0;
break;
/*case OP_COMPLEMENT: */
case OP_SUBSCRIPT:
op->type = SLANG_OPER_SUBSCRIPT;
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
- return 0;
+ RETURN0;
break;
case OP_CALL:
op->type = SLANG_OPER_CALL;
op->a_id = parse_identifier(C);
if (op->a_id == SLANG_ATOM_NULL)
- return 0;
+ RETURN0;
while (*C->I != OP_END)
if (!parse_child_operation(C, O, op, 0))
- return 0;
+ RETURN0;
C->I++;
if (!C->parsing_builtin
id = slang_atom_pool_id(C->atoms, op->a_id);
if (!is_constructor_name(id, op->a_id, O->structs)) {
slang_info_log_error(C->L, "%s: undeclared function name.", id);
- return 0;
+ RETURN0;
}
}
break;
op->type = SLANG_OPER_FIELD;
op->a_id = parse_identifier(C);
if (op->a_id == SLANG_ATOM_NULL)
- return 0;
+ RETURN0;
if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
- return 0;
+ RETURN0;
break;
case OP_POSTINCREMENT:
op->type = SLANG_OPER_POSTINCREMENT;
if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
- return 0;
+ RETURN0;
break;
case OP_POSTDECREMENT:
op->type = SLANG_OPER_POSTDECREMENT;
if (!handle_nary_expression(C, op, &ops, &num_ops, 1))
- return 0;
+ RETURN0;
break;
default:
- return 0;
+ RETURN0;
}
}
C->I++;
* two at most) because not all combinations are valid
*/
if (!parse_type_qualifier(C, ¶m->type.qualifier))
- return 0;
+ RETURN0;
param_qual = *C->I++;
switch (param_qual) {
if (param->type.qualifier != SLANG_QUAL_CONST
&& param->type.qualifier != SLANG_QUAL_NONE) {
slang_info_log_error(C->L, "Invalid type qualifier.");
- return 0;
+ RETURN0;
}
break;
case PARAM_QUALIFIER_OUT:
param->type.qualifier = SLANG_QUAL_OUT;
else {
slang_info_log_error(C->L, "Invalid type qualifier.");
- return 0;
+ RETURN0;
}
break;
case PARAM_QUALIFIER_INOUT:
param->type.qualifier = SLANG_QUAL_INOUT;
else {
slang_info_log_error(C->L, "Invalid type qualifier.");
- return 0;
+ RETURN0;
}
break;
default:
- return 0;
+ RETURN0;
}
/* parse precision qualifier (lowp, mediump, highp */
/* parse parameter's type specifier and name */
if (!parse_type_specifier(C, O, ¶m->type.specifier))
- return 0;
+ RETURN0;
param->a_name = parse_identifier(C);
if (param->a_name == SLANG_ATOM_NULL)
- return 0;
+ RETURN0;
/* if the parameter is an array, parse its size (the size must be
* explicitly defined
slang_atom_pool_atom(C->atoms, operator_names[i].o_name);
if (atom == SLANG_ATOM_NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
C->I++;
return atom;
}
}
- return 0;
+ RETURN0;
}
GLuint functype;
/* parse function type and name */
if (!parse_fully_specified_type(C, O, &func->header.type))
- return 0;
+ RETURN0;
functype = *C->I++;
switch (functype) {
func->kind = SLANG_FUNC_ORDINARY;
func->header.a_name = parse_identifier(C);
if (func->header.a_name == SLANG_ATOM_NULL)
- return 0;
+ RETURN0;
break;
case FUNCTION_CONSTRUCTOR:
func->kind = SLANG_FUNC_CONSTRUCTOR;
if (func->header.type.specifier.type == SLANG_SPEC_STRUCT)
- return 0;
+ RETURN0;
func->header.a_name =
slang_atom_pool_atom(C->atoms,
slang_type_specifier_type_to_string
(func->header.type.specifier.type));
if (func->header.a_name == SLANG_ATOM_NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
break;
case FUNCTION_OPERATOR:
func->kind = SLANG_FUNC_OPERATOR;
func->header.a_name = parse_operator_name(C);
if (func->header.a_name == SLANG_ATOM_NULL)
- return 0;
+ RETURN0;
break;
default:
- return 0;
+ RETURN0;
}
if (!legal_identifier(func->header.a_name)) {
slang_info_log_error(C->L, "illegal function name '%s'",
(char *) func->header.a_name);
- return 0;
+ RETURN0;
}
/* parse function parameters */
slang_variable *p = slang_variable_scope_grow(func->parameters);
if (!p) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
if (!parse_parameter_declaration(C, O, p))
- return 0;
+ RETURN0;
}
/* if the function returns a value, append a hidden __retVal 'out'
slang_output_ctx o = *O;
if (!parse_function_prototype(C, O, func))
- return 0;
+ RETURN0;
/* create function's body operation */
func->body = (slang_operation *) _slang_alloc(sizeof(slang_operation));
if (func->body == NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
if (!slang_operation_construct(func->body)) {
_slang_free(func->body);
func->body = NULL;
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
/* to parse the body the parse context is modified in order to
C->global_scope = GL_FALSE;
o.vars = func->parameters;
if (!parse_statement(C, &o, func->body))
- return 0;
+ RETURN0;
C->global_scope = GL_TRUE;
return 1;
slang_info_log_error(C->L,
"declaration of '%s' conflicts with previous declaration",
(char *) a_name);
- return 0;
+ RETURN0;
}
/* make room for the new variable and initialize it */
var = slang_variable_scope_grow(O->vars);
if (!var) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
/* copy the declarator qualifier type, parse the identifier */
var->type.qualifier = type->qualifier;
var->a_name = a_name;
if (var->a_name == SLANG_ATOM_NULL)
- return 0;
+ RETURN0;
switch (*C->I++) {
case VARIABLE_NONE:
/* simple variable declarator - just copy the specifier */
if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier))
- return 0;
+ RETURN0;
break;
case VARIABLE_INITIALIZER:
/* initialized variable - copy the specifier and parse the expression */
if (!slang_type_specifier_copy(&var->type.specifier, &type->specifier))
- return 0;
+ RETURN0;
var->initializer =
(slang_operation *) _slang_alloc(sizeof(slang_operation));
if (var->initializer == NULL) {
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
if (!slang_operation_construct(var->initializer)) {
_slang_free(var->initializer);
var->initializer = NULL;
slang_info_log_memory(C->L);
- return 0;
+ RETURN0;
}
if (!parse_expression(C, O, var->initializer))
- return 0;
+ RETURN0;
break;
case VARIABLE_ARRAY_UNKNOWN:
/* unsized array - mark it as array and copy the specifier to
return GL_FALSE;
break;
default:
- return 0;
+ RETURN0;
}
/* allocate global address space for a variable with a known size */
A.log = C->L;
A.curFuncEndLabel = NULL;
if (!_slang_codegen_global_variable(&A, var, C->type))
- return 0;
+ RETURN0;
}
/* initialize global variable */
A.space.structs = O->structs;
A.space.vars = O->vars;
if (!initialize_global(&A, var))
- return 0;
+ RETURN0;
}
}
return 1;
/* parse the fully specified type, common to all declarators */
if (!slang_fully_specified_type_construct(&type))
- return 0;
+ RETURN0;
if (!parse_fully_specified_type(C, O, &type)) {
slang_fully_specified_type_destruct(&type);
- return 0;
+ RETURN0;
}
/* parse declarators, pass-in the parsed type */
do {
if (!parse_init_declarator(C, O, &type)) {
slang_fully_specified_type_destruct(&type);
- return 0;
+ RETURN0;
}
}
while (*C->I++ == DECLARATOR_NEXT);
switch (*C->I++) {
case DECLARATION_INIT_DECLARATOR_LIST:
if (!parse_init_declarator_list(C, O))
- return 0;
+ RETURN0;
break;
case DECLARATION_FUNCTION_PROTOTYPE:
{
slang_function *dummy_func;
if (!parse_function(C, O, 0, &dummy_func))
- return 0;
+ RETURN0;
}
break;
default:
- return 0;
+ RETURN0;
}
return 1;
}
if (!O->allow_precision) {
slang_info_log_error(C->L, "syntax error at \"precision\"");
- return 0;
+ RETURN0;
}
precision = *C->I++;
default:
_mesa_problem(NULL, "unexpected precision %d at %s:%d\n",
precision, __FILE__, __LINE__);
- return 0;
+ RETURN0;
}
type = *C->I++;
default:
_mesa_problem(NULL, "unexpected type %d at %s:%d\n",
type, __FILE__, __LINE__);
- return 0;
+ RETURN0;
}
assert(type < TYPE_SPECIFIER_COUNT);
}
else {
slang_info_log_error(C->L, "syntax error at \"invariant\"");
- return 0;
+ RETURN0;
}
}