libweston: drop return type from ::query_dmabuf_{formats, modifiers}

Nobody checks for the bool returned by these functions. At the same
time: a) the functions set the respective num_foo to zero on error and
b) callers honour that variable.

Just drop the return type - it's useless.

Note: this is an ABI break.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Emil Velikov 2017-12-05 14:26:16 +00:00 committed by Daniel Stone
parent 340d25b76f
commit fbf165f5e8
2 changed files with 12 additions and 12 deletions

View File

@ -755,10 +755,12 @@ struct weston_renderer {
bool (*import_dmabuf)(struct weston_compositor *ec,
struct linux_dmabuf_buffer *buffer);
bool (*query_dmabuf_formats)(struct weston_compositor *ec,
/** On error sets num_formats to zero */
void (*query_dmabuf_formats)(struct weston_compositor *ec,
int **formats, int *num_formats);
bool (*query_dmabuf_modifiers)(struct weston_compositor *ec,
/** On error sets num_modifiers to zero */
void (*query_dmabuf_modifiers)(struct weston_compositor *ec,
int format, uint64_t **modifiers,
int *num_modifiers);
};

View File

@ -2083,7 +2083,7 @@ import_dmabuf(struct gl_renderer *gr,
return image;
}
static bool
static void
gl_renderer_query_dmabuf_formats(struct weston_compositor *wc,
int **formats, int *num_formats)
{
@ -2095,25 +2095,24 @@ gl_renderer_query_dmabuf_formats(struct weston_compositor *wc,
if (!gr->has_dmabuf_import_modifiers ||
!gr->query_dmabuf_formats(gr->egl_display, 0, NULL, &num)) {
*num_formats = 0;
return false;
return;
}
*formats = calloc(num, sizeof(int));
if (*formats == NULL) {
*num_formats = 0;
return false;
return;
}
if (!gr->query_dmabuf_formats(gr->egl_display, num, *formats, &num)) {
*num_formats = 0;
free(*formats);
return false;
return;
}
*num_formats = num;
return true;
}
static bool
static void
gl_renderer_query_dmabuf_modifiers(struct weston_compositor *wc, int format,
uint64_t **modifiers,
int *num_modifiers)
@ -2127,23 +2126,22 @@ gl_renderer_query_dmabuf_modifiers(struct weston_compositor *wc, int format,
!gr->query_dmabuf_modifiers(gr->egl_display, format, 0, NULL,
NULL, &num)) {
*num_modifiers = 0;
return false;
return;
}
*modifiers = calloc(num, sizeof(uint64_t));
if (*modifiers == NULL) {
*num_modifiers = 0;
return false;
return;
}
if (!gr->query_dmabuf_modifiers(gr->egl_display, format,
num, *modifiers, NULL, &num)) {
*num_modifiers = 0;
free(*modifiers);
return false;
return;
}
*num_modifiers = num;
return true;
}
static bool