From 2f4094344b6ed539dc23c7903f75051e5fe55295 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 13 Aug 2002 21:18:17 +0000 Subject: [PATCH] don't change the hidden parm type for protocol methods until they're used in a class --- tools/qfcc/source/class.c | 6 ++++++ tools/qfcc/source/qc-parse.y | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/class.c b/tools/qfcc/source/class.c index 02bb3475f..e131cbff3 100644 --- a/tools/qfcc/source/class.c +++ b/tools/qfcc/source/class.c @@ -154,11 +154,17 @@ class_add_protocol_methods (class_t *class, expr_t *protocols) class->methods = new_methodlist (); for (e = protocols; e; e = e->next) { + method_t **m = class->methods->tail; if (!(p = get_protocol (e->e.string_val, 0))) { error (e, "undefined protocol `%s'", e->e.string_val); continue; } copy_methods (class->methods, p->methods); + while (*m) { + (*m)->params->type = class->type; + printf("%s\n", (*m)->name); + m = &(*m)->next; + } } } diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index 0fcd9e9fc..7365fed5b 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -1170,7 +1170,8 @@ methodproto | '-' methoddecl ';' { $2->instance = 1; - $2->params->type = current_class->type; + if (current_class) + $2->params->type = current_class->type; $$ = $2; } ;