loader: fixes -Werror,-Wdeprecated-non-prototype for clang-15 in pipe-loader

There are multiple error messages, show one of them:
../../src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c:219:54: error: passing arguments to a function without a prototype is deprecated in
all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
         sdev->ws = sdev->dd->winsys[i].create_winsys(drisw_lf);
                                                     ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>
This commit is contained in:
Yonggang Luo 2022-11-04 21:03:08 +08:00 committed by Marge Bot
parent cd8f2b51a0
commit fb6b3bee25
3 changed files with 20 additions and 14 deletions

View File

@ -69,13 +69,13 @@ static const struct sw_driver_descriptor driver_descriptors = {
#ifdef HAVE_DRI
{
.name = "dri",
.create_winsys = dri_create_sw_winsys,
.create_winsys_dri = dri_create_sw_winsys,
},
#endif
#ifdef HAVE_DRISW_KMS
{
.name = "kms_dri",
.create_winsys = kms_dri_create_winsys,
.create_winsys_kms_dri = kms_dri_create_winsys,
},
#endif
#ifndef __ANDROID__
@ -85,7 +85,7 @@ static const struct sw_driver_descriptor driver_descriptors = {
},
{
.name = "wrapped",
.create_winsys = wrapper_sw_winsys_wrap_pipe_screen,
.create_winsys_wrapped = wrapper_sw_winsys_wrap_pipe_screen,
},
#endif
{ 0 },
@ -99,12 +99,12 @@ static const struct sw_driver_descriptor kopper_driver_descriptors = {
.winsys = {
{
.name = "dri",
.create_winsys = dri_create_sw_winsys,
.create_winsys_dri = dri_create_sw_winsys,
},
#ifdef HAVE_DRISW_KMS
{
.name = "kms_dri",
.create_winsys = kms_dri_create_winsys,
.create_winsys_kms_dri = kms_dri_create_winsys,
},
#endif
#ifndef __ANDROID__
@ -114,7 +114,7 @@ static const struct sw_driver_descriptor kopper_driver_descriptors = {
},
{
.name = "wrapped",
.create_winsys = wrapper_sw_winsys_wrap_pipe_screen,
.create_winsys_wrapped = wrapper_sw_winsys_wrap_pipe_screen,
},
#endif
{ 0 },
@ -216,7 +216,7 @@ pipe_loader_sw_probe_dri(struct pipe_loader_device **devs, const struct drisw_lo
for (i = 0; sdev->dd->winsys[i].name; i++) {
if (strcmp(sdev->dd->winsys[i].name, "dri") == 0) {
sdev->ws = sdev->dd->winsys[i].create_winsys(drisw_lf);
sdev->ws = sdev->dd->winsys[i].create_winsys_dri(drisw_lf);
break;
}
}
@ -246,7 +246,7 @@ pipe_loader_vk_probe_dri(struct pipe_loader_device **devs, const struct drisw_lo
for (i = 0; sdev->dd->winsys[i].name; i++) {
if (strcmp(sdev->dd->winsys[i].name, "dri") == 0) {
sdev->ws = sdev->dd->winsys[i].create_winsys(drisw_lf);
sdev->ws = sdev->dd->winsys[i].create_winsys_dri(drisw_lf);
break;
}
}
@ -282,7 +282,7 @@ pipe_loader_sw_probe_kms(struct pipe_loader_device **devs, int fd)
for (i = 0; sdev->dd->winsys[i].name; i++) {
if (strcmp(sdev->dd->winsys[i].name, "kms_dri") == 0) {
sdev->ws = sdev->dd->winsys[i].create_winsys(sdev->fd);
sdev->ws = sdev->dd->winsys[i].create_winsys_kms_dri(sdev->fd);
break;
}
}
@ -360,7 +360,7 @@ pipe_loader_sw_probe_wrapped(struct pipe_loader_device **dev,
for (i = 0; sdev->dd->winsys[i].name; i++) {
if (strcmp(sdev->dd->winsys[i].name, "wrapped") == 0) {
sdev->ws = sdev->dd->winsys[i].create_winsys(screen);
sdev->ws = sdev->dd->winsys[i].create_winsys_wrapped(screen);
break;
}
}

View File

@ -6,13 +6,19 @@
struct pipe_screen;
struct sw_winsys;
struct drisw_loader_funcs;
struct sw_driver_descriptor
{
struct pipe_screen *(*create_screen)(struct sw_winsys *ws, const struct pipe_screen_config *config, bool sw_vk);
struct {
const char * const name;
struct sw_winsys *(*create_winsys)();
union {
struct sw_winsys *(*create_winsys)();
struct sw_winsys *(*create_winsys_wrapped)(struct pipe_screen *screen);
struct sw_winsys *(*create_winsys_dri)(const struct drisw_loader_funcs *lf);
struct sw_winsys *(*create_winsys_kms_dri)(int fd);
};
} winsys[];
};

View File

@ -29,13 +29,13 @@ const struct sw_driver_descriptor swrast_driver_descriptor = {
#ifdef HAVE_DRI
{
.name = "dri",
.create_winsys = dri_create_sw_winsys,
.create_winsys_dri = dri_create_sw_winsys,
},
#endif
#ifdef HAVE_DRISW_KMS
{
.name = "kms_dri",
.create_winsys = kms_dri_create_winsys,
.create_winsys_kms_dri = kms_dri_create_winsys,
},
#endif
{
@ -44,7 +44,7 @@ const struct sw_driver_descriptor swrast_driver_descriptor = {
},
{
.name = "wrapped",
.create_winsys = wrapper_sw_winsys_wrap_pipe_screen,
.create_winsys_wrapped = wrapper_sw_winsys_wrap_pipe_screen,
},
{ 0 },
}