From 8d0228912bfef173139296a96a097f1a6348c963 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Mon, 19 Jul 2010 20:01:59 -0400 Subject: glx: Workaround mismatch in signedness between extensions and protocol The DRI2 protocol for ust, msc and sbc are unsigned but the extensions talk about int64_t. Do a little dance to make the compiler shut up. --- src/glx/dri2_glx.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'src/glx/dri2_glx.c') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 27223fdaeb..032d620a34 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -278,7 +278,16 @@ static int dri2DrawableGetMSC(__GLXscreenConfigs *psc, __GLXDRIdrawable *pdraw, int64_t *ust, int64_t *msc, int64_t *sbc) { - return DRI2GetMSC(psc->dpy, pdraw->xDrawable, ust, msc, sbc); + CARD64 dri2_ust, dri2_msc, dri2_sbc; + int ret; + + ret = DRI2GetMSC(psc->dpy, pdraw->xDrawable, + &dri2_ust, &dri2_msc, &dri2_sbc); + *ust = dri2_ust; + *msc = dri2_msc; + *sbc = dri2_sbc; + + return ret; } #endif @@ -290,16 +299,32 @@ static int dri2WaitForMSC(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc) { - return DRI2WaitMSC(pdraw->psc->dpy, pdraw->xDrawable, target_msc, divisor, - remainder, ust, msc, sbc); + CARD64 dri2_ust, dri2_msc, dri2_sbc; + int ret; + + ret = DRI2WaitMSC(pdraw->psc->dpy, pdraw->xDrawable, target_msc, divisor, + remainder, &dri2_ust, &dri2_msc, &dri2_sbc); + *ust = dri2_ust; + *msc = dri2_msc; + *sbc = dri2_sbc; + + return ret; } static int dri2WaitForSBC(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc) { - return DRI2WaitSBC(pdraw->psc->dpy, pdraw->xDrawable, target_sbc, ust, msc, - sbc); + CARD64 dri2_ust, dri2_msc, dri2_sbc; + int ret; + + ret = DRI2WaitSBC(pdraw->psc->dpy, pdraw->xDrawable, + target_sbc, &dri2_ust, &dri2_msc, &dri2_sbc); + *ust = dri2_ust; + *msc = dri2_msc; + *sbc = dri2_sbc; + + return ret; } #endif /* X_DRI2WaitMSC */ @@ -451,7 +476,7 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, struct dri2_screen *psc = (struct dri2_screen *) priv->base.psc; struct dri2_display *pdp = (struct dri2_display *)dpyPriv->dri2Display; - int64_t ret; + CARD64 ret; #ifdef __DRI2_FLUSH if (psc->f) @@ -554,7 +579,7 @@ dri2SetSwapInterval(__GLXDRIdrawable *pdraw, int interval) return 0; } -static unsigned int +static int dri2GetSwapInterval(__GLXDRIdrawable *pdraw) { struct dri2_drawable *priv = (struct dri2_drawable *) pdraw; -- cgit v1.2.3