mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
handle param name changes between prototype and declaration gracefully
This is an imperfect revision of history.
This commit is contained in:
parent
9f52181e34
commit
b46cff08aa
2 changed files with 16 additions and 0 deletions
|
@ -74,6 +74,7 @@ method_t *new_method (struct type_s *ret_type, param_t *selector,
|
|||
method_t *copy_method (method_t *method);
|
||||
void add_method (methodlist_t *methodlist, method_t *method);
|
||||
struct def_s *method_def (struct class_type_s *class_type, method_t *method);
|
||||
void method_set_param_names (method_t *dst, method_t *src);
|
||||
|
||||
methodlist_t *new_methodlist (void);
|
||||
void copy_methods (methodlist_t *dst, methodlist_t *src);
|
||||
|
|
|
@ -174,6 +174,21 @@ method_def (class_type_t *class_type, method_t *method)
|
|||
return def;
|
||||
}
|
||||
|
||||
void
|
||||
method_set_param_names (method_t *dst, method_t *src)
|
||||
{
|
||||
param_t *dp, *sp;
|
||||
|
||||
for (dp = dst->params, sp = src->params; dp && sp;
|
||||
dp = dp->next, sp = sp->next) {
|
||||
dp->name = sp->name;
|
||||
}
|
||||
if (dp || sp) {
|
||||
error (0, "internal compiler error: missmatched method params");
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
methodlist_t *
|
||||
new_methodlist (void)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue