Changeset 21508 for trunk/Ohana/src/libautocode/generate
- Timestamp:
- Feb 16, 2009, 11:33:52 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libautocode/generate (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libautocode/generate
r7080 r21508 114 114 115 115 # rawshort is a short without byteswapping 116 # rawshort is a patch for old photreg tables 116 117 117 118 $pt1 = 0; … … 124 125 if ($type eq "int") { $pt1 = "J"; } 125 126 if ($type eq "unsigned int") { $pt1 = "J"; } 126 if ($type eq "e_time") { $pt1 = "J"; } 127 128 if ($type eq "int8_t") { $pt1 = "B"; } 129 if ($type eq "uint8_t") { $pt1 = "B"; } 130 if ($type eq "int16_t") { $pt1 = "I"; } 131 if ($type eq "uint16_t") { $pt1 = "I"; } 132 if ($type eq "int32_t") { $pt1 = "J"; } 133 if ($type eq "uint32_t") { $pt1 = "J"; } 134 135 # FITS tables do not allow for 64bit integers. we need to 136 # write these by splitting the value into high and low 32 bit values 137 if ($type eq "int64_t") { $pt1 = "J"; $Np = 2*$Np; } 138 if ($type eq "uint64_t") { $pt1 = "J"; $Np = 2*$Np; } 139 127 140 if ($type eq "float") { $pt1 = "E"; } 128 141 if ($type eq "double") { $pt1 = "D"; } 129 142 143 # special 'elixir' types: 144 if ($type eq "e_time") { $pt1 = "J"; } 130 145 if ($type eq "e_void") { $pt1 = "B"; $Np = 8*$Np; } 131 146 # e_void is a 64 bit pointer, cast to size_t. its value is not loaded … … 146 161 printf FILE "%-20s 1.0, 0.0);\n", "\"$unit[$i]\", "; 147 162 } 148 149 163 } 150 164 … … 217 231 if ($type eq "int") { $pt1 = sprintf "I%s", $length; } 218 232 if ($type eq "unsigned int") { $pt1 = sprintf "I%s", $length; } 219 if ($type eq "e_time") { $pt1 = sprintf "I%s", $length; } 233 234 if ($type eq "int8_t") { $pt1 = sprintf "I%s", $length; } 235 if ($type eq "uint8_t") { $pt1 = sprintf "I%s", $length; } 236 if ($type eq "int16_t") { $pt1 = sprintf "I%s", $length; } 237 if ($type eq "uint16_t") { $pt1 = sprintf "I%s", $length; } 238 if ($type eq "int32_t") { $pt1 = sprintf "I%s", $length; } 239 if ($type eq "uint32_t") { $pt1 = sprintf "I%s", $length; } 240 241 # FITS tables do not allow for 64bit integers. we need to 242 # write these by splitting the value into high and low 32 bit values 243 if ($type eq "int64_t") { $pt1 = sprintf "I%s", $length; } 244 if ($type eq "uint64_t") { $pt1 = sprintf "I%s", $length; } 245 220 246 if ($type eq "float") { $pt1 = sprintf "F%s", $length; } 221 247 if ($type eq "double") { $pt1 = sprintf "F%s", $length; } 222 248 249 # special 'elixir' types: 250 if ($type eq "e_time") { $pt1 = sprintf "I%s", $length; } 223 251 if ($type eq "e_void") { $pt1 = sprintf "I%s", $length; } 224 252 … … 283 311 if ($type eq "unsigned char") { $N += $Np; next; } 284 312 if ($type eq "rawshort") { $N += 2*$Np; next; } 313 285 314 if ($type eq "short") { $T = "BYTE"; $n = 2; } 286 315 if ($type eq "unsigned short"){ $T = "BYTE"; $n = 2; } 287 316 if ($type eq "int") { $T = "WORD"; $n = 4; } 288 317 if ($type eq "unsigned int") { $T = "WORD"; $n = 4; } 318 319 if ($type eq "int8_t") { $N += $Np; next; } 320 if ($type eq "uint8_t") { $N += $Np; next; } 321 if ($type eq "int16_t") { $T = "BYTE"; $n = 2; } 322 if ($type eq "uint16_t") { $T = "BYTE"; $n = 2; } 323 if ($type eq "int32_t") { $T = "WORD"; $n = 4; } 324 if ($type eq "uint32_t") { $T = "WORD"; $n = 4; } 325 326 # FITS tables do not allow for 64bit integers. we need to 327 # write these by splitting the value into high and low 32 bit values 328 if ($type eq "int64_t") { $T = "WORD"; $n = 4; $Np = 2*$Np; } 329 if ($type eq "uint64_t") { $T = "WORD"; $n = 4; $Np = 2*$Np; } 330 331 if ($type eq "float") { $T = "WORD"; $n = 4; } 332 if ($type eq "double") { $T = "DBLE"; $n = 8; } 333 334 # special 'elixir' types: 289 335 if ($type eq "e_time") { $T = "WORD"; $n = 4; } 290 336 if ($type eq "e_void") { $T = "DBLE"; $n = 8; } 291 if ($type eq "float") { $T = "WORD"; $n = 4; } 292 if ($type eq "double") { $T = "DBLE"; $n = 8; } 337 293 338 if (!$n) { die "unknown type $type"; } 294 339 for ($j = 0; $j < $Np; $j++) { … … 318 363 if ($type eq "int") { $Nbytes += 4*$Np; $valid = 1; } 319 364 if ($type eq "unsigned int") { $Nbytes += 4*$Np; $valid = 1; } 365 366 if ($type eq "int8_t") { $Nbytes += 1*$Np; $valid = 1; } 367 if ($type eq "uint8_t") { $Nbytes += 1*$Np; $valid = 1; } 368 if ($type eq "int16_t") { $Nbytes += 2*$Np; $valid = 1; } 369 if ($type eq "uint16_t") { $Nbytes += 2*$Np; $valid = 1; } 370 if ($type eq "int32_t") { $Nbytes += 4*$Np; $valid = 1; } 371 if ($type eq "uint32_t") { $Nbytes += 4*$Np; $valid = 1; } 372 373 # FITS tables do not allow for 64bit integers. we need to 374 # write these by splitting the value into high and low 32 bit values 375 if ($type eq "int64_t") { $Nbytes += 8*$Np; $valid = 1; } 376 if ($type eq "uint64_t") { $Nbytes += 8*$Np; $valid = 1; } 377 378 if ($type eq "float") { $Nbytes += 4*$Np; $valid = 1; } 379 if ($type eq "double") { $Nbytes += 8*$Np; $valid = 1; } 380 381 # special 'elixir' types: 320 382 if ($type eq "e_time") { $Nbytes += 4*$Np; $valid = 1; } 321 383 if ($type eq "e_void") { $Nbytes += 8*$Np; $valid = 1; } 322 if ($type eq "float") { $Nbytes += 4*$Np; $valid = 1; }323 if ($type eq "double") { $Nbytes += 8*$Np; $valid = 1; }324 384 if (!$valid) { die "unknown type $type"; } 325 385 }
Note:
See TracChangeset
for help on using the changeset viewer.
