summaryrefslogtreecommitdiff
path: root/sci-chemistry/azara/files/2.8-64bit.patch
blob: c65e075c1d30cf046d4050d4f44966edaa4f0c29 (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
diff --git a/global/par.c b/global/par.c
index ac87c88..fecfe35 100644
--- a/global/par.c
+++ b/global/par.c
@@ -562,9 +562,9 @@ static Status get_varian_header(FILE *fp, String error_msg)
     return  OK;
 }
 
-static long get_varian_long(int offset)
+static int get_varian_int(int offset)
 {
-    long x;
+    int x;
 
     if (swapped)
     {
@@ -572,7 +572,7 @@ static long get_varian_long(int offset)
 	SWAP(varian_header[offset+1], varian_header[offset+2], char);
     }
 
-    x = *((long *) (varian_header + offset));
+    x = *((int *) (varian_header + offset));
 
     return  x;
 }
@@ -591,7 +591,7 @@ static short get_varian_short(int offset)
 
 static Status check_varian_header(String error_msg)
 {
-    long nblocks, ntraces, np, ebytes, tbytes, /*bbytes,*/ d;
+    int nblocks, ntraces, np, ebytes, tbytes, /*bbytes,*/ d;
     short status;
     FILE *fp;
 
@@ -605,17 +605,19 @@ static Status check_varian_header(String error_msg)
     FCLOSE(fp);
 
     /* numbers in parentheses are offsets into header */
-    nblocks = get_varian_long(0);   /* number of blocks in file */
-    ntraces = get_varian_long(4);   /* number of traces per block */
-    np = get_varian_long(8);	    /* number of elements per trace */
-    ebytes = get_varian_long(12);   /* number of bytes per element */
-    tbytes = get_varian_long(16);   /* number of bytes per trace */
-    /*bbytes = get_varian_long(20);*/   /* number of bytes per block */
+    nblocks = get_varian_int(0);   /* number of blocks in file */
+    printf("nblocks = %d\n", nblocks);
+    ntraces = get_varian_int(4);   /* number of traces per block */
+    printf("ntraces = %d\n", ntraces);
+    np = get_varian_int(8);	    /* number of elements per trace */
+    ebytes = get_varian_int(12);   /* number of bytes per element */
+    tbytes = get_varian_int(16);   /* number of bytes per trace */
+    /*bbytes = get_varian_int(20);*/   /* number of bytes per block */
 	    /* short starting at 24 is software version */
     status = get_varian_short(26);  /* status of whole file */
 	    /* long starting at 28 is number of block headers */
 
-    if (ntraces != 1L)
+    if (ntraces != 1)
 	RETURN_ERROR_MSG("can only process Varian data with #traces = 1");
 
     if (np != npoints[0])
@@ -646,12 +648,12 @@ static Status check_varian_header(String error_msg)
 
     if (integer)
     {
-	if (ebytes == 2L)
+	if (ebytes == 2)
 	{
 	    if (status & (1<<2))
 		RETURN_ERROR_MSG("Varian header has inconsistent byte information");
 	}
-	else if (ebytes == 4L)
+	else if (ebytes == 4)
 	{
 	    if (!(status & (1<<2)))
 		RETURN_ERROR_MSG("Varian header has inconsistent byte information");
@@ -666,7 +668,7 @@ static Status check_varian_header(String error_msg)
     }
     else /* !integer, i.e. floating point */
     {
-	if (ebytes != 4L)
+	if (ebytes != 4)
 	    RETURN_ERROR_MSG("Varian header has inconsistent byte information");
     }