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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
|
#include "../machine.h"
typedef signed char integer1;
typedef short integer2;
/* Copyright INRIA */
#define TCONV(Xtype,Ytype) {\
Xtype *DX;\
Ytype *DY;\
DY=(Ytype *)dy;\
--DY;\
DX=(Xtype *)dx;\
--DX;\
if (*incx == 1 && *incy == 1) {\
for (i = 1; i <= i1; ++i) DY[i] = (Ytype) DX[i];\
}\
else {\
ix = 1;iy = 1;\
if (*incx < 0) {ix = (-i1 + 1) * (*incx) + 1;}\
if (*incy < 0) {iy = (-i1 + 1) * (*incy) + 1;}\
for (i = 1; i <= i1; ++i) {\
DY[iy] = (Ytype) DX[ix];\
ix += *incx;iy += *incy;\
}\
}\
}
int C2F(tpconv)(xtyp, ytyp, n, dx, incx, dy, incy)
integer *n;
integer *incx;
integer *incy;
integer *xtyp, *ytyp;
void *dx;
void *dy;
{
integer i1;
static integer i, ix, iy;
i1 = *n;
if (i1 <= 0) return 0;
switch (*xtyp) {
case 0:
switch (*ytyp) {
case 0:
TCONV(double,double);
break;
case 1:
TCONV(double,integer1);
break;
case 2:
TCONV(double,integer2);
break;
case 4:
TCONV(double,integer);
break;
case 11:
TCONV(double,unsigned char);
break;
case 12:
TCONV(double,unsigned short);
break;
case 14:
TCONV(double,unsigned int);
break;
}
break;
case 1:
switch (*ytyp) {
case 0:
TCONV(integer1,double);
break;
case 1:
TCONV(integer1,integer1);
break;
case 2:
TCONV(integer1,integer2);
break;
case 4:
TCONV(integer1,integer);
break;
case 11:
TCONV(integer1,unsigned char);
break;
case 12:
TCONV(integer1,unsigned short);
break;
case 14:
TCONV(integer1,unsigned int);
break;
}
break;
case 2:
switch (*ytyp) {
case 0:
TCONV(integer2,double);
break;
case 1:
TCONV(integer2,integer1);
break;
case 2:
TCONV(integer2,integer2);
break;
case 4:
TCONV(integer2,integer);
break;
case 11:
TCONV(integer2,unsigned char);
break;
case 12:
TCONV(integer2,unsigned short);
break;
case 14:
TCONV(integer2,unsigned int);
break;
}
break;
case 4:
switch (*ytyp) {
case 0:
TCONV(integer,double);
break;
case 1:
TCONV(integer,integer1);
break;
case 2:
TCONV(integer,integer2);
break;
case 4:
TCONV(integer,integer);
break;
case 11:
TCONV(integer,unsigned char);
break;
case 12:
TCONV(integer,unsigned short);
break;
case 14:
TCONV(integer,unsigned int);
break;
}
break;
case 11:
switch (*ytyp) {
case 0:
TCONV(unsigned char,double);
break;
case 1:
TCONV(unsigned char,integer1);
break;
case 2:
TCONV(unsigned char,integer2);
break;
case 4:
TCONV(unsigned char,integer);
break;
case 11:
TCONV(unsigned char,unsigned char);
break;
case 12:
TCONV(unsigned char,unsigned short);
break;
case 14:
TCONV(unsigned char,unsigned int);
break;
}
break;
case 12:
switch (*ytyp) {
case 0:
TCONV(unsigned short,double);
break;
case 1:
TCONV(unsigned short,integer1);
break;
case 2:
TCONV(unsigned short,integer2);
break;
case 4:
TCONV(unsigned short,integer);
break;
case 11:
TCONV(unsigned short,unsigned char);
break;
case 12:
TCONV(unsigned short,unsigned short);
break;
case 14:
TCONV(unsigned short,unsigned int);
break;
}
break;
case 14:
switch (*ytyp) {
case 0:
TCONV(unsigned int,double);
break;
case 1:
TCONV(unsigned int,integer1);
break;
case 2:
TCONV(unsigned int,integer2);
break;
case 4:
TCONV(unsigned int,integer);
break;
case 11:
TCONV(unsigned int,unsigned char);
break;
case 12:
TCONV(unsigned int,unsigned short);
break;
case 14:
TCONV(unsigned int,unsigned int);
break;
}
break;
}
return 0;
}
|