Update to 2.0.0 tree from current Fremantle build
[opencv] / 3rdparty / lapack / s_copy.c
1 /* Unless compiled with -DNO_OVERWRITE, this variant of s_copy allows the
2  * target of an assignment to appear on its right-hand side (contrary
3  * to the Fortran 77 Standard, but in accordance with Fortran 90),
4  * as in  a(2:5) = a(4:7) .
5  */
6
7 #include "clapack.h"
8
9 /* assign strings:  a = b */
10
11 void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb)
12 {
13         register char *aend, *bend;
14
15         aend = a + la;
16
17         if(la <= lb)
18                 if (a <= b || a >= b + la)
19                         while(a < aend)
20                                 *a++ = *b++;
21                 else
22                         for(b += la; a < aend; )
23                                 *--aend = *--b;
24         else {
25                 bend = b + lb;
26                 if (a <= b || a >= bend)
27                         while(b < bend)
28                                 *a++ = *b++;
29                 else {
30                         a += lb;
31                         while(b < bend)
32                                 *--a = *--bend;
33                         a += lb;
34                         }
35                 while(a < aend)
36                         *a++ = ' ';
37         }
38 }