const scope_t *scope, bool top)
{
intern_print_type_post(type->return_type, false);
- /* don't emit braces if we're the toplevel type... */
- if (!top)
- fputc(')', out);
fputc('(', out);
-
bool first = true;
if (scope == NULL) {
function_parameter_t *parameter = type->parameters;
fputs("void", out);
}
fputc(')', out);
+
+ /* don't emit braces if we're the toplevel type... */
+ if (!top)
+ fputc(')', out);
}
/**
switch(type->kind) {
case TYPE_ERROR:
fputs("<error>", out);
+ return;
case TYPE_INVALID:
fputs("<invalid>", out);
return;
return test_atomic_type_flag(type->atomic.akind, ATOMIC_TYPE_FLAG_INTEGER);
}
+/**
+ * Returns true if the given type is an enum type.
+ *
+ * @param type The type to check.
+ * @return True if type is an enum type.
+ */
+bool is_type_enum(const type_t *type)
+{
+ assert(!is_typeref(type));
+ return type->kind == TYPE_ENUM;
+}
+
/**
* Returns true if the given type is an floating point type.
*
}
}
+/**
+ * Returns true if the given type is an integer or float type.
+ *
+ * @param type The type to check.
+ * @return True if type is an integer or float type.
+ */
bool is_type_real(const type_t *type)
{
/* 6.2.5.17 */