IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 24, 2021, 3:37:52 PM (5 years ago)
Author:
eugene
Message:

clarify in comments the buffers and pixel sizes used in the different stages of compression/uncompression; catch unimplemented compression cases; fix error in pixel size for RICE1; cleanup verbose code; use correct sscanf format code in ASCII table reading code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libfits/table/F_table_format.c

    r41433 r41474  
    9292int gfits_table_format (char *format, char *type, int *Nval, int *Nbytes) {
    9393
    94   char Fchar, Size[80], Type;
     94  char Fchar, Size[80];
    9595  int Nv;
    9696
     
    107107  }
    108108 
    109   Type = 'x';
    110   if (Fchar == 'D') { *Nbytes = 1;  strcpy (type, "double"); Type = 'e'; *Nval = Nv; }
     109  int isLong = FALSE;
     110  char Type = 'x';
     111  if (Fchar == 'D') { *Nbytes = 1;  strcpy (type, "double"); Type = 'e'; *Nval = Nv; isLong = TRUE; }
    111112  if (Fchar == 'E') { *Nbytes = 1;  strcpy (type, "float");  Type = 'e'; *Nval = Nv; }
    112113  if (Fchar == 'F') { *Nbytes = 1;  strcpy (type, "float");  Type = 'f'; *Nval = Nv; }
     
    115116  if (!*Nbytes) { return (FALSE); }
    116117 
    117   sprintf (format, "%%-%s%c", Size, Type); // NOTE: this line is not used
     118  if (0) {
     119    // this format is appropriate for scanning, but not printing
     120    if (isLong) {
     121      sprintf (format, "%%%sl%c", Size, Type);
     122    } else {
     123      sprintf (format, "%%%s%c", Size, Type);
     124    }
     125  }
     126 
     127  // this format is appropriate for printing, but not scanning
     128  sprintf (format, "%%-%s%c", Size, Type);
    118129
    119130  return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.