X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/a8ea1a669f332b0ed29c6271896476f59f357533..HEAD:/src/checks.c diff --git a/src/checks.c b/src/checks.c index 63f44cc..bd6c8e7 100644 --- a/src/checks.c +++ b/src/checks.c @@ -21,7 +21,7 @@ * USA. */ -#include "config.h" +#include #include #include #include @@ -195,10 +195,12 @@ check_duplicate_named (Class *c, Node *node, const char *id, int line_no) } else { continue; } - if (n == node || - line_no >= nline_no || - g_strcasecmp (nid, id) != 0) + + if (n == node || line_no >= nline_no + || gob_strcasecmp (nid, id) != 0) + { continue; + } error_printf (GOB_ERROR, nline_no, "named symbol (argument or signal) '%s' " "redefined, first defined on line %d " @@ -335,11 +337,11 @@ check_signal_args (Class *c) 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 " + error_printf (GOB_ERROR, m->line_no, + "BOXED not allowed as " "a signal argument, use " - "POINTER"); - continue; + "POINTER, or BOXED_*"); + continue; } else if (strcmp (l->data, "FLAGS") == 0) { error_printf (GOB_ERROR, m->line_no, "FLAGS not allowed as " @@ -478,6 +480,30 @@ check_func_arg_checks(Class *c) } } +void +check_func_attrs(Class *c) +{ + GList *li; + for (li = c->nodes; li != NULL; li = li->next) { + Node *n = li->data; + if (n->type == METHOD_NODE) { + Method *m = (Method *)n; + if ((m->method == INIT_METHOD || + m->method == CLASS_INIT_METHOD) + && (m->funcattrs != NULL && strlen(m->funcattrs) != 0)) { + /* This is actually dead code at the moment, since the parser + doesn't accept attributes to the init or class_init + syntactic forms anyway. But it could easily be made to do + so, and also for virtual override and signal methods, and + then we could give kinder error messages here. */ + error_print (GOB_ERROR, m->line_no, + "function attributes (G_GNUC_PRINTF, etc.) aren't " + "supported for the init or class_init methods"); + } + } + } +} + void check_for_class_destructors (Class *c) {