IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 8, 2008, 8:51:40 AM (18 years ago)
Author:
eugene
Message:

fix definebytag errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/dettool.c

    r19812 r19988  
    280280    PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false);
    281281
    282     // we have to support multipe exp_ids
     282    // we have to support multiple exp_ids
    283283    psMetadataItem *item = psMetadataLookup(config->args, "-exp_id");
    284284    if (!item) {
    285285        // this shouldn't actually happen when using psArgs
    286         psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
     286        psError(PS_ERR_UNKNOWN, true, "at least one -exp_id is required");
    287287        return false;
    288288    }
    289289    psMetadata *where = psMetadataAlloc();
    290290
     291    if ((item->type != PS_DATA_METADATA_MULTI) && (item->type != PS_DATA_S64)) {
     292        psAbort("-exp_id was not parsed correctly (this should not happen");
     293    }
     294
    291295    // make sure that -exp_id was parsed correctly
    292     // XXX this can be removed someday
    293     // XXX Special case for a multi : move into a macro?
    294296    if (item->type == PS_DATA_METADATA_MULTI) {
    295297        psListIterator *iter = psListIteratorAlloc(item->data.list, 0, false);
    296298        psMetadataItem *mItem = NULL;
    297299        while ((mItem = psListGetAndIncrement(iter))) {
    298             psString exp_id = mItem->data.V;
    299             // if exp_id is NULL then it means that -exp_id has not been
    300             // specified
    301             if (!exp_id) {
    302                 psError(PS_ERR_UNKNOWN, true,
    303                         "at least one -exp_id is required");
    304                 psFree(where);
    305                 return false;
    306             }
    307 
    308             if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id",
    309                  PS_META_DUPLICATE_OK, "==", exp_id)) {
     300            psS64 exp_id = mItem->data.S64;
     301            if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", PS_META_DUPLICATE_OK, "==", exp_id)) {
    310302                psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    311303                psFree(iter);
     
    315307        }
    316308        psFree(iter);
    317     } else {
    318         psAbort(                "-exp_id was not parsed correctly (this should not happen");
    319     }
     309    }
     310    if (item->type == PS_DATA_S64) {
     311        psS64 exp_id = item->data.S64;
     312        if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", PS_META_DUPLICATE_OK, "==", exp_id)) {
     313            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
     314            psFree(where);
     315            return false;
     316        }
     317    }
    320318
    321319    if (psListLength(where->list) < 1) {
Note: See TracChangeset for help on using the changeset viewer.