This makes it easier to find switch-statements that need to be updated
after a new GLSL_TYPE_* is added because the compiler will generate a
warning.
Switch-statements that only had a small number of cases (e.g.,
everything in ir_constant_expression.cpp) were not modified. I may
regret that decision when we eventually add support for doubles.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* ignores the sampler present in the type.
*/
break;
-
- default:
- assert(!"Should not get here.");
- break;
}
if (cmp == NULL)
case GLSL_TYPE_ARRAY:
return this->length * this->fields.array->component_slots();
- default:
- return 0;
+ case GLSL_TYPE_SAMPLER:
+ case GLSL_TYPE_VOID:
+ case GLSL_TYPE_ERROR:
+ break;
}
+
+ return 0;
}
bool
return c;
}
- default:
+ case GLSL_TYPE_SAMPLER:
+ case GLSL_TYPE_VOID:
+ case GLSL_TYPE_ERROR:
assert(!"Should not get here.");
- return NULL;
+ break;
}
+
+ return NULL;
}
case GLSL_TYPE_BOOL:
storage[i].b = int(val->value.b[i]);
break;
- default:
+ case GLSL_TYPE_ARRAY:
+ case GLSL_TYPE_STRUCT:
+ case GLSL_TYPE_VOID:
+ case GLSL_TYPE_ERROR:
/* All other types should have already been filtered by other
* paths in the caller.
*/
* link time.
*/
return 0;
- default:
+ case GLSL_TYPE_VOID:
+ case GLSL_TYPE_ERROR:
assert(!"not reached");
- return 0;
+ break;
}
+
+ return 0;
}
fs_reg
case GLSL_TYPE_SAMPLER:
break;
- default:
+ case GLSL_TYPE_VOID:
+ case GLSL_TYPE_ERROR:
assert(!"not reached");
break;
}
* way to trip up if we don't.
*/
return BRW_REGISTER_TYPE_UD;
- default:
+ case GLSL_TYPE_VOID:
+ case GLSL_TYPE_ERROR:
assert(!"not reached");
- return BRW_REGISTER_TYPE_F;
+ break;
}
+
+ return BRW_REGISTER_TYPE_F;
}
uint32_t
* at link time.
*/
return 1;
- default:
+ case GLSL_TYPE_VOID:
+ case GLSL_TYPE_ERROR:
assert(0);
- return 0;
+ break;
}
+
+ return 0;
}
int
* at link time.
*/
return 1;
- default:
- assert(0);
- return 0;
+ case GLSL_TYPE_VOID:
+ case GLSL_TYPE_ERROR:
+ assert(!"Invalid type in type_size");
+ break;
}
+
+ return 0;
}
/**
format = uniform_native;
columns = 1;
break;
- default:
+ case GLSL_TYPE_ARRAY:
+ case GLSL_TYPE_VOID:
+ case GLSL_TYPE_STRUCT:
+ case GLSL_TYPE_ERROR:
assert(!"Should not get here.");
break;
}
* at link time.
*/
return 1;
- default:
- assert(0);
- return 0;
+ case GLSL_TYPE_VOID:
+ case GLSL_TYPE_ERROR:
+ assert(!"Invalid type in type_size");
+ break;
}
+ return 0;
}
/**