open-src/xserver/xvnc/vnc-allocate.patch
author Alan Coopersmith <Alan.Coopersmith@Sun.COM>
Thu, 15 Jan 2009 12:55:00 -0800
changeset 606 068c11b419c9
permissions -rw-r--r--
6582489 X11R7.4: Xorg server 1.5.3, Mesa 7.2, and associated driver updates Includes changes contributed by Liang, Kan <[email protected]>: - G41 support patches - DRM_CAS in libdrm type error can cause deadlock and hang the glxgears. Includes changes contributed by Martin Bochnig <[email protected]>: - Make SUNWxorg-mesa package platform-clean

## Patch originally from Fedora - Revision 1.1 of:
http://cvs.fedoraproject.org/viewvc/rpms/vnc/devel/vnc-allocate.patch
with paths adjusted to match sources in tarball before files are moved

Remove use of ALLOCATE_LOCAL & DEALLOCATE_LOCAL macros removed from X headers

diff -up vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.allocate vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc
--- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.allocate	2008-02-25 16:38:37.000000000 +0100
+++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc	2008-02-25 16:54:48.000000000 +0100
@@ -536,9 +536,9 @@ static void vfbInstallColormap(ColormapP
     swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue);
     swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries);
 
-    ppix = (Pixel *)ALLOCATE_LOCAL(entries * sizeof(Pixel));
-    prgb = (xrgb *)ALLOCATE_LOCAL(entries * sizeof(xrgb));
-    defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem));
+    ppix = (Pixel *)xalloc(entries * sizeof(Pixel));
+    prgb = (xrgb *)xalloc(entries * sizeof(xrgb));
+    defs = (xColorItem *)xalloc(entries * sizeof(xColorItem));
 
     for (i = 0; i < entries; i++)  ppix[i] = i;
     /* XXX truecolor */
@@ -553,9 +553,9 @@ static void vfbInstallColormap(ColormapP
     }
     (*pmap->pScreen->StoreColors)(pmap, entries, defs);
 
-    DEALLOCATE_LOCAL(ppix);
-    DEALLOCATE_LOCAL(prgb);
-    DEALLOCATE_LOCAL(defs);
+    xfree(ppix);
+    xfree(prgb);
+    xfree(defs);
   }
 }