[ncl] Add patch to fix xwd driver on 64-bit (bug 839707)

Orion Poplawski orion at fedoraproject.org
Fri Jul 13 16:26:26 UTC 2012


commit a74bcd8333e66e5a3e1f223c8870a4bed1cba7b1
Author: Orion Poplawski <orion at nwra.com>
Date:   Fri Jul 13 10:26:16 2012 -0600

    Add patch to fix xwd driver on 64-bit (bug 839707)

 ncl-xwd.patch |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 ncl.spec      |    8 +++++++-
 2 files changed, 57 insertions(+), 1 deletions(-)
---
diff --git a/ncl-xwd.patch b/ncl-xwd.patch
new file mode 100644
index 0000000..7b0628c
--- /dev/null
+++ b/ncl-xwd.patch
@@ -0,0 +1,50 @@
+diff -up ncl_ncarg-6.1.0-beta/ncarview/src/lib/libncarg_ras/xwd.c.64bit ncl_ncarg-6.1.0-beta/ncarview/src/lib/libncarg_ras/xwd.c
+--- ncl_ncarg-6.1.0-beta/ncarview/src/lib/libncarg_ras/xwd.c.64bit	2012-05-28 13:36:41.000000000 -0600
++++ ncl_ncarg-6.1.0-beta/ncarview/src/lib/libncarg_ras/xwd.c	2012-07-12 17:03:53.730179494 -0600
+@@ -186,7 +186,7 @@ XWDRead(ras)
+ 	static unsigned		buffer_size;	/* size of image	*/
+ 	unsigned char		*cptr1, *cptr2;
+ 	int			status, i;
+-	XColor			xcolors[256];	/* color palette in X dump */
++	XWDColor		xcolors[256];	/* color palette in X dump */
+ 	int			win_name_size;	/* not used */
+ 	unsigned		image_size();
+ 	static unsigned long 	swaptest = 1;
+@@ -303,8 +303,8 @@ XWDRead(ras)
+ 	/* Read in the color palette */
+ 
+ 	status  = fread((char *) xcolors, 1, 
+-		(int) (ras->ncolor * sizeof(XColor)), ras->fp);
+-	if (status != ras->ncolor * sizeof(XColor)) {
++		(int) (ras->ncolor * sizeof(XWDColor)), ras->fp);
++	if (status != ras->ncolor * sizeof(XWDColor)) {
+ 		(void) ESprintf(RAS_E_NOT_IN_CORRECT_FORMAT,
+ 			"XWDRead(\"%s\")", ras->name);
+ 	}
+@@ -313,7 +313,7 @@ XWDRead(ras)
+ 
+ 	if (*(char *) &swaptest) {
+ 		for (i = 0; i < ras->ncolor; i++) {
+-			_swaplong((char *) &xcolors[i].pixel, sizeof(long));
++			_swaplong((char *) &xcolors[i].pixel, sizeof(xcolors[i].pixel));
+ 			_swapshort((char *) &xcolors[i].red, 3 * sizeof(short));
+ 		}
+         }
+@@ -469,7 +469,7 @@ int
+ XWDWrite(ras)
+ 	Raster	*ras;
+ {
+-	XColor		xcolors[256];		/* color palette in X dump */
++	XWDColor	xcolors[256];		/* color palette in X dump */
+ 	int		nb;
+ 	int		i;
+ 	unsigned long	swaptest = 1;
+@@ -519,7 +519,7 @@ XWDWrite(ras)
+ 
+ 	if (*(char *) &swaptest) {
+ 		for (i = 0; i < ras->ncolor; i++) {
+-			_swaplong((char *) &xcolors[i].pixel, sizeof(long));
++			_swaplong((char *) &xcolors[i].pixel, sizeof(xcolors[i].pixel));
+ 			_swapshort((char *) &xcolors[i].red, 3 * sizeof(short));
+ 		}
+         }
diff --git a/ncl.spec b/ncl.spec
index 712583c..93f06d3 100644
--- a/ncl.spec
+++ b/ncl.spec
@@ -1,6 +1,6 @@
 Name:           ncl
 Version:        6.0.0
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        NCAR Command Language and NCAR Graphics
 
 Group:          Applications/Engineering
@@ -31,6 +31,8 @@ Patch1:         ncarg-4.4.1-deps.patch
 Patch2:         ncl-5.1.0-ppc64.patch
 # Add needed -lm to ictrans build, remove unneeded -lidn -ldl from ncl
 Patch3:         ncl-5.2.0-libs.patch
+# Patch to fix xwd driver on 64-bit (bug 839707)
+Patch4:         ncl-xwd.patch
 Patch7:         ncl-5.0.0-atlas.patch
 # don't have the installation target depends on the build target since
 # for library it implies running ranlib and modifying the library timestamp
@@ -124,6 +126,7 @@ Example programs and data using NCL.
 %patch1 -p1 -b .deps
 %patch2 -p1 -b .ppc64
 %patch3 -p1 -b .libs
+%patch4 -p1 -b .xwd
 %patch7 -p1 -b .atlas
 %patch10 -p1 -b .no_install_dep
 %patch11 -p1 -b .build_n_scripts
@@ -339,6 +342,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Jul 13 2012 Orion Poplawski <orion at cora.nwra.com> - 6.0.0-5
+- Add patch to fix xwd driver on 64-bit (bug 839707)
+
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 6.0.0-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list