Changeset 41676 for trunk/Ohana/src/libfits/table/F_set_column.c
- Timestamp:
- Jul 1, 2021, 1:58:44 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/table/F_set_column.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/table/F_set_column.c
r41422 r41676 478 478 /* print line with appropriate formatting */ 479 479 ALLOCATE (array, char, Nbytes*Nval*Nrow); 480 ALLOCATE (line, char, N val+1);480 ALLOCATE (line, char, Nbytes+1); 481 481 Pin = data; 482 482 Pout = array; 483 483 if (!strcmp (type, "char")) { 484 for (i = 0; i < N val*Nrow; i++, Pin++, Pout++) {484 for (i = 0; i < Nbytes*Nval*Nrow; i++, Pin++, Pout++) { 485 485 *Pout = *Pin; 486 486 } 487 487 } 488 488 if (!strcmp (type, "int")) { 489 for (i = 0; i < Nrow; i++, Pin+=4, Pout+=N val) {490 snprintf (line, N val+ 1, cformat, *(int *)Pin);491 memcpy (Pout, line, N val);489 for (i = 0; i < Nrow; i++, Pin+=4, Pout+=Nbytes) { 490 snprintf (line, Nbytes + 1, cformat, *(int *)Pin); 491 memcpy (Pout, line, Nbytes); 492 492 } 493 493 } 494 494 if (!strcmp (type, "float")) { 495 for (i = 0; i < Nrow; i++, Pin+=4, Pout+=N val) {496 snprintf (line, N val+ 1, cformat, *(float *)Pin);497 memcpy (Pout, line, N val);495 for (i = 0; i < Nrow; i++, Pin+=4, Pout+=Nbytes) { 496 snprintf (line, Nbytes + 1, cformat, *(float *)Pin); 497 memcpy (Pout, line, Nbytes); 498 498 } 499 499 }
Note:
See TracChangeset
for help on using the changeset viewer.
