static void dl_print_errors(const char *prefix)
{
const char *err;
- while (err = lt_dlerror()) {
+ while ((err = lt_dlerror())) {
if (prefix) fprintf(stderr, "%s: ", prefix);
puts(err);
}
mod->dl = lt_dlopenext(G_TYPE_MODULE(m)->name);
if (!mod->dl) {
- dl_print_errors(__func__);
+ dl_print_errors(G_TYPE_MODULE(m)->name);
return FALSE;
}
static int modcmp(const void *a, const void *b, void *_data)
{
- GTypeModule *ma = G_TYPE_MODULE(a);
- GTypeModule *mb = G_TYPE_MODULE(b);
+ const GTypeModule *ma = a;
+ const GTypeModule *mb = b;
return strcmp(ma->name, mb->name);
}
dl_print_errors(__func__);
return -1;
}
+
+ return 0;
}
GType module_get_class(const char *package, const char *class)