{ NULL, 0, 0 }
};
-static int
+static bool
dri_bind_extensions(struct gbm_dri_device *dri,
struct dri_extension_match *matches,
const __DRIextension **extensions)
{
- int i, j, ret = 0;
+ int i, j;
+ bool ret = true;
void *field;
for (i = 0; extensions[i]; i++) {
for (j = 0; matches[j].name; j++) {
field = ((char *) dri + matches[j].offset);
if ((*(const __DRIextension **) field == NULL) && !matches[j].optional) {
- ret = -1;
+ ret = false;
}
}
if (!extensions)
return -1;
- if (dri_bind_extensions(dri, gbm_dri_device_extensions, extensions) < 0) {
+ if (!dri_bind_extensions(dri, gbm_dri_device_extensions, extensions)) {
dlclose(dri->driver);
fprintf(stderr, "failed to bind extensions\n");
return -1;
if (!extensions)
return -1;
- if (dri_bind_extensions(dri, gbm_swrast_device_extensions, extensions) < 0) {
+ if (!dri_bind_extensions(dri, gbm_swrast_device_extensions, extensions)) {
dlclose(dri->driver);
fprintf(stderr, "failed to bind extensions\n");
return -1;
return -1;
extensions = dri->core->getExtensions(dri->screen);
- if (dri_bind_extensions(dri, dri_core_extensions, extensions) < 0) {
+ if (!dri_bind_extensions(dri, dri_core_extensions, extensions)) {
ret = -1;
goto free_screen;
}