1 --- CoinUtils/src/CoinHelperFunctions.hpp
2 +++ CoinUtils/src/CoinHelperFunctions.hpp
6 template <class T> inline void
7 -CoinCopyN(register const T* from, const int size, register T* to)
8 +CoinCopyN(const T* from, const int size, T* to)
10 if (size == 0 || from == to)
16 - register int n = (size + 7) / 8;
17 + int n = (size + 7) / 8;
19 - register const T* downfrom = from + size;
20 - register T* downto = to + size;
21 + const T* downfrom = from + size;
22 + T* downto = to + size;
23 // Use Duff's device to copy
25 case 0: do{ *--downto = *--downfrom;
27 the difference down to int. -- lh, 100823 --
29 template <class T> inline void
30 -CoinCopy(register const T* first, register const T* last, register T* to)
31 +CoinCopy(const T* first, const T* last, T* to)
33 CoinCopyN(first, static_cast<int>(last-first), to);
36 Note JJF - the speed claim seems to be false on IA32 so I have added
37 CoinMemcpyN which can be used for atomic data */
38 template <class T> inline void
39 -CoinDisjointCopyN(register const T* from, const int size, register T* to)
40 +CoinDisjointCopyN(const T* from, const int size, T* to)
43 if (size == 0 || from == to)
45 throw CoinError("overlapping arrays", "CoinDisjointCopyN", "");
48 - for (register int n = size / 8; n > 0; --n, from += 8, to += 8) {
49 + for (int n = size / 8; n > 0; --n, from += 8, to += 8) {
54 are copied at a time. The source array is given by its first and "after
55 last" entry; the target array is given by its first entry. */
56 template <class T> inline void
57 -CoinDisjointCopy(register const T* first, register const T* last,
59 +CoinDisjointCopy(const T* first, const T* last,
62 CoinDisjointCopyN(first, static_cast<int>(last - first), to);
65 alternative coding if USE_MEMCPY defined*/
66 #ifndef COIN_USE_RESTRICT
67 template <class T> inline void
68 -CoinMemcpyN(register const T* from, const int size, register T* to)
69 +CoinMemcpyN(const T* from, const int size, T* to)
74 throw CoinError("overlapping arrays", "CoinMemcpyN", "");
77 - for (register int n = size / 8; n > 0; --n, from += 8, to += 8) {
78 + for (int n = size / 8; n > 0; --n, from += 8, to += 8) {
83 are copied at a time. The source array is given by its first and "after
84 last" entry; the target array is given by its first entry. */
85 template <class T> inline void
86 -CoinMemcpy(register const T* first, register const T* last,
88 +CoinMemcpy(const T* first, const T* last,
91 CoinMemcpyN(first, static_cast<int>(last - first), to);
94 Note JJF - the speed claim seems to be false on IA32 so I have added
95 CoinZero to allow for memset. */
96 template <class T> inline void
97 -CoinFillN(register T* to, const int size, register const T value)
98 +CoinFillN(T* to, const int size, const T value)
106 - for (register int n = size / 8; n > 0; --n, to += 8) {
107 + for (int n = size / 8; n > 0; --n, to += 8) {
112 entries are filled at a time. The array is given by its first and "after
114 template <class T> inline void
115 -CoinFill(register T* first, register T* last, const T value)
116 +CoinFill(T* first, T* last, const T value)
118 CoinFillN(first, last - first, value);
121 Note JJF - the speed claim seems to be false on IA32 so I have allowed
122 for memset as an alternative */
123 template <class T> inline void
124 -CoinZeroN(register T* to, const int size)
125 +CoinZeroN(T* to, const int size)
128 // Use memset - seems faster on Intel with gcc
133 - for (register int n = size / 8; n > 0; --n, to += 8) {
134 + for (int n = size / 8; n > 0; --n, to += 8) {
139 entries are filled at a time. The array is given by its first and "after
141 template <class T> inline void
142 -CoinZero(register T* first, register T* last)
143 +CoinZero(T* first, T* last)
145 CoinZeroN(first, last - first);
148 This function was introduced because for some reason compiler tend to
149 handle the <code>max()</code> function differently. */
150 template <class T> inline T
151 -CoinMax(register const T x1, register const T x2)
152 +CoinMax(const T x1, const T x2)
154 return (x1 > x2) ? x1 : x2;
157 This function was introduced because for some reason compiler tend to
158 handle the min() function differently. */
159 template <class T> inline T
160 -CoinMin(register const T x1, register const T x2)
161 +CoinMin(const T x1, const T x2)
163 return (x1 < x2) ? x1 : x2;
166 according to operator<. The array is given by a pointer to its first entry
168 template <class T> inline bool
169 -CoinIsSorted(register const T* first, const int size)
170 +CoinIsSorted(const T* first, const int size)
176 // size1 is the number of comparisons to be made
177 const int size1 = size - 1;
178 - for (register int n = size1 / 8; n > 0; --n, first += 8) {
179 + for (int n = size1 / 8; n > 0; --n, first += 8) {
180 if (first[8] < first[7]) return false;
181 if (first[7] < first[6]) return false;
182 if (first[6] < first[5]) return false;
184 according to operator<. The array is given by its first and "after
186 template <class T> inline bool
187 -CoinIsSorted(register const T* first, register const T* last)
188 +CoinIsSorted(const T* first, const T* last)
190 return CoinIsSorted(first, static_cast<int>(last - first));
193 etc. For speed 8 entries are filled at a time. The array is given by a
194 pointer to its first entry and its size. */
195 template <class T> inline void
196 -CoinIotaN(register T* first, const int size, register T init)
197 +CoinIotaN(T* first, const int size, T init)
202 throw CoinError("negative number of entries", "CoinIotaN", "");
205 - for (register int n = size / 8; n > 0; --n, first += 8, init += 8) {
206 + for (int n = size / 8; n > 0; --n, first += 8, init += 8) {
211 integer array specified by the last two arguments (again, first and "after
213 template <class T> inline T *
214 -CoinDeleteEntriesFromArray(register T * arrayFirst, register T * arrayLast,
215 +CoinDeleteEntriesFromArray(T * arrayFirst, T * arrayLast,
216 const int * firstDelPos, const int * lastDelPos)
218 int delNum = static_cast<int>(lastDelPos - firstDelPos);
219 --- CoinUtils/src/CoinModelUseful2.cpp
220 +++ CoinUtils/src/CoinModelUseful2.cpp
224 int nEof=0; // Number of time send of string
225 - register int yystate;
230 /* Number of tokens to shift before error messages enabled. */
232 @@ -936,12 +936,12 @@
233 /* The state stack. */
234 short yyssa[YYINITDEPTH];
236 - register short *yyssp;
239 /* The semantic value stack. */
240 YYSTYPE yyvsa[YYINITDEPTH];
241 YYSTYPE *yyvs = yyvsa;
242 - register YYSTYPE *yyvsp;
247 --- CoinUtils/src/CoinOslC.h
248 +++ CoinUtils/src/CoinOslC.h
253 -int c_ekkbtrn( register const EKKfactinfo *fact,
254 +int c_ekkbtrn( const EKKfactinfo *fact,
256 int * mpt,int first_nonzero);
257 -int c_ekkbtrn_ipivrw( register const EKKfactinfo *fact,
258 +int c_ekkbtrn_ipivrw( const EKKfactinfo *fact,
260 int * mpt, int ipivrw,int * spare);
262 -int c_ekketsj( register /*const*/ EKKfactinfo *fact,
263 +int c_ekketsj( /*const*/ EKKfactinfo *fact,
265 int *mpt2, double dalpha, int orig_nincol,
266 int npivot, int *nuspikp,
267 const int ipivrw, int * spare);
268 -int c_ekkftrn( register const EKKfactinfo *fact,
269 +int c_ekkftrn( const EKKfactinfo *fact,
271 double * dpermu,int * mpt, int numberNonZero);
273 -int c_ekkftrn_ft( register EKKfactinfo *fact,
274 +int c_ekkftrn_ft( EKKfactinfo *fact,
275 double *dwork1, int *mpt, int *nincolp);
276 -void c_ekkftrn2( register EKKfactinfo *fact, double *dwork1,
277 +void c_ekkftrn2( EKKfactinfo *fact, double *dwork1,
278 double * dpermu1,int * mpt1, int *nincolp,
279 double *dwork1_ft, int *mpt_ft, int *nincolp_ft);
281 -int c_ekklfct( register EKKfactinfo *fact);
282 -int c_ekkslcf( register const EKKfactinfo *fact);
283 +int c_ekklfct( EKKfactinfo *fact);
284 +int c_ekkslcf( const EKKfactinfo *fact);
285 inline void c_ekkscpy(int n, const int *marr1,int *marr2)
286 { CoinMemcpyN(marr1,n,marr2);}
287 inline void c_ekkdcpy(int n, const double *marr1,double *marr2)
288 --- CoinUtils/src/CoinOslFactorization2.cpp
289 +++ CoinUtils/src/CoinOslFactorization2.cpp
291 extern int ets_count;
292 extern int ets_check;
294 -#define COIN_REGISTER register
295 +#define COIN_REGISTER
296 #define COIN_REGISTER2
297 -#define COIN_REGISTER3 register
298 +#define COIN_REGISTER3
299 #ifdef COIN_USE_RESTRICT
300 # define COIN_RESTRICT2 __restrict
302 --- CoinUtils/src/CoinOslFactorization3.cpp
303 +++ CoinUtils/src/CoinOslFactorization3.cpp
304 @@ -1378,7 +1378,7 @@
308 -int c_ekklfct( register EKKfactinfo *fact)
309 +int c_ekklfct( EKKfactinfo *fact)
311 const int nrow = fact->nrow;
312 int ninbas = fact->xcsadr[nrow+1]-1;
313 @@ -2607,7 +2607,7 @@
317 -int c_ekkslcf( register const EKKfactinfo *fact)
318 +int c_ekkslcf( const EKKfactinfo *fact)
320 int * hrow = fact->xeradr;
321 int * hcol = fact->xecadr;
322 --- CoinUtils/src/CoinPackedVectorBase.cpp
323 +++ CoinUtils/src/CoinPackedVectorBase.cpp
326 CoinPackedVectorBase::oneNorm() const
328 - register double norm = 0.0;
329 - register const double* elements = getElements();
331 + const double* elements = getElements();
332 for (int i = getNumElements() - 1; i >= 0; --i) {
333 norm += fabs(elements[i]);
337 CoinPackedVectorBase::infNorm() const
339 - register double norm = 0.0;
340 - register const double* elements = getElements();
342 + const double* elements = getElements();
343 for (int i = getNumElements() - 1; i >= 0; --i) {
344 norm = CoinMax(norm, fabs(elements[i]));
346 --- CoinUtils/src/CoinSearchTree.hpp
347 +++ CoinUtils/src/CoinSearchTree.hpp
349 static inline const char* name() { return "CoinSearchTreeComparePreferred"; }
350 inline bool operator()(const CoinTreeSiblings* x,
351 const CoinTreeSiblings* y) const {
352 - register const CoinTreeNode* xNode = x->currentNode();
353 - register const CoinTreeNode* yNode = y->currentNode();
354 + const CoinTreeNode* xNode = x->currentNode();
355 + const CoinTreeNode* yNode = y->currentNode();
356 const BitVector128 xPref = xNode->getPreferred();
357 const BitVector128 yPref = yNode->getPreferred();
359 --- CoinUtils/src/CoinSimpFactorization.cpp
360 +++ CoinUtils/src/CoinSimpFactorization.cpp
361 @@ -2440,7 +2440,7 @@
362 const int row=secRowOfU_[i];
363 const int column=colOfU_[i];
364 if ( denseVector_[column]==0.0 ) continue;
365 - register const double multiplier=denseVector_[column]*invOfPivots_[row];
366 + const double multiplier=denseVector_[column]*invOfPivots_[row];
367 denseVector_[column]=0.0;
368 const int rowBeg=UrowStarts_[row];
369 const int rowEnd=rowBeg+UrowLengths_[row];