Fixes from https://bugs.freedesktop.org/attachment.cgi?id=3077
authorAlan Hourihane <alanh@tungstengraphics.com>
Tue, 30 Aug 2005 19:14:23 +0000 (19:14 +0000)
committerAlan Hourihane <alanh@tungstengraphics.com>
Tue, 30 Aug 2005 19:14:23 +0000 (19:14 +0000)
src/mesa/drivers/dri/unichrome/via_screen.c
src/mesa/drivers/dri/unichrome/via_texcombine.c

index 50342f3ff5962eabe8d1faec1f27b88b933469c5..4ca4a071a5f9c131ecb31ecf18102722ed64b326 100644 (file)
@@ -100,6 +100,7 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
     PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
       (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
     void * const psc = sPriv->psc->screenConfigs;
+    drmAddress map;
 
     if (sPriv->devPrivSize != sizeof(VIADRIRec)) {
       fprintf(stderr,"\nERROR!  sizeof(VIADRIRec) does not match passed size from device driver\n");
@@ -150,7 +151,7 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
     if (drmMap(sPriv->fd,
                gDRIPriv->regs.handle,
                gDRIPriv->regs.size,
-               (drmAddress *)&viaScreen->reg) != 0) {
+               &map) != 0) {
         FREE(viaScreen);
         sPriv->private = NULL;
         __driUtilMessage("viaInitDriver: drmMap regs failed");
@@ -162,8 +163,8 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
                    gDRIPriv->agp.handle,
                    gDRIPriv->agp.size,
                   (drmAddress *)&viaScreen->agpLinearStart) != 0) {
-           FREE(viaScreen);
            drmUnmap(viaScreen->reg, gDRIPriv->agp.size);
+           FREE(viaScreen);
            sPriv->private = NULL;
            __driUtilMessage("viaInitDriver: drmMap agp failed");
            return GL_FALSE;
index e691c553f9940257d03d01e9ceba8bedf0047b7c..d604457bfd8c3d5bc97bc47bbc625da8f3534f6d 100644 (file)
@@ -111,7 +111,7 @@ viaTexCombineState( struct via_context *vmesa,
    unsigned constant_alpha[3];
    unsigned bias_alpha = 0;
    unsigned abc_alpha = 0;
-   const struct gl_texture_unit const * texUnit = 
+   const struct gl_texture_unit * texUnit = 
       &vmesa->glCtx->Texture.Unit[unit];
    unsigned env_color[4];