mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-11 22:47:30 +00:00
make implementation methods not in the interface work properly when
-Winterface-check isn't specified and make sure classes don't clash with defs or enums
This commit is contained in:
parent
0f94dd95d2
commit
1068032f1b
1 changed files with 11 additions and 5 deletions
|
@ -114,6 +114,12 @@ get_class (const char *name, int create)
|
||||||
if (!class_hash)
|
if (!class_hash)
|
||||||
class_hash = Hash_NewTable (1021, class_get_key, 0, 0);
|
class_hash = Hash_NewTable (1021, class_get_key, 0, 0);
|
||||||
if (name) {
|
if (name) {
|
||||||
|
if (get_def (0, name, current_scope, st_none)
|
||||||
|
|| get_enum (name)) {
|
||||||
|
if (create)
|
||||||
|
error (0, "redefinition of %s", name);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
c = Hash_Find (class_hash, name);
|
c = Hash_Find (class_hash, name);
|
||||||
if (c || !create)
|
if (c || !create)
|
||||||
return c;
|
return c;
|
||||||
|
@ -434,12 +440,12 @@ class_find_method (class_type_t *class_type, method_t *method)
|
||||||
method->instance ? '-' : '+',
|
method->instance ? '-' : '+',
|
||||||
sel->str, class_name,
|
sel->str, class_name,
|
||||||
category_name ? va (" (%s)", category_name) : "");
|
category_name ? va (" (%s)", category_name) : "");
|
||||||
|
}
|
||||||
add_method (start_methods, method);
|
add_method (start_methods, method);
|
||||||
if (method->instance)
|
if (method->instance)
|
||||||
method->params->type = start_class->type;
|
method->params->type = start_class->type;
|
||||||
else
|
else
|
||||||
method->params->type = &type_Class;
|
method->params->type = &type_Class;
|
||||||
}
|
|
||||||
dstring_delete (sel);
|
dstring_delete (sel);
|
||||||
return method;
|
return method;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue