IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 22, 2009, 10:43:26 AM (17 years ago)
Author:
eugene
Message:

lots of very minor API mods to satisfy some pickier compilers (supply void to prototypes for argument-less functions)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/dbFields.c

    r20936 r21153  
    3030int GetMagMode (char *string) {
    3131
    32   if (!strcasecmp (string, "inst"))  return (MAG_INST);
    33   if (!strcasecmp (string, "cat"))   return (MAG_CAT);
    34   if (!strcasecmp (string, "sys"))   return (MAG_SYS);
    35   if (!strcasecmp (string, "rel"))   return (MAG_REL);
    36   if (!strcasecmp (string, "cal"))   return (MAG_CAL);
    37   if (!strcasecmp (string, "ave"))   return (MAG_AVE);
    38   if (!strcasecmp (string, "ref"))   return (MAG_REF);
    39   if (!strcasecmp (string, "err"))   return (MAG_ERR);
    40   if (!strcasecmp (string, "chisq")) return (MAG_CHISQ);
    41   if (!strcasecmp (string, "ncode")) return (MAG_NCODE);
    42   if (!strcasecmp (string, "nphot")) return (MAG_NPHOT);
     32  if (!strcasecmp (string, "inst"))      return (MAG_INST);
     33  if (!strcasecmp (string, "cat"))       return (MAG_CAT);
     34  if (!strcasecmp (string, "sys"))       return (MAG_SYS);
     35  if (!strcasecmp (string, "rel"))       return (MAG_REL);
     36  if (!strcasecmp (string, "cal"))       return (MAG_CAL);
     37  if (!strcasecmp (string, "ave"))       return (MAG_AVE);
     38  if (!strcasecmp (string, "ref"))       return (MAG_REF);
     39  if (!strcasecmp (string, "err"))       return (MAG_ERR);
     40  if (!strcasecmp (string, "photflags")) return (MAG_PHOT_FLAGS);
     41  if (!strcasecmp (string, "chisq"))     return (MAG_CHISQ);
     42  if (!strcasecmp (string, "ncode"))     return (MAG_NCODE);
     43  if (!strcasecmp (string, "nphot"))     return (MAG_NPHOT);
    4344  return (MAG_NONE);
    4445}
     
    7576  }
    7677
    77 
    7878  // enforce compatibility
    79   // XXX this is kind of poorly done
    80   if ((code[0].type == PHOT_REF) && (*mode != MAG_ERR)) {
    81     *mode = MAG_CAT;
    82   }
    83   if (code[0].type == PHOT_DEP) {
    84     if (useDefault) {
     79  if (useDefault) {
     80    if (code[0].type == PHOT_REF) {
     81      *mode = MAG_CAT;
     82    }
     83    if (code[0].type == PHOT_DEP) {
    8584      *mode = MAG_REL;
    8685    }
     
    186185  if (!strcasecmp (fieldName, "DETID"))      ESCAPE (MEAS_DET_ID,         MAG_NONE, OPIHI_INT);
    187186  if (!strcasecmp (fieldName, "OBJID"))      ESCAPE (MEAS_OBJ_ID,         MAG_NONE, OPIHI_INT);
     187  if (!strcasecmp (fieldName, "CATID"))      ESCAPE (MEAS_CAT_ID,         MAG_NONE, OPIHI_INT);
    188188  if (!strcasecmp (fieldName, "IMAGEID"))    ESCAPE (MEAS_IMAGE_ID,       MAG_NONE, OPIHI_INT);
    189189  if (!strcasecmp (fieldName, "PSF_QF"))     ESCAPE (MEAS_PSF_QF,         MAG_NONE, OPIHI_FLT);
     
    206206  field->ID = MEAS_MAG;
    207207  field->magMode = mode;
    208   field->type = OPIHI_FLT;
     208  switch (mode) {
     209    case MAG_NCODE:
     210    case MAG_NPHOT:
     211    case MAG_PHOT_FLAGS:
     212      field->type = OPIHI_INT;
     213      break;
     214    default:
     215      field->type = OPIHI_FLT;
     216      break;
     217  }
    209218  field->photcode = code;
    210219  return (TRUE);
     
    280289  field->ID = AVE_MAG;
    281290  field->magMode = mode;
    282   field->type = OPIHI_FLT;
     291  switch (mode) {
     292    case MAG_NCODE:
     293    case MAG_NPHOT:
     294    case MAG_PHOT_FLAGS:
     295      field->type = OPIHI_INT;
     296      break;
     297    default:
     298      field->type = OPIHI_FLT;
     299      break;
     300  }
    283301  field->photcode = code;
    284302  return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.