summaryrefslogtreecommitdiff
path: root/misc/molden/patches/patch-ab
blob: c91c435aea057b770bbd9c721a246d4a3d911116 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
$NetBSD: patch-ab,v 1.2 2015/03/21 19:27:56 joerg Exp $

--- xwin.c.orig	2008-08-30 11:59:22.000000000 +0000
+++ xwin.c
@@ -20,10 +20,6 @@
 #include <GL/gl.h>
 #include <GL/glu.h>
 #endif
-#if defined(DARWIN) || defined(FREEBSD)
-#else
-#include <malloc.h>
-#endif
 #endif
 
 #include <stdio.h>
@@ -3360,7 +3356,7 @@ static int *ispoptm;
 static int *icopth;
 static int *icoptl;
 static int *icoptm;
-static int linkat = 0;
+static int my_linkat = 0;
 
 static QBOXSTRU IANZboxes[MAXAT];
 static QBOXSTRU IZboxes[MAXAT][4];
@@ -17466,7 +17462,7 @@ int i;
 		if (ioniom == 1) {
 		  int ism, isl;
 
-		  linkat = 0;
+		  my_linkat = 0;
 
 		  /* Counting the number of Link atoms between H and lower 
 		     levels*/
@@ -17479,10 +17475,10 @@ int i;
 		     if (ionij != 0) continue;
 		     nconn = xyz.iconn[j*(MXCON+1)];
 		     for (k=1;k<=nconn;k++) {
-		       if (xyz.ityp[xyz.iconn[j*(MXCON+1)+k]-1]/10000 > 0) linkat++;
+		       if (xyz.ityp[xyz.iconn[j*(MXCON+1)+k]-1]/10000 > 0) my_linkat++;
 		     }
 		  }
-		  linkat += 20000;
+		  my_linkat += 20000;
 		  *itotc = *icopth;
 		  *imult = *ispopth;
 		  if (CheckChargeMult()) {
@@ -17503,7 +17499,7 @@ int i;
 
 		}  else if (ioniom == 2) {
 
-	          linkat = 0;
+	          my_linkat = 0;
 
 		  /* Counting the number of Link atoms between H and 
 		       lower levels*/
@@ -17513,10 +17509,10 @@ int i;
 			 if(ionij != 0) continue;
 		         nconn = xyz.iconn[j*(MXCON+1)];
 		         for (k=1;k<=nconn;k++) {
-		           if (xyz.ityp[xyz.iconn[j*(MXCON+1)+k]-1]/10000 > 0) linkat++;
+		           if (xyz.ityp[xyz.iconn[j*(MXCON+1)+k]-1]/10000 > 0) my_linkat++;
 		         }
 		  }
-		  linkat += 20000;
+		  my_linkat += 20000;
 		  *itotc = *icopth;
 		  *imult = *ispopth;
 		  if (CheckChargeMult()) {
@@ -17528,7 +17524,7 @@ int i;
 	               break;
 */
 		  }
-	          linkat = 0;
+	          my_linkat = 0;
 
 		  /* Counting the number of Link atoms between H+M and 
 		     lower levels*/
@@ -17538,10 +17534,10 @@ int i;
 			if (ionij == 2) continue;
 			nconn = xyz.iconn[j*(MXCON+1)];
 			for (k=1;k<=nconn;k++) {
-			   if (xyz.ityp[xyz.iconn[j*(MXCON+1)+k]-1]/10000 == 2) linkat++;
+			   if (xyz.ityp[xyz.iconn[j*(MXCON+1)+k]-1]/10000 == 2) my_linkat++;
 			}
 		  }
-		  linkat += 20000;
+		  my_linkat += 20000;
 		  *itotc = *icoptm;
 		  *imult = *ispoptm;
 		  if (CheckChargeMult()) {
@@ -17556,7 +17552,7 @@ int i;
 		  icopt = *icoptl+3;
 		  ispopt = *ispoptl-1;
 		}
-		linkat = 0;
+		my_linkat = 0;
 		*itotc = icopt - 3;
 		*imult = ispopt + 1;
 		*ito = itopt[jmode] + 1;
@@ -17808,10 +17804,10 @@ int CheckChargeMult()
    ionil = 0;
 
    if (ioniom) {
-     ionil = 3 - (linkat / 10000);
-     linkat -= (linkat / 10000) * 10000;
+     ionil = 3 - (my_linkat / 10000);
+     my_linkat -= (my_linkat / 10000) * 10000;
    } else {
-     linkat = 0;
+     my_linkat = 0;
    }
 
    if (*zmptr.ihaszm) {
@@ -17834,10 +17830,10 @@ int CheckChargeMult()
       }
    }
 /*
-   fprintf(stderr,"ionil %d ne %d itotc %d linkat %d mult %d\n",
-                   ionil,ne,*itotc,linkat,*imult);
+   fprintf(stderr,"ionil %d ne %d itotc %d my_linkat %d mult %d\n",
+                   ionil,ne,*itotc,my_linkat,*imult);
 */
-   ne = ne - *itotc + linkat;
+   ne = ne - *itotc + my_linkat;
    if (ne % 2 == *imult % 2) return(1);
    return(0);
 }