glx,dri: simplify indirect function call syntax

just remove () and * and the space

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19741>
This commit is contained in:
Marek Olšák 2022-11-15 17:53:39 -05:00 committed by Marge Bot
parent fbf93ef821
commit 8cb8a3c03d
9 changed files with 44 additions and 44 deletions

View File

@ -71,7 +71,7 @@ This can be implemented in just a few lines of C code. The file
{
const struct _glapi_table * const dispatch = GET_DISPATCH();
(*dispatch->Vertex3f)(x, y, z);
dispatch->Vertex3f(x, y, z);
}
The problem with this simple implementation is the large amount of

View File

@ -287,10 +287,10 @@ dri_image_drawable_get_buffers(struct dri_drawable *drawable,
}
}
return (*sPriv->image.loader->getBuffers) (dPriv, image_format,
(uint32_t *) &drawable->base.stamp,
dPriv->loaderPrivate, buffer_mask,
images);
return sPriv->image.loader->getBuffers(dPriv, image_format,
(uint32_t *)&drawable->base.stamp,
dPriv->loaderPrivate, buffer_mask,
images);
}
static __DRIbuffer *

View File

@ -105,7 +105,7 @@ dri2_destroy_context(struct glx_context *context)
free((char *) context->extensions);
(*psc->core->destroyContext) (context->driContext);
psc->core->destroyContext(context->driContext);
free(context);
}
@ -133,7 +133,7 @@ dri2_bind_context(struct glx_context *context, struct glx_context *old,
else if (read != None)
return GLXBadDrawable;
if (!(*psc->core->bindContext) (context->driContext, dri_draw, dri_read))
if (!psc->core->bindContext(context->driContext, dri_draw, dri_read))
return GLXBadContext;
return Success;
@ -144,7 +144,7 @@ dri2_unbind_context(struct glx_context *context, struct glx_context *new)
{
struct dri2_screen *psc = (struct dri2_screen *) context->psc;
(*psc->core->unbindContext) (context->driContext);
psc->core->unbindContext(context->driContext);
}
static struct glx_context *
@ -236,7 +236,7 @@ dri2_create_context_attribs(struct glx_screen *base,
pcp->renderType = dca.render_type;
pcp->driContext =
(*psc->dri2->createContextAttribs) (psc->driScreen,
psc->dri2->createContextAttribs(psc->driScreen,
dca.api,
config ? config->driConfig : NULL,
shared,
@ -267,7 +267,7 @@ dri2DestroyDrawable(__GLXDRIdrawable *base)
struct dri2_display *pdp = (struct dri2_display *)dpyPriv->dri2Display;
__glxHashDelete(pdp->dri2Hash, pdraw->base.xDrawable);
(*psc->core->destroyDrawable) (pdraw->driDrawable);
psc->core->destroyDrawable(pdraw->driDrawable);
/* If it's a GLX 1.3 drawables, we can destroy the DRI2 drawable
* now, as the application explicitly asked to destroy the GLX
@ -313,7 +313,7 @@ dri2CreateDrawable(struct glx_screen *base, XID xDrawable,
pdp = (struct dri2_display *)dpyPriv->dri2Display;
/* Create a new drawable */
pdraw->driDrawable =
(*psc->dri2->createNewDrawable) (psc->driScreen,
psc->dri2->createNewDrawable(psc->driScreen,
config->driConfig, pdraw);
if (!pdraw->driDrawable) {
@ -323,7 +323,7 @@ dri2CreateDrawable(struct glx_screen *base, XID xDrawable,
}
if (__glxHashInsert(pdp->dri2Hash, xDrawable, pdraw)) {
(*psc->core->destroyDrawable) (pdraw->driDrawable);
psc->core->destroyDrawable(pdraw->driDrawable);
DRI2DestroyDrawable(psc->base.dpy, xDrawable);
free(pdraw);
return None;
@ -534,7 +534,7 @@ dri2_copy_drawable(struct dri2_drawable *priv, int dest, int src)
xrect.height = priv->height;
if (psc->f)
(*psc->f->flush) (priv->driDrawable);
psc->f->flush(priv->driDrawable);
region = XFixesCreateRegion(psc->base.dpy, &xrect, 1);
DRI2CopyRegion(psc->base.dpy, priv->base.xDrawable, region, dest, src);
@ -605,7 +605,7 @@ dri2DestroyScreen(struct glx_screen *base)
struct dri2_screen *psc = (struct dri2_screen *) base;
/* Free the direct rendering per screen data */
(*psc->core->destroyScreen) (psc->driScreen);
psc->core->destroyScreen(psc->driScreen);
driDestroyConfigs(psc->driver_configs);
free(psc->driverName);
close(psc->fd);
@ -890,13 +890,13 @@ dri2_bind_tex_image(__GLXDRIdrawable *base,
if (psc->texBuffer->base.version >= 2 &&
psc->texBuffer->setTexBuffer2 != NULL) {
(*psc->texBuffer->setTexBuffer2) (gc->driContext,
psc->texBuffer->setTexBuffer2(gc->driContext,
pdraw->base.textureTarget,
pdraw->base.textureFormat,
pdraw->driDrawable);
}
else {
(*psc->texBuffer->setTexBuffer) (gc->driContext,
psc->texBuffer->setTexBuffer(gc->driContext,
pdraw->base.textureTarget,
pdraw->driDrawable);
}
@ -915,7 +915,7 @@ dri2_release_tex_image(__GLXDRIdrawable *base, int buffer)
if (psc->texBuffer->base.version >= 3 &&
psc->texBuffer->releaseTexBuffer != NULL) {
(*psc->texBuffer->releaseTexBuffer) (gc->driContext,
psc->texBuffer->releaseTexBuffer(gc->driContext,
pdraw->base.textureTarget,
pdraw->driDrawable);
}

View File

@ -176,7 +176,7 @@ dri3_destroy_context(struct glx_context *context)
free((char *) context->extensions);
(*psc->core->destroyContext) (context->driContext);
psc->core->destroyContext(context->driContext);
free(context);
}
@ -204,7 +204,7 @@ dri3_bind_context(struct glx_context *context, struct glx_context *old,
else if (read != None)
return GLXBadDrawable;
if (!(*psc->core->bindContext) (context->driContext, dri_draw, dri_read))
if (!psc->core->bindContext(context->driContext, dri_draw, dri_read))
return GLXBadContext;
if (dri_draw)
@ -220,7 +220,7 @@ dri3_unbind_context(struct glx_context *context, struct glx_context *new)
{
struct dri3_screen *psc = (struct dri3_screen *) context->psc;
(*psc->core->unbindContext) (context->driContext);
psc->core->unbindContext(context->driContext);
}
static struct glx_context *
@ -309,7 +309,7 @@ dri3_create_context_attribs(struct glx_screen *base,
pcp->renderType = dca.render_type;
pcp->driContext =
(*psc->image_driver->createContextAttribs) (psc->driScreen,
psc->image_driver->createContextAttribs(psc->driScreen,
dca.api,
config ? config->driConfig
: NULL,
@ -618,12 +618,12 @@ dri3_destroy_screen(struct glx_screen *base)
if (psc->is_different_gpu) {
if (psc->driScreenDisplayGPU) {
loader_dri3_close_screen(psc->driScreenDisplayGPU);
(*psc->core->destroyScreen) (psc->driScreenDisplayGPU);
psc->core->destroyScreen(psc->driScreenDisplayGPU);
}
close(psc->fd_display_gpu);
}
loader_dri3_close_screen(psc->driScreen);
(*psc->core->destroyScreen) (psc->driScreen);
psc->core->destroyScreen(psc->driScreen);
driDestroyConfigs(psc->driver_configs);
close(psc->fd);
free(psc);
@ -678,7 +678,7 @@ dri3_bind_tex_image(__GLXDRIdrawable *base,
XSync(gc->currentDpy, false);
(*psc->texBuffer->setTexBuffer2) (gc->driContext,
psc->texBuffer->setTexBuffer2(gc->driContext,
pdraw->base.textureTarget,
pdraw->base.textureFormat,
pdraw->loader_drawable.dri_drawable);
@ -697,7 +697,7 @@ dri3_release_tex_image(__GLXDRIdrawable *base, int buffer)
if (psc->texBuffer->base.version >= 3 &&
psc->texBuffer->releaseTexBuffer != NULL)
(*psc->texBuffer->releaseTexBuffer) (gc->driContext,
psc->texBuffer->releaseTexBuffer(gc->driContext,
pdraw->base.textureTarget,
pdraw->loader_drawable.dri_drawable);
}

View File

@ -413,7 +413,7 @@ driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable)
}
if (__glxHashInsert(priv->drawHash, glxDrawable, pdraw)) {
(*pdraw->destroyDrawable) (pdraw);
pdraw->destroyDrawable(pdraw);
return NULL;
}
pdraw->refcount = 1;

View File

@ -719,14 +719,14 @@ driswCreateDrawable(struct glx_screen *base, XID xDrawable,
/* Create a new drawable */
if (kopper) {
pdp->driDrawable =
(*kopper->createNewDrawable) (psc->driScreen, config->driConfig, pdp, !(type & GLX_WINDOW_BIT));
kopper->createNewDrawable(psc->driScreen, config->driConfig, pdp, !(type & GLX_WINDOW_BIT));
pdp->swapInterval = dri_get_initial_swap_interval(psc->driScreen, psc->config);
psc->kopper->setSwapInterval(pdp->driDrawable, pdp->swapInterval);
}
else
pdp->driDrawable =
(*swrast->createNewDrawable) (psc->driScreen, config->driConfig, pdp);
swrast->createNewDrawable(psc->driScreen, config->driConfig, pdp);
if (!pdp->driDrawable) {
XDestroyDrawable(pdp, psc->base.dpy, xDrawable);

View File

@ -196,7 +196,7 @@ CreateDRIDrawable(Display *dpy, struct glx_config *config,
}
if (__glxHashInsert(priv->drawHash, glxdrawable, pdraw)) {
(*pdraw->destroyDrawable) (pdraw);
pdraw->destroyDrawable(pdraw);
return GL_FALSE;
}
@ -217,7 +217,7 @@ DestroyDRIDrawable(Display *dpy, GLXDrawable drawable)
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
if (priv != NULL && pdraw != NULL) {
(*pdraw->destroyDrawable) (pdraw);
pdraw->destroyDrawable(pdraw);
__glxHashDelete(priv->drawHash, drawable);
}
#endif

View File

@ -764,7 +764,7 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap)
}
if (__glxHashInsert(priv->drawHash, xid, pdraw)) {
(*pdraw->destroyDrawable) (pdraw);
pdraw->destroyDrawable(pdraw);
xid = None;
break;
}
@ -821,7 +821,7 @@ glXDestroyGLXPixmap(Display * dpy, GLXPixmap glxpixmap)
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, glxpixmap);
if (priv != NULL && pdraw != NULL) {
(*pdraw->destroyDrawable) (pdraw);
pdraw->destroyDrawable(pdraw);
__glxHashDelete(priv->drawHash, glxpixmap);
}
}
@ -2225,7 +2225,7 @@ glXSwapBuffersMscOML(Display *dpy, GLXDrawable drawable,
#ifdef GLX_DIRECT_RENDERING
if (psc->driScreen && psc->driScreen->swapBuffers)
return (*psc->driScreen->swapBuffers)(pdraw, target_msc, divisor,
return psc->driScreen->swapBuffers(pdraw, target_msc, divisor,
remainder, False);
#endif
@ -2364,7 +2364,7 @@ glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable,
if (pdraw != NULL) {
struct glx_screen *psc = pdraw->psc;
if (psc->driScreen->copySubBuffer != NULL) {
(*psc->driScreen->copySubBuffer) (pdraw, x, y, width, height, True);
psc->driScreen->copySubBuffer(pdraw, x, y, width, height, True);
}
return;
@ -2431,7 +2431,7 @@ glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer,
if (pdraw != NULL) {
struct glx_screen *psc = pdraw->psc;
if (psc->driScreen->bindTexImage != NULL)
(*psc->driScreen->bindTexImage) (pdraw, buffer, attrib_list);
psc->driScreen->bindTexImage(pdraw, buffer, attrib_list);
return;
}
@ -2489,7 +2489,7 @@ glXReleaseTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer)
if (pdraw != NULL) {
struct glx_screen *psc = pdraw->psc;
if (psc->driScreen->releaseTexImage != NULL)
(*psc->driScreen->releaseTexImage) (pdraw, buffer);
psc->driScreen->releaseTexImage(pdraw, buffer);
return;
}

View File

@ -303,22 +303,22 @@ glx_display_free(struct glx_display *priv)
/* Free the direct rendering per display data */
if (priv->driswDisplay)
(*priv->driswDisplay->destroyDisplay) (priv->driswDisplay);
priv->driswDisplay->destroyDisplay(priv->driswDisplay);
priv->driswDisplay = NULL;
#if defined (GLX_USE_DRM)
if (priv->dri2Display)
(*priv->dri2Display->destroyDisplay) (priv->dri2Display);
priv->dri2Display->destroyDisplay(priv->dri2Display);
priv->dri2Display = NULL;
if (priv->dri3Display)
(*priv->dri3Display->destroyDisplay) (priv->dri3Display);
priv->dri3Display->destroyDisplay(priv->dri3Display);
priv->dri3Display = NULL;
#endif /* GLX_USE_DRM */
#if defined(GLX_USE_WINDOWSGL)
if (priv->windowsdriDisplay)
(*priv->windowsdriDisplay->destroyDisplay) (priv->windowsdriDisplay);
priv->windowsdriDisplay->destroyDisplay(priv->windowsdriDisplay);
priv->windowsdriDisplay = NULL;
#endif /* GLX_USE_WINDOWSGL */
@ -836,19 +836,19 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
#if defined(GLX_USE_DRM)
#if defined(HAVE_DRI3)
if (priv->dri3Display)
psc = (*priv->dri3Display->createScreen) (i, priv);
psc = priv->dri3Display->createScreen(i, priv);
#endif /* HAVE_DRI3 */
if (psc == NULL && priv->dri2Display)
psc = (*priv->dri2Display->createScreen) (i, priv);
psc = priv->dri2Display->createScreen(i, priv);
#endif /* GLX_USE_DRM */
#ifdef GLX_USE_WINDOWSGL
if (psc == NULL && priv->windowsdriDisplay)
psc = (*priv->windowsdriDisplay->createScreen) (i, priv);
psc = priv->windowsdriDisplay->createScreen(i, priv);
#endif
if (psc == NULL && priv->driswDisplay)
psc = (*priv->driswDisplay->createScreen) (i, priv);
psc = priv->driswDisplay->createScreen(i, priv);
#endif /* GLX_DIRECT_RENDERING && !GLX_USE_APPLEGL */
#if defined(GLX_USE_APPLEGL)