diff options
author | Eric Engestrom <[email protected]> | 2019-09-01 17:30:32 +0100 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2019-10-13 18:10:47 +0100 |
commit | e9d808113510ffd682fbade3698f875b6234747b (patch) | |
tree | 8623b4912cb40b063fda6ff03b72fe456b30e164 /src/gbm | |
parent | 48289d8853272a1a9bbbb8971aef8f4c2e324266 (diff) |
gbm: turn 0/-1 bool into true/false
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gbm')
-rw-r--r-- | src/gbm/backends/dri/gbm_dri.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index 78a30287177..19d2d2d01f5 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -279,12 +279,13 @@ static struct dri_extension_match gbm_swrast_device_extensions[] = { { 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++) { @@ -300,7 +301,7 @@ dri_bind_extensions(struct gbm_dri_device *dri, 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; } } @@ -341,7 +342,7 @@ dri_load_driver(struct gbm_dri_device *dri) 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; @@ -361,7 +362,7 @@ dri_load_driver_swrast(struct gbm_dri_device *dri) 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; @@ -407,7 +408,7 @@ dri_screen_create_dri2(struct gbm_dri_device *dri, char *driver_name) 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; } |