X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/ff9fae99fb73d2b2176f1f9a902535edc70de54a..308dc7bdfb924370cfd205f656eb0e83191d01a9:/src/checks.c diff --git a/src/checks.c b/src/checks.c index b30d0f8..ab6b8b3 100644 --- a/src/checks.c +++ b/src/checks.c @@ -1,7 +1,7 @@ /* GOB C Preprocessor * Copyright (C) 1999-2000 the Free Software Foundation. * Copyright (C) 2000 Eazel, Inc. - * Copyright (C) 2001 George Lebl + * Copyright (C) 2001-2004 George Lebl * * Author: George Lebl * @@ -334,6 +334,19 @@ check_signal_args (Class *c) continue; for (l = m->gtktypes; l != NULL; l = l->next) { + if (strcmp (l->data, "BOXED") == 0) { + error_printf (GOB_ERROR, m->line_no, + "BOXED not allowed as " + "a signal argument, use " + "POINTER"); + continue; + } else if (strcmp (l->data, "FLAGS") == 0) { + error_printf (GOB_ERROR, m->line_no, + "FLAGS not allowed as " + "a signal argument, use " + "UINT"); + continue; + } if (get_cast (l->data, FALSE)) continue; error_printf (GOB_ERROR, m->line_no, @@ -465,6 +478,26 @@ check_func_arg_checks(Class *c) } } +void +check_for_class_destructors (Class *c) +{ + GList *li; + for (li = c->nodes; li != NULL; li = li->next) { + Node *n = li->data; + if (n->type == VARIABLE_NODE) { + Variable *v = (Variable *)n; + if (v->destructor != NULL && + v->scope == CLASS_SCOPE) { + error_print (GOB_WARN, v->line_no, + "classwide members cannot have " + "destructors since the classes " + "are static and never get " + "destroyed anyway"); + } + } + } +} + int count_signals(Class *c) { @@ -601,7 +634,8 @@ count_unreftors (Class *c) if (n->type == VARIABLE_NODE) { Variable *v = (Variable *)n; if (v->destructor != NULL && - v->destructor_unref) + v->destructor_unref && + v->scope != CLASS_SCOPE) num++; } } @@ -618,7 +652,8 @@ count_destructors (Class *c) if (n->type == VARIABLE_NODE) { Variable *v = (Variable *)n; if (v->destructor != NULL && - ! v->destructor_unref) + ! v->destructor_unref && + v->scope != CLASS_SCOPE) num++; } }