- Timestamp:
- Jun 4, 2015, 5:42:47 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20150429/src/libfits/table/F_set_column.c
r38329 r38366 175 175 176 176 /***********************/ 177 int gfits_set_bintable_column_reformat (Header *header, FTable *table, char *label, char *intype, void *data, off_t Nrow) { 177 // convert the input data array (of the specified intype) to the desired table data type. swap unless nativeOrder is requested 178 int gfits_set_bintable_column_reformat (Header *header, FTable *table, char *label, char *intype, void *data, off_t Nrow, char nativeOrder) { 178 179 179 180 off_t Nx, Ny; … … 256 257 *(short *)Pout = (*(char *)Pin - Bzero) / Bscale; 257 258 # ifdef BYTE_SWAP 258 SWAP_BYTE;259 if (!nativeOrder) { SWAP_BYTE; } 259 260 # endif 260 261 } … … 265 266 *(int *)Pout = (*(char *)Pin - Bzero) / Bscale; 266 267 # ifdef BYTE_SWAP 267 SWAP_WORD;268 if (!nativeOrder) { SWAP_WORD; } 268 269 # endif 269 270 } … … 274 275 *(int64_t *)Pout = (*(char *)Pin - Bzero) / Bscale; 275 276 # ifdef BYTE_SWAP 276 SWAP_DBLE;277 if (!nativeOrder) { SWAP_DBLE; } 277 278 # endif 278 279 } … … 283 284 *(float *)Pout = (*(char *)Pin - Bzero) / Bscale; 284 285 # ifdef BYTE_SWAP 285 SWAP_WORD;286 if (!nativeOrder) { SWAP_WORD; } 286 287 # endif 287 288 } … … 292 293 *(double *)Pout = (*(char *)Pin - Bzero) / Bscale; 293 294 # ifdef BYTE_SWAP 294 SWAP_DBLE;295 if (!nativeOrder) { SWAP_DBLE; } 295 296 # endif 296 297 } … … 315 316 *(short *)Pout = (*(char *)Pin - Bzero) / Bscale; 316 317 # ifdef BYTE_SWAP 317 SWAP_BYTE;318 if (!nativeOrder) { SWAP_BYTE; } 318 319 # endif 319 320 } … … 324 325 *(int *)Pout = (*(char *)Pin - Bzero) / Bscale; 325 326 # ifdef BYTE_SWAP 326 SWAP_WORD;327 if (!nativeOrder) { SWAP_WORD; } 327 328 # endif 328 329 } … … 333 334 *(int64_t *)Pout = (*(char *)Pin - Bzero) / Bscale; 334 335 # ifdef BYTE_SWAP 335 SWAP_DBLE;336 if (!nativeOrder) { SWAP_DBLE; } 336 337 # endif 337 338 } … … 342 343 *(float *)Pout = (*(char *)Pin - Bzero) / Bscale; 343 344 # ifdef BYTE_SWAP 344 SWAP_WORD;345 if (!nativeOrder) { SWAP_WORD; } 345 346 # endif 346 347 } … … 351 352 *(double *)Pout = (*(char *)Pin - Bzero) / Bscale; 352 353 # ifdef BYTE_SWAP 353 SWAP_DBLE;354 if (!nativeOrder) { SWAP_DBLE; } 354 355 # endif 355 356 } … … 374 375 *(short *)Pout = (*(short *)Pin - Bzero) / Bscale; 375 376 # ifdef BYTE_SWAP 376 SWAP_BYTE;377 if (!nativeOrder) { SWAP_BYTE; } 377 378 # endif 378 379 } … … 383 384 *(int *)Pout = (*(short *)Pin - Bzero) / Bscale; 384 385 # ifdef BYTE_SWAP 385 SWAP_WORD;386 if (!nativeOrder) { SWAP_WORD; } 386 387 # endif 387 388 } … … 392 393 *(int64_t *)Pout = (*(short *)Pin - Bzero) / Bscale; 393 394 # ifdef BYTE_SWAP 394 SWAP_DBLE;395 if (!nativeOrder) { SWAP_DBLE; } 395 396 # endif 396 397 } … … 401 402 *(float *)Pout = (*(short *)Pin - Bzero) / Bscale; 402 403 # ifdef BYTE_SWAP 403 SWAP_WORD;404 if (!nativeOrder) { SWAP_WORD; } 404 405 # endif 405 406 } … … 410 411 *(double *)Pout = (*(short *)Pin - Bzero) / Bscale; 411 412 # ifdef BYTE_SWAP 412 SWAP_DBLE;413 if (!nativeOrder) { SWAP_DBLE; } 413 414 # endif 414 415 } … … 433 434 *(short *)Pout = (*(int *)Pin - Bzero) / Bscale; 434 435 # ifdef BYTE_SWAP 435 SWAP_BYTE;436 if (!nativeOrder) { SWAP_BYTE; } 436 437 # endif 437 438 } … … 442 443 *(int *)Pout = (*(int *)Pin - Bzero) / Bscale; 443 444 # ifdef BYTE_SWAP 444 SWAP_WORD;445 if (!nativeOrder) { SWAP_WORD; } 445 446 # endif 446 447 } … … 451 452 *(int64_t *)Pout = (*(int *)Pin - Bzero) / Bscale; 452 453 # ifdef BYTE_SWAP 453 SWAP_DBLE;454 if (!nativeOrder) { SWAP_DBLE; } 454 455 # endif 455 456 } … … 460 461 *(float *)Pout = (*(int *)Pin - Bzero) / Bscale; 461 462 # ifdef BYTE_SWAP 462 SWAP_WORD;463 if (!nativeOrder) { SWAP_WORD; } 463 464 # endif 464 465 } … … 469 470 *(double *)Pout = (*(int *)Pin - Bzero) / Bscale; 470 471 # ifdef BYTE_SWAP 471 SWAP_DBLE;472 if (!nativeOrder) { SWAP_DBLE; } 472 473 # endif 473 474 } … … 492 493 *(short *)Pout = (*(int64_t *)Pin - Bzero) / Bscale; 493 494 # ifdef BYTE_SWAP 494 SWAP_BYTE;495 if (!nativeOrder) { SWAP_BYTE; } 495 496 # endif 496 497 } … … 501 502 *(int *)Pout = (*(int64_t *)Pin - Bzero) / Bscale; 502 503 # ifdef BYTE_SWAP 503 SWAP_WORD;504 if (!nativeOrder) { SWAP_WORD; } 504 505 # endif 505 506 } … … 510 511 *(int64_t *)Pout = (*(int64_t *)Pin - Bzero) / Bscale; 511 512 # ifdef BYTE_SWAP 512 SWAP_DBLE;513 if (!nativeOrder) { SWAP_DBLE; } 513 514 # endif 514 515 } … … 519 520 *(float *)Pout = (*(int64_t *)Pin - Bzero) / Bscale; 520 521 # ifdef BYTE_SWAP 521 SWAP_WORD;522 if (!nativeOrder) { SWAP_WORD; } 522 523 # endif 523 524 } … … 528 529 *(double *)Pout = (*(int64_t *)Pin - Bzero) / Bscale; 529 530 # ifdef BYTE_SWAP 530 SWAP_DBLE;531 if (!nativeOrder) { SWAP_DBLE; } 531 532 # endif 532 533 } … … 551 552 *(short *)Pout = (*(float *)Pin - Bzero) / Bscale; 552 553 # ifdef BYTE_SWAP 553 SWAP_BYTE;554 if (!nativeOrder) { SWAP_BYTE; } 554 555 # endif 555 556 } … … 560 561 *(int *)Pout = (*(float *)Pin - Bzero) / Bscale; 561 562 # ifdef BYTE_SWAP 562 SWAP_WORD;563 if (!nativeOrder) { SWAP_WORD; } 563 564 # endif 564 565 } … … 569 570 *(int64_t *)Pout = (*(float *)Pin - Bzero) / Bscale; 570 571 # ifdef BYTE_SWAP 571 SWAP_DBLE;572 if (!nativeOrder) { SWAP_DBLE; } 572 573 # endif 573 574 } … … 578 579 *(float *)Pout = (*(float *)Pin - Bzero) / Bscale; 579 580 # ifdef BYTE_SWAP 580 SWAP_WORD;581 if (!nativeOrder) { SWAP_WORD; } 581 582 # endif 582 583 } … … 587 588 *(double *)Pout = (*(float *)Pin - Bzero) / Bscale; 588 589 # ifdef BYTE_SWAP 589 SWAP_DBLE;590 if (!nativeOrder) { SWAP_DBLE; } 590 591 # endif 591 592 } … … 610 611 *(short *)Pout = (*(double *)Pin - Bzero) / Bscale; 611 612 # ifdef BYTE_SWAP 612 SWAP_BYTE;613 if (!nativeOrder) { SWAP_BYTE; } 613 614 # endif 614 615 } … … 619 620 *(int *)Pout = (*(double *)Pin - Bzero) / Bscale; 620 621 # ifdef BYTE_SWAP 621 SWAP_WORD;622 if (!nativeOrder) { SWAP_WORD; } 622 623 # endif 623 624 } … … 628 629 *(int64_t *)Pout = (*(double *)Pin - Bzero) / Bscale; 629 630 # ifdef BYTE_SWAP 630 SWAP_DBLE;631 if (!nativeOrder) { SWAP_DBLE; } 631 632 # endif 632 633 } … … 637 638 *(float *)Pout = (*(double *)Pin - Bzero) / Bscale; 638 639 # ifdef BYTE_SWAP 639 SWAP_WORD;640 if (!nativeOrder) { SWAP_WORD; } 640 641 # endif 641 642 } … … 646 647 *(double *)Pout = (*(double *)Pin - Bzero) / Bscale; 647 648 # ifdef BYTE_SWAP 648 SWAP_DBLE;649 if (!nativeOrder) { SWAP_DBLE; } 649 650 # endif 650 651 }
Note:
See TracChangeset
for help on using the changeset viewer.
