IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 25, 2012, 11:44:42 AM (14 years ago)
Author:
eugene
Message:

add various long int type options to gfits_scan

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120805/Ohana/src/libfits/header/F_scan.c

    r28246 r34355  
    8585
    8686  // XXX is this safe for 64bit off_t and 32bit off_t?
     87  // XXX the problem is that we read FITS files on many machine types: I need to ensure
     88  // that we are portable -- this sseems inconsistent
    8789  if (!strcmp (mode, "%jd"))  { *va_arg (argp, intmax_t *)           = value; return (TRUE); }
    8890
     
    220222  if ((*q == 'd') || (*q == 'D')) value *= pow (10.0, atof (q + 1));
    221223
    222   if (!strcmp (mode, "%d"))   { *va_arg (argp, int *)                = value; return (TRUE); }
    223   if (!strcmp (mode, "%ld"))  { *va_arg (argp, long *)               = value; return (TRUE); }
    224   if (!strcmp (mode, OFF_T_FMT)) { *va_arg (argp, long long *)       = value; return (TRUE); }
    225   if (!strcmp (mode, "%Ld"))  { *va_arg (argp, long long *)          = value; return (TRUE); }
    226   if (!strcmp (mode, "%u"))   { *va_arg (argp, unsigned *)           = value; return (TRUE); }
    227   if (!strcmp (mode, "%lu"))  { *va_arg (argp, unsigned long *)      = value; return (TRUE); }
    228   if (!strcmp (mode, "%llu")) { *va_arg (argp, unsigned long long *) = value; return (TRUE); }
    229   if (!strcmp (mode, "%Lu"))  { *va_arg (argp, unsigned long long *) = value; return (TRUE); }
    230   if (!strcmp (mode, "%hd"))  { *va_arg (argp, short *)              = value; return (TRUE); }
     224  if (!strcmp (mode, "%d"))      { *va_arg (argp, int *)                = value; return (TRUE); }
     225  if (!strcmp (mode, "%ld"))     { *va_arg (argp, long *)               = value; return (TRUE); }
     226  if (!strcmp (mode, OFF_T_FMT)) { *va_arg (argp, off_t *)              = value; return (TRUE); }
     227  if (!strcmp (mode, "%Ld"))     { *va_arg (argp, long long *)          = value; return (TRUE); }
     228  if (!strcmp (mode, "%u"))      { *va_arg (argp, unsigned *)           = value; return (TRUE); }
     229  if (!strcmp (mode, "%lu"))     { *va_arg (argp, unsigned long *)      = value; return (TRUE); }
     230  if (!strcmp (mode, "%llu"))    { *va_arg (argp, unsigned long long *) = value; return (TRUE); }
     231  if (!strcmp (mode, "%Lu"))     { *va_arg (argp, unsigned long long *) = value; return (TRUE); }
     232  if (!strcmp (mode, "%hd"))     { *va_arg (argp, short *)              = value; return (TRUE); }
     233  if (!strcmp (mode, "%jd"))     { *va_arg (argp, intmax_t *)           = value; return (TRUE); }
    231234
    232235  /* no valid mode found */
Note: See TracChangeset for help on using the changeset viewer.