-
Notifications
You must be signed in to change notification settings - Fork 0
/
ncl-xwd.patch
50 lines (47 loc) · 1.86 KB
/
ncl-xwd.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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));
}
}