From 4d69deb205581c2a443807507bd040cbec30485b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 16 Jul 2002 04:37:51 +0000 Subject: [PATCH] class.c: use the correct type when creating the class def struct.c: save the name --- tools/qfcc/source/class.c | 12 ++++++++---- tools/qfcc/source/struct.c | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/qfcc/source/class.c b/tools/qfcc/source/class.c index 8a8a9e616..35a5167dd 100644 --- a/tools/qfcc/source/class.c +++ b/tools/qfcc/source/class.c @@ -90,16 +90,20 @@ def_t * class_def (class_t *class, int external) { const char *name; + type_t *type; storage_class_t storage = external ? st_extern : st_global; if (!class->class_name) return 0; - if (class->category_name) + if (class->category_name) { name = va ("_OBJ_CATEGORY_%s_%s", class->class_name, class->category_name); - else + type = type_category; + } else { name = va ("_OBJ_CLASS_%s", class->class_name); - return get_def (type_category, name, pr.scope, storage); + type = type_Class.aux_type; + } + return get_def (type, name, pr.scope, storage); } class_t * @@ -209,7 +213,7 @@ class_begin (class_t *class) if (class->super_class) EMIT_STRING (cls->super_class, class->super_class->class_name); EMIT_STRING (cls->name, class->class_name); - meta->info = _PR_CLS_CLASS; + cls->info = _PR_CLS_CLASS; cls->protocols = meta->protocols; } } diff --git a/tools/qfcc/source/struct.c b/tools/qfcc/source/struct.c index cf01ad5aa..e73a4a7e0 100644 --- a/tools/qfcc/source/struct.c +++ b/tools/qfcc/source/struct.c @@ -140,7 +140,7 @@ new_struct (const char *name) } } strct = malloc (sizeof (struct_t)); - strct->name = name; + strct->name = name ? save_string (name) : 0; strct->type = new_type (); strct->type->type = ev_struct; strct->type->struct_tail = &strct->type->struct_head;