From: Eric Engestrom Date: Wed, 2 Oct 2019 12:39:30 +0000 (+0100) Subject: loader: replace int/1/0 with bool/true/false X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=26149d119be24c027a0a247bf9408bab642e5958;p=mesa.git loader: replace int/1/0 with bool/true/false Signed-off-by: Eric Engestrom Acked-by: Lionel Landwerlin --- diff --git a/src/loader/loader.c b/src/loader/loader.c index 6e3e59d1687..873f55c8a9c 100644 --- a/src/loader/loader.c +++ b/src/loader/loader.c @@ -386,27 +386,27 @@ int loader_get_user_preferred_fd(int default_fd, bool *different_device) #if defined(HAVE_LIBDRM) -static int +static bool drm_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id) { drmDevicePtr device; - int ret; + bool ret; if (drmGetDevice2(fd, 0, &device) == 0) { if (device->bustype == DRM_BUS_PCI) { *vendor_id = device->deviceinfo.pci->vendor_id; *chip_id = device->deviceinfo.pci->device_id; - ret = 1; + ret = true; } else { log_(_LOADER_DEBUG, "MESA-LOADER: device is not located on the PCI bus\n"); - ret = 0; + ret = false; } drmFreeDevice(&device); } else { log_(_LOADER_WARNING, "MESA-LOADER: failed to retrieve device information\n"); - ret = 0; + ret = false; } return ret; @@ -414,14 +414,13 @@ drm_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id) #endif -int +bool loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id) { #if HAVE_LIBDRM - if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id)) - return 1; + return drm_get_pci_id_for_fd(fd, vendor_id, chip_id); #endif - return 0; + return false; } char * diff --git a/src/loader/loader.h b/src/loader/loader.h index d063ab3f6c4..4cb1e0eb6a3 100644 --- a/src/loader/loader.h +++ b/src/loader/loader.h @@ -43,7 +43,7 @@ loader_open_device(const char *); int loader_open_render_node(const char *name); -int +bool loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id); char *