diff --git a/src/common/opencl.c b/src/common/opencl.c index a1f5ca4a6cc2..dc8df2993fc1 100644 --- a/src/common/opencl.c +++ b/src/common/opencl.c @@ -1832,18 +1832,18 @@ static char *_strsep(char **stringp, static void _opencl_priority_parse(dt_opencl_t *cl, char *configstr, int *priority_list, - int *mandatory) + gboolean *mandatory) { const int devs = cl->num_devs; int count = 0; int *full = malloc(sizeof(int) * (devs + 1)); - int mnd = 0; + gboolean mnd = FALSE; // NULL or empty configstring? if(configstr == NULL || *configstr == '\0') { priority_list[0] = -1; - *mandatory = 0; + *mandatory = FALSE; free(full); return; } @@ -1851,7 +1851,7 @@ static void _opencl_priority_parse(dt_opencl_t *cl, // check if user wants us to force-use opencl device(s) if(configstr[0] == '+') { - mnd = 1; + mnd = TRUE; configstr++; } @@ -1921,7 +1921,7 @@ static void _opencl_priority_parse(dt_opencl_t *cl, while(count < devs + 1) priority_list[count++] = -1; // opencl use can only be mandatory if at least one opencl device is given - *mandatory = (priority_list[0] != -1) ? mnd : 0; + *mandatory = (priority_list[0] != -1) ? mnd : FALSE; free(full); } @@ -2005,7 +2005,7 @@ int dt_opencl_lock_device(const int pipetype) const size_t prio_size = sizeof(int) * (cl->num_devs + 1); int *priority = malloc(prio_size); - int mandatory; + gboolean mandatory; gboolean heavy = FALSE; switch(pipetype & DT_DEV_PIXELPIPE_ANY) @@ -2036,7 +2036,7 @@ int dt_opencl_lock_device(const int pipetype) default: free(priority); priority = NULL; - mandatory = 0; + mandatory = FALSE; } dt_pthread_mutex_unlock(&cl->lock); diff --git a/src/common/opencl.h b/src/common/opencl.h index 1db557ea1b15..4a8b656a9c6f 100644 --- a/src/common/opencl.h +++ b/src/common/opencl.h @@ -241,7 +241,7 @@ typedef struct dt_opencl_t int opencl_synchronization_timeout; dt_opencl_scheduling_profile_t scheduling_profile; uint32_t crc; - int mandatory[5]; + gboolean mandatory[5]; int *dev_priority_image; int *dev_priority_preview; int *dev_priority_preview2;