- /* anonymous types? */
- if(type1->symbol == NULL) {
- /* previous tests should already have checked for this */
- assert(type1 != type2);
- /* anonymous types are only equal if they are the very same type */
- return 0;
+static bool imaginary_types_equal(const imaginary_type_t *type1,
+ const imaginary_type_t *type2)
+{
+ return type1->akind == type2->akind;
+}
+
+static bool function_types_equal(const function_type_t *type1,
+ const function_type_t *type2)
+{
+ if (type1->return_type != type2->return_type)
+ return false;
+ if (type1->variadic != type2->variadic)
+ return false;
+ if (type1->unspecified_parameters != type2->unspecified_parameters)
+ return false;
+ if (type1->kr_style_parameters != type2->kr_style_parameters)
+ return false;
+ if (type1->linkage != type2->linkage)
+ return false;
+ if (type1->modifiers != type2->modifiers)
+ return false;
+ if (type1->calling_convention != type2->calling_convention)
+ return false;
+
+ function_parameter_t *param1 = type1->parameters;
+ function_parameter_t *param2 = type2->parameters;
+ while (param1 != NULL && param2 != NULL) {
+ if (param1->type != param2->type)
+ return false;
+ param1 = param1->next;
+ param2 = param2->next;