[Mesa-dev] [PATCH 1/8] egl/dri2: Unify the style of function pointer calls in structs
Alex Deucher
alexdeucher at gmail.com
Mon Nov 30 09:23:43 PST 2015
On Wed, Nov 25, 2015 at 12:27 AM, Boyan Ding <boyan.j.ding at gmail.com> wrote:
> Signed-off-by: Boyan Ding <boyan.j.ding at gmail.com>
I don't have a strong opinion on the style. Patches are:
Acked-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> src/egl/drivers/dri2/egl_dri2.c | 10 ++++------
> src/egl/drivers/dri2/platform_android.c | 8 ++++----
> src/egl/drivers/dri2/platform_drm.c | 14 +++++++-------
> src/egl/drivers/dri2/platform_wayland.c | 14 +++++++-------
> src/egl/drivers/dri2/platform_x11.c | 16 ++++++++--------
> 5 files changed, 30 insertions(+), 32 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index d34b161..3a9c925 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -1440,9 +1440,8 @@ dri2_bind_tex_image(_EGLDriver *drv,
> assert(!"Unexpected texture target in dri2_bind_tex_image()");
> }
>
> - (*dri2_dpy->tex_buffer->setTexBuffer2)(dri2_ctx->dri_context,
> - target, format,
> - dri_drawable);
> + dri2_dpy->tex_buffer->setTexBuffer2(dri2_ctx->dri_context,
> + target, format, dri_drawable);
>
> return EGL_TRUE;
> }
> @@ -1473,9 +1472,8 @@ dri2_release_tex_image(_EGLDriver *drv,
>
> if (dri2_dpy->tex_buffer->base.version >= 3 &&
> dri2_dpy->tex_buffer->releaseTexBuffer != NULL) {
> - (*dri2_dpy->tex_buffer->releaseTexBuffer)(dri2_ctx->dri_context,
> - target,
> - dri_drawable);
> + dri2_dpy->tex_buffer->releaseTexBuffer(dri2_ctx->dri_context,
> + target, dri_drawable);
> }
>
> return EGL_TRUE;
> diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
> index 8f3abcb..24f9873 100644
> --- a/src/egl/drivers/dri2/platform_android.c
> +++ b/src/egl/drivers/dri2/platform_android.c
> @@ -235,8 +235,8 @@ droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
> dri2_surf->base.GLColorspace);
>
> dri2_surf->dri_drawable =
> - (*dri2_dpy->dri2->createNewDrawable)(dri2_dpy->dri_screen, config,
> - dri2_surf);
> + dri2_dpy->dri2->createNewDrawable(dri2_dpy->dri_screen, config,
> + dri2_surf);
> if (dri2_surf->dri_drawable == NULL) {
> _eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
> goto cleanup_surface;
> @@ -290,7 +290,7 @@ droid_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
> dri2_surf->window->common.decRef(&dri2_surf->window->common);
> }
>
> - (*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
> + dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
>
> free(dri2_surf);
>
> @@ -319,7 +319,7 @@ droid_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
> if (dri2_surf->buffer)
> droid_window_enqueue_buffer(dri2_surf);
>
> - (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
> + dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
>
> return EGL_TRUE;
> }
> diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
> index 3f4f7e7..bc2e470 100644
> --- a/src/egl/drivers/dri2/platform_drm.c
> +++ b/src/egl/drivers/dri2/platform_drm.c
> @@ -136,15 +136,15 @@ dri2_drm_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
>
> if (dri2_dpy->dri2) {
> dri2_surf->dri_drawable =
> - (*dri2_dpy->dri2->createNewDrawable)(dri2_dpy->dri_screen, config,
> - dri2_surf->gbm_surf);
> + dri2_dpy->dri2->createNewDrawable(dri2_dpy->dri_screen, config,
> + dri2_surf->gbm_surf);
>
> } else {
> assert(dri2_dpy->swrast != NULL);
>
> dri2_surf->dri_drawable =
> - (*dri2_dpy->swrast->createNewDrawable)(dri2_dpy->dri_screen, config,
> - dri2_surf->gbm_surf);
> + dri2_dpy->swrast->createNewDrawable(dri2_dpy->dri_screen, config,
> + dri2_surf->gbm_surf);
>
> }
> if (dri2_surf->dri_drawable == NULL) {
> @@ -194,7 +194,7 @@ dri2_drm_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
> if (!_eglPutSurface(surf))
> return EGL_TRUE;
>
> - (*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
> + dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
>
> for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
> if (dri2_surf->color_buffers[i].bo)
> @@ -417,7 +417,7 @@ dri2_drm_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
> unsigned i;
>
> if (dri2_dpy->swrast) {
> - (*dri2_dpy->core->swapBuffers)(dri2_surf->dri_drawable);
> + dri2_dpy->core->swapBuffers(dri2_surf->dri_drawable);
> } else {
> if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
> if (dri2_surf->current)
> @@ -439,7 +439,7 @@ dri2_drm_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
> }
>
> dri2_flush_drawable_for_swapbuffers(disp, draw);
> - (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
> + dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
> }
>
> return EGL_TRUE;
> diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
> index c2438f7..c6ecdb3 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -115,7 +115,7 @@ resize_callback(struct wl_egl_window *wl_win, void *data)
> struct dri2_egl_display *dri2_dpy =
> dri2_egl_display(dri2_surf->base.Resource.Display);
>
> - (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
> + dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
> }
>
> /**
> @@ -167,8 +167,8 @@ dri2_wl_create_surface(_EGLDriver *drv, _EGLDisplay *disp,
> dri2_surf->base.GLColorspace);
>
> dri2_surf->dri_drawable =
> - (*dri2_dpy->dri2->createNewDrawable)(dri2_dpy->dri_screen, config,
> - dri2_surf);
> + dri2_dpy->dri2->createNewDrawable(dri2_dpy->dri_screen, config,
> + dri2_surf);
> if (dri2_surf->dri_drawable == NULL) {
> _eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
> goto cleanup_surf;
> @@ -232,7 +232,7 @@ dri2_wl_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
> if (!_eglPutSurface(surf))
> return EGL_TRUE;
>
> - (*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
> + dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
>
> for (i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
> if (dri2_surf->color_buffers[i].wl_buffer)
> @@ -721,7 +721,7 @@ dri2_wl_swap_buffers_with_damage(_EGLDriver *drv,
> }
>
> dri2_flush_drawable_for_swapbuffers(disp, draw);
> - (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
> + dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
>
> wl_surface_commit(dri2_surf->wl_win->surface);
>
> @@ -1667,8 +1667,8 @@ dri2_wl_swrast_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
> dri2_surf->base.GLColorspace);
>
> dri2_surf->dri_drawable =
> - (*dri2_dpy->swrast->createNewDrawable)(dri2_dpy->dri_screen,
> - config, dri2_surf);
> + dri2_dpy->swrast->createNewDrawable(dri2_dpy->dri_screen,
> + config, dri2_surf);
> if (dri2_surf->dri_drawable == NULL) {
> _eglError(EGL_BAD_ALLOC, "swrast->createNewDrawable");
> goto cleanup_dri_drawable;
> diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
> index 08cbf2d..0732054 100644
> --- a/src/egl/drivers/dri2/platform_x11.c
> +++ b/src/egl/drivers/dri2/platform_x11.c
> @@ -255,13 +255,13 @@ dri2_x11_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
>
> if (dri2_dpy->dri2) {
> dri2_surf->dri_drawable =
> - (*dri2_dpy->dri2->createNewDrawable)(dri2_dpy->dri_screen, config,
> - dri2_surf);
> + dri2_dpy->dri2->createNewDrawable(dri2_dpy->dri_screen, config,
> + dri2_surf);
> } else {
> assert(dri2_dpy->swrast);
> dri2_surf->dri_drawable =
> - (*dri2_dpy->swrast->createNewDrawable)(dri2_dpy->dri_screen, config,
> - dri2_surf);
> + dri2_dpy->swrast->createNewDrawable(dri2_dpy->dri_screen, config,
> + dri2_surf);
> }
>
> if (dri2_surf->dri_drawable == NULL) {
> @@ -389,7 +389,7 @@ dri2_x11_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
> if (!_eglPutSurface(surf))
> return EGL_TRUE;
>
> - (*dri2_dpy->core->destroyDrawable)(dri2_surf->dri_drawable);
> + dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
>
> if (dri2_dpy->dri2) {
> xcb_dri2_destroy_drawable (dri2_dpy->conn, dri2_surf->drawable);
> @@ -794,7 +794,7 @@ dri2_copy_region(_EGLDriver *drv, _EGLDisplay *disp,
> return EGL_TRUE;
>
> if (dri2_dpy->flush)
> - (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
> + dri2_dpy->flush->flush(dri2_surf->dri_drawable);
>
> if (dri2_surf->have_fake_front)
> render_attachment = XCB_DRI2_ATTACHMENT_BUFFER_FAKE_FRONT_LEFT;
> @@ -858,7 +858,7 @@ dri2_x11_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
> */
> if (dri2_dpy->flush &&
> dri2_dpy->flush->base.version >= 3 && dri2_dpy->flush->invalidate)
> - (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
> + dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
>
> return swap_count;
> }
> @@ -955,7 +955,7 @@ dri2_x11_copy_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
>
> (void) drv;
>
> - (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
> + dri2_dpy->flush->flush(dri2_surf->dri_drawable);
>
> gc = xcb_generate_id(dri2_dpy->conn);
> xcb_create_gc(dri2_dpy->conn, gc, target, 0, NULL);
> --
> 2.6.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list