- s = g_strdup_printf("Unknown GTK+ type '%s' "
- "as argument type",
- a->gtktype);
- /* this could perhaps be a warning, but
- can there really be a type beyond the
- fundementals? */
- print_error(FALSE, s, a->line_no);
+ error_printf(GOB_ERROR, a->line_no,
+ "Unknown GLib type '%s' "
+ "as argument type",
+ a->gtktype);
+ }
+ }
+}
+
+void
+check_property_types (Class *c)
+{
+ GList *li;
+ for (li = c->nodes; li != NULL; li = li->next) {
+ Node *n = li->data;
+ if (n->type == PROPERTY_NODE) {
+ Property *p = (Property *)n;
+ if (get_cast (p->gtktype, FALSE))
+ continue;
+ error_printf (GOB_ERROR, p->line_no,
+ "Unknown GLib type '%s' "
+ "as property type",
+ p->gtktype);
+ }
+ }
+}
+
+static void
+check_func_arg_check_func_arg(Method *m, FuncArg *fa)
+{
+ GList *li;
+ char *s;
+
+ if( ! fa->checks)
+ return;
+
+ if(strcmp(fa->atype->name, "void") == 0 &&
+ fa->atype->pointer == NULL) {
+ error_print(GOB_ERROR, m->line_no,
+ "Running checks on a void function argument");
+ return;
+ }
+
+ for(li = fa->checks; li; li = li->next) {
+ Check *ch = li->data;
+ if(ch->chtype == TYPE_CHECK) {
+ char *p;
+ gboolean got_type = FALSE;
+ s = g_strdup(fa->atype->name);
+ p = strtok(s, " ");
+ if( ! p) {
+ g_free(s);
+ goto type_check_error;
+ }
+ while(p) {
+ if(strcmp(p, "const") != 0) {
+ if(got_type) {
+ g_free(s);
+ goto type_check_error;
+ }
+ got_type = TRUE;
+ }
+ p = strtok(NULL, " ");
+ }