* Returns GL_FALSE otherwise.
*/
static GLboolean
-_slang_typeof_operation(const struct slang_assemble_ctx_ * A,
+typeof_operation(const struct slang_assemble_ctx_ * A,
slang_operation * op,
slang_typeinfo * ti)
{
- return _slang_typeof_operation_(op, &A->space, ti, A->atoms, A->log);
+ return _slang_typeof_operation(op, &A->space, ti, A->atoms, A->log);
}
slang_typeinfo t0;
slang_typeinfo_construct(&t0);
- _slang_typeof_operation(A, dest, &t0);
+ typeof_operation(A, dest, &t0);
if (!slang_type_specifier_equal(&t0.spec, &fun->header.type.specifier)) {
slang_info_log_error(A->log,
GLint size;
slang_typeinfo_construct(&type);
- _slang_typeof_operation(A, oper, &type);
+ typeof_operation(A, oper, &type);
size = _slang_sizeof_type_specifier(&type.spec);
slang_typeinfo_destruct(&type);
return size == 1;
GLboolean isBool;
slang_typeinfo_construct(&type);
- _slang_typeof_operation(A, oper, &type);
+ typeof_operation(A, oper, &type);
isBool = (type.spec.type == SLANG_SPEC_BOOL);
slang_typeinfo_destruct(&type);
return isBool;
/* type of children[0] must be boolean */
slang_typeinfo_construct(&type0);
- _slang_typeof_operation(A, &oper->children[0], &type0);
+ typeof_operation(A, &oper->children[0], &type0);
isBool = (type0.spec.type == SLANG_SPEC_BOOL);
slang_typeinfo_destruct(&type0);
if (!isBool) {
slang_typeinfo_construct(&type1);
slang_typeinfo_construct(&type2);
- _slang_typeof_operation(A, &oper->children[1], &type1);
- _slang_typeof_operation(A, &oper->children[2], &type2);
+ typeof_operation(A, &oper->children[1], &type1);
+ typeof_operation(A, &oper->children[2], &type2);
isEqual = slang_type_specifier_equal(&type1.spec, &type2.spec);
slang_typeinfo_destruct(&type1);
slang_typeinfo_destruct(&type2);
}
slang_typeinfo_construct(&t0);
- _slang_typeof_operation(A, op0, &t0);
+ typeof_operation(A, op0, &t0);
slang_typeinfo_construct(&t1);
- _slang_typeof_operation(A, op1, &t1);
+ typeof_operation(A, op1, &t1);
sz0 = _slang_sizeof_type_specifier(&t0.spec);
sz1 = _slang_sizeof_type_specifier(&t1.spec);
/* type of struct */
slang_typeinfo_construct(&ti);
- _slang_typeof_operation(A, &oper->children[0], &ti);
+ typeof_operation(A, &oper->children[0], &ti);
if (_slang_type_is_vector(ti.spec.type)) {
/* the field should be a swizzle */
/* type of field */
slang_typeinfo_construct(&field_ti);
- _slang_typeof_operation(A, oper, &field_ti);
+ typeof_operation(A, oper, &field_ti);
fieldSize = _slang_sizeof_type_specifier(&field_ti.spec);
if (fieldSize > 0)
/* get array's type info */
slang_typeinfo_construct(&array_ti);
- _slang_typeof_operation(A, &oper->children[0], &array_ti);
+ typeof_operation(A, &oper->children[0], &array_ti);
if (_slang_type_is_vector(array_ti.spec.type)) {
/* indexing a simple vector type: "vec4 v; v[0]=p;" */
/* size of array element */
slang_typeinfo_construct(&elem_ti);
- _slang_typeof_operation(A, oper, &elem_ti);
+ typeof_operation(A, oper, &elem_ti);
elemSize = _slang_sizeof_type_specifier(&elem_ti.spec);
if (_slang_type_is_matrix(array_ti.spec.type))
slang_ir_node *n;
slang_typeinfo_construct(&t0);
- _slang_typeof_operation(A, &oper->children[0], &t0);
+ typeof_operation(A, &oper->children[0], &t0);
slang_typeinfo_construct(&t1);
- _slang_typeof_operation(A, &oper->children[0], &t1);
+ typeof_operation(A, &oper->children[0], &t1);
if (t0.spec.type == SLANG_SPEC_ARRAY ||
t1.spec.type == SLANG_SPEC_ARRAY) {
* \return GL_TRUE for success, GL_FALSE if failure
*/
GLboolean
-_slang_typeof_operation_(slang_operation * op,
+_slang_typeof_operation(slang_operation * op,
const slang_name_space * space,
slang_typeinfo * ti,
slang_atom_pool * atoms,
case SLANG_OPER_DIVASSIGN:
case SLANG_OPER_PREINCREMENT:
case SLANG_OPER_PREDECREMENT:
- if (!_slang_typeof_operation_(op->children, space, ti, atoms, log))
+ if (!_slang_typeof_operation(op->children, space, ti, atoms, log))
return GL_FALSE;
break;
case SLANG_OPER_LITERAL_BOOL:
break;
case SLANG_OPER_SEQUENCE:
/* TODO: check [0] and [1] if they match */
- if (!_slang_typeof_operation_(&op->children[1], space, ti, atoms, log)) {
+ if (!_slang_typeof_operation(&op->children[1], space, ti, atoms, log)) {
return GL_FALSE;
}
ti->can_be_referenced = GL_FALSE;
/*case SLANG_OPER_ANDASSIGN: */
case SLANG_OPER_SELECT:
/* TODO: check [1] and [2] if they match */
- if (!_slang_typeof_operation_(&op->children[1], space, ti, atoms, log)) {
+ if (!_slang_typeof_operation(&op->children[1], space, ti, atoms, log)) {
return GL_FALSE;
}
ti->can_be_referenced = GL_FALSE;
break;
/*case SLANG_OPER_MODULUS: */
case SLANG_OPER_PLUS:
- if (!_slang_typeof_operation_(op->children, space, ti, atoms, log))
+ if (!_slang_typeof_operation(op->children, space, ti, atoms, log))
return GL_FALSE;
ti->can_be_referenced = GL_FALSE;
ti->is_swizzled = GL_FALSE;
if (!slang_typeinfo_construct(&_ti))
return GL_FALSE;
- if (!_slang_typeof_operation_(op->children, space, &_ti, atoms, log)) {
+ if (!_slang_typeof_operation(op->children, space, &_ti, atoms, log)) {
slang_typeinfo_destruct(&_ti);
return GL_FALSE;
}
if (!slang_typeinfo_construct(&_ti))
return GL_FALSE;
- if (!_slang_typeof_operation_(op->children, space, &_ti, atoms, log)) {
+ if (!_slang_typeof_operation(op->children, space, &_ti, atoms, log)) {
slang_typeinfo_destruct(&_ti);
return GL_FALSE;
}
break;
case SLANG_OPER_POSTINCREMENT:
case SLANG_OPER_POSTDECREMENT:
- if (!_slang_typeof_operation_(op->children, space, ti, atoms, log))
+ if (!_slang_typeof_operation(op->children, space, ti, atoms, log))
return GL_FALSE;
ti->can_be_referenced = GL_FALSE;
ti->is_swizzled = GL_FALSE;