Gentoo Archives: gentoo-commits

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-libs/mmdb/files: 1.21-allignment.patch
Date: Wed, 30 Jun 2010 20:55:08
Message-Id: 20100630205504.BE3542C3ED@corvid.gentoo.org
1 jlec 10/06/30 20:55:04
2
3 Added: 1.21-allignment.patch
4 Log:
5 Fixed broken allignment, #315387
6 (Portage version: 2.2_rc67/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 sci-libs/mmdb/files/1.21-allignment.patch
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/mmdb/files/1.21-allignment.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/mmdb/files/1.21-allignment.patch?rev=1.1&content-type=text/plain
13
14 Index: 1.21-allignment.patch
15 ===================================================================
16 diff --git a/src/file_.cpp b/src/file_.cpp
17 index 4071886..6bfa648 100644
18 --- a/src/file_.cpp
19 +++ b/src/file_.cpp
20 @@ -347,10 +347,10 @@ int i;
21 if (i>0) sleep ( 1 );
22 #endif
23 if (TextMode) {
24 - if (ReadOnly) hFile = fopen ( FName,"r" );
25 + if (ReadOnly) hFile = fopen ( FName,"rt" );
26 else hFile = fopen ( FName,"r+t" );
27 } else {
28 - if (ReadOnly) hFile = fopen ( FName,"r" );
29 + if (ReadOnly) hFile = fopen ( FName,"rb" );
30 else hFile = fopen ( FName,"r+b" );
31 }
32 #ifndef _MVS
33 diff --git a/src/machine_.h b/src/machine_.h
34 old mode 100644
35 new mode 100755
36 index 2e81264..c658981
37 --- a/src/machine_.h
38 +++ b/src/machine_.h
39 @@ -1,4 +1,4 @@
40 -// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
41 +// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
42 // =================================================================
43 //
44 // CCP4 Coordinate Library: support of coordinate-related
45 @@ -127,8 +127,12 @@
46 # define CALL_LIKE_VMS 1
47
48 // MVS stands for Microsoft Visual Studio
49 -#elif defined(_MVS)
50 +#elif defined(_MSC_VER)
51 +# if (_MSC_VER) >= 800
52 +# define CALL_LIKE_MVS 2
53 +# else
54 # define CALL_LIKE_MVS 1
55 +# endif
56
57 #elif defined(F2C) || defined(G77)
58 # define CALL_LIKE_SUN 8
59 @@ -400,6 +404,36 @@ typedef double apireal; // FORTRAN real*8
60
61 #elif defined(CALL_LIKE_MVS)
62
63 +# if ( CALL_LIKE_MVS == 2 )
64 +
65 + typedef pstr fpstr;
66 +
67 +# define FTN_STR(s) s
68 +# define FTN_LEN(s) s##_len
69 +
70 +# define char_struct(s) \
71 + pstr s; \
72 + int s##_len;
73 +# define fill_char_struct(s,str) \
74 + s = str; \
75 + s##_len = strlen(str);
76 +
77 +# ifdef __cplusplus
78 +# define FORTRAN_SUBR(NAME,name,p_sun,p_stardent,p_mvs) \
79 + extern "C" void NAME p_sun
80 +# else
81 +# define FORTRAN_SUBR(NAME,name,p_sun,p_stardent,p_mvs) \
82 + void NAME p_sun
83 +# endif
84 +
85 +# define FORTRAN_EXTERN(NAME,name,p_sun,p_stardent,p_mvs) \
86 + extern "C" void NAME p_sun
87 +
88 +# define FORTRAN_CALL(NAME,name,p_sun,p_stardent,p_mvs) \
89 + NAME p_sun
90 +
91 +# else
92 +
93 typedef pstr fpstr;
94
95 # define FTN_STR(s) s
96 @@ -425,7 +459,7 @@ typedef double apireal; // FORTRAN real*8
97
98 # define FORTRAN_CALL(NAME,name,p_sun,p_stardent,p_mvs) \
99 NAME p_mvs
100 -
101 +# endif
102 #else
103
104 # error Unknown machine!!!
105 diff --git a/src/mmdb_atom.h b/src/mmdb_atom.h
106 old mode 100644
107 new mode 100755
108 index 45049c8..672e11a
109 --- a/src/mmdb_atom.h
110 +++ b/src/mmdb_atom.h
111 @@ -1,4 +1,4 @@
112 -// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
113 +// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
114 // =================================================================
115 //
116 // CCP4 Coordinate Library: support of coordinate-related
117 @@ -290,7 +290,7 @@ class CAtom : public CUDData {
118 void CalcAtomStatistics ( RSAtomStat AS );
119 realtype GetDist2 ( PCAtom a );
120 realtype GetDist2 ( PCAtom a, mat44 & tm ); // tm applies to A
121 - realtype GetDist2 ( PCAtom a, mat33 & r, vect3 & t );// tm applies to A
122 + realtype GetDist2 ( PCAtom a, mat33 & r, vect3 & t ); // tm applies to A
123 realtype GetDist2 ( realtype ax, realtype ay, realtype az );
124
125 // GetCosine(a1,a2) calculates cosine of angle a1-this-a2,
126 diff --git a/src/mmdb_chain.cpp b/src/mmdb_chain.cpp
127 old mode 100644
128 new mode 100755
129 index a6f66c2..1fa165b
130 --- a/src/mmdb_chain.cpp
131 +++ b/src/mmdb_chain.cpp
132 @@ -1,4 +1,4 @@
133 -// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
134 +// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
135 // =================================================================
136 //
137 // CCP4 Coordinate Library: support of coordinate-related
138 @@ -672,7 +672,8 @@ int i,k,sN;
139 i = 0;
140 sN = 1;
141 while (i<numRes) {
142 - PutInteger ( &(S[8]),sN,2 );
143 + //PutInteger ( &(S[8]),sN,2 );
144 + PutInteger ( &(S[7]),sN,3 );
145 k = 19;
146 while ((i<numRes) && (k<70)) {
147 if (resName[i][0])
148 diff --git a/src/mmdb_rwbrook.cpp b/src/mmdb_rwbrook.cpp
149 old mode 100644
150 new mode 100755
151 index dc33086..ef58641
152 --- a/src/mmdb_rwbrook.cpp
153 +++ b/src/mmdb_rwbrook.cpp
154 @@ -1,4 +1,4 @@
155 -// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
156 +// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
157 // =================================================================
158 //
159 // CCP4 Coordinate Library: support of coordinate-related
160 @@ -1478,7 +1478,6 @@ AltLoc altLoc;
161 SegID sgID;
162 Element element;
163 PCAtom atom;
164 -pstr p;
165 char charge[10];
166
167 strcpy ( LastFunc,"MMDB_F_Atom" );
168 @@ -1552,10 +1551,9 @@ char charge[10];
169 } else
170 charge [0] = char(0);
171
172 -/*
173 if (FTN_STR(ID)[0]==' ') {
174 atomName[0] = char(0);
175 - if ((FTN_STR(AtNam)[1]=='H') ||
176 + if ((FTN_STR(AtNam)[1]=='H') && (FTN_STR(AtNam)[0]!='H') ||
177 ((FTN_STR(AtNam)[1]=='D') && (FTN_STR(ID)[2]=='D'))) {
178 i = 0;
179 while ((i<nHydAtomNames) &&
180 @@ -1563,12 +1561,16 @@ char charge[10];
181 if (i<nHydAtomNames)
182 GetStrTer ( atomName,FTN_STR(AtNam),4,5,FTN_LEN(AtNam) );
183 }
184 - if (!atomName[0]) {
185 +
186 + if ((FTN_STR(AtNam)[0]=='A') || ((FTN_STR(AtNam)[0]=='N') && (FTN_STR(ID)[1]!='N'))) {
187 + GetStrTer ( atomName,FTN_STR(AtNam),4,5,FTN_LEN(AtNam) );
188 + } else if ((FTN_STR(ID)[1]=='N') && ( (FTN_STR(AtNam)[0]=='N') && (FTN_STR(AtNam)[1]=='N') )) {
189 + GetStrTer ( atomName,FTN_STR(AtNam),4,5,FTN_LEN(AtNam) );
190 + } else if (!atomName[0]) {
191 atomName[0] = ' ';
192 GetStrTer ( &(atomName[1]),FTN_STR(AtNam),3,4,FTN_LEN(AtNam) );
193 }
194 } else
195 -*/
196 GetStrTer ( atomName,FTN_STR(AtNam),4,5,4 );
197
198
199 diff --git a/src/mmdb_sbase0.cpp b/src/mmdb_sbase0.cpp
200 old mode 100644
201 new mode 100755
202 index a210d62..3bf0d52
203 --- a/src/mmdb_sbase0.cpp
204 +++ b/src/mmdb_sbase0.cpp
205 @@ -1,4 +1,4 @@
206 -// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
207 +// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
208 // =================================================================
209 //
210 // CCP4 Coordinate Library: support of coordinate-related
211 @@ -1320,7 +1320,11 @@ PPCSBIndex Index1;
212 dirpath = new char[i+10];
213 strcpy ( dirpath,path );
214 if (i>0) {
215 +#if defined(_MSC_VER) || defined (WIN32)
216 + if (dirpath[i-1]!='\\') strcat ( dirpath,"\\" );
217 +#else
218 if (dirpath[i-1]!='/') strcat ( dirpath,"/" );
219 +#endif
220 }
221 }
222
223 diff --git a/src/mmdb_selmngr.cpp b/src/mmdb_selmngr.cpp
224 old mode 100644
225 new mode 100755
226 index b923529..3a9e249
227 --- a/src/mmdb_selmngr.cpp
228 +++ b/src/mmdb_selmngr.cpp
229 @@ -1,4 +1,4 @@
230 -// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
231 +// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
232 // =================================================================
233 //
234 // CCP4 Coordinate Library: support of coordinate-related
235 @@ -1158,7 +1158,7 @@ void CMMDBSelManager::Select (
236 int selKey // selection key
237 ) {
238 int i,j,k,n,m1,m2,c, sk,nsel;
239 -Boolean noRes,modelSel,chainSel,resSel,selAND;
240 +Boolean noRes,modelSel(False),chainSel,resSel,selAND;
241 PCModel model;
242 PCChain chain;
243 PCResidue res;
244 diff --git a/src/mmdb_title.cpp b/src/mmdb_title.cpp
245 old mode 100644
246 new mode 100755
247 index b0b2ae5..1033ae5
248 --- a/src/mmdb_title.cpp
249 +++ b/src/mmdb_title.cpp
250 @@ -1,4 +1,4 @@
251 -// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
252 +// $Id: 1.21-allignment.patch,v 1.1 2010/06/30 20:55:04 jlec Exp $
253 // =================================================================
254 //
255 // CCP4 Coordinate Library: support of coordinate-related
256 @@ -1381,6 +1381,10 @@ MakeStreamFunctions(CRemark)
257 #define R350_CHAINS 2
258 #define R350_BIOMT 3
259
260 +#ifdef _WIN32
261 +#define strcasestr(s, t) strstr(strupr(s), t)
262 +#endif
263 +
264 void getRemarkKey ( RPCRemark rem, int & lkey ) {
265 if (rem) {
266 if (rem->remarkNum!=350) lkey = R350_END;
267 @@ -1458,7 +1462,7 @@ int l,lkey,nAdd,j;
268
269 while ((i<l) && (lkey==R350_NONE)) {
270
271 - p = strcasestr ( rem->Remark,"CHAINS:" );
272 + p = strcasestr( rem->Remark,"CHAINS:" );
273 if (p) p += 7;
274 else {
275 p = rem->Remark;
276 @@ -1513,7 +1517,7 @@ pstr p1,p2;
277 int l,j,lkey;
278
279 sprintf ( PN,"BIOMT%1i",biomtNo );
280 - p1 = strcasestr ( rem->Remark,PN );
281 + p1 = strcasestr( rem->Remark,PN );
282 if (!p1) return R350_ERRBIOMT;
283
284 p1 += 6;
285 @@ -1972,7 +1976,7 @@ int i,l;
286 if (rem) {
287 if (rem->remarkNum==2) {
288 if (rem->Remark) {
289 - p = strcasestr ( rem->Remark,"RESOLUTION" );
290 + p = strcasestr( rem->Remark,"RESOLUTION" );
291 if (p) {
292 while ((*p) && (*p!=' ')) p++;
293 if (*p) {