annotate ext/clapack/src/s_copy.c @ 209:ccd2019190bf msvc

Some MSVC fixes, including (temporarily, probably) renaming the FFT source file to avoid getting it mixed up with the Vamp SDK one in our object dir
author Chris Cannam
date Thu, 01 Feb 2018 16:34:08 +0000
parents 45330e0d2819
children
rev   line source
Chris@202 1 /* Unless compiled with -DNO_OVERWRITE, this variant of s_copy allows the
Chris@202 2 * target of an assignment to appear on its right-hand side (contrary
Chris@202 3 * to the Fortran 77 Standard, but in accordance with Fortran 90),
Chris@202 4 * as in a(2:5) = a(4:7) .
Chris@202 5 */
Chris@202 6
Chris@202 7 #include "f2c.h"
Chris@202 8 #ifdef __cplusplus
Chris@202 9 extern "C" {
Chris@202 10 #endif
Chris@202 11
Chris@202 12 /* assign strings: a = b */
Chris@202 13
Chris@202 14 #ifdef KR_headers
Chris@202 15 VOID s_copy(a, b, la, lb) register char *a, *b; ftnlen la, lb;
Chris@202 16 #else
Chris@202 17 void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb)
Chris@202 18 #endif
Chris@202 19 {
Chris@202 20 register char *aend, *bend;
Chris@202 21
Chris@202 22 aend = a + la;
Chris@202 23
Chris@202 24 if(la <= lb)
Chris@202 25 #ifndef NO_OVERWRITE
Chris@202 26 if (a <= b || a >= b + la)
Chris@202 27 #endif
Chris@202 28 while(a < aend)
Chris@202 29 *a++ = *b++;
Chris@202 30 #ifndef NO_OVERWRITE
Chris@202 31 else
Chris@202 32 for(b += la; a < aend; )
Chris@202 33 *--aend = *--b;
Chris@202 34 #endif
Chris@202 35
Chris@202 36 else {
Chris@202 37 bend = b + lb;
Chris@202 38 #ifndef NO_OVERWRITE
Chris@202 39 if (a <= b || a >= bend)
Chris@202 40 #endif
Chris@202 41 while(b < bend)
Chris@202 42 *a++ = *b++;
Chris@202 43 #ifndef NO_OVERWRITE
Chris@202 44 else {
Chris@202 45 a += lb;
Chris@202 46 while(b < bend)
Chris@202 47 *--a = *--bend;
Chris@202 48 a += lb;
Chris@202 49 }
Chris@202 50 #endif
Chris@202 51 while(a < aend)
Chris@202 52 *a++ = ' ';
Chris@202 53 }
Chris@202 54 }
Chris@202 55 #ifdef __cplusplus
Chris@202 56 }
Chris@202 57 #endif