Changeset 40467 for trunk/ippTools
- Timestamp:
- Jun 27, 2018, 1:28:35 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r34081 r40467 1513 1513 psList *exp_id_list = item->data.list; 1514 1514 psMetadata *where = psMetadataAlloc(); 1515 1516 // make sure that -exp_id was parsed correctly 1517 if (item->type == PS_DATA_METADATA_MULTI) { 1518 psListIterator *iter = psListIteratorAlloc(item->data.list, 0, false); 1519 psMetadataItem *mItem = NULL; 1520 while ((mItem = psListGetAndIncrement(iter))) { 1521 psS64 exp_id = mItem->data.S64; 1522 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", PS_META_DUPLICATE_OK, "==", exp_id)) { 1523 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 1524 psFree(iter); 1525 psFree(where); 1526 return false; 1527 } 1528 } 1529 psFree(iter); 1530 } 1531 if (item->type == PS_DATA_S64) { 1532 psS64 exp_id = item->data.S64; 1533 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", PS_META_DUPLICATE_OK, "==", exp_id)) { 1534 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 1535 psFree(where); 1536 return false; 1537 } 1538 } 1539 1540 # if (0) 1515 1541 // make sure that -exp_id was parsed correctly 1516 1542 // XXX this can be removed someday … … 1541 1567 psAbort("-exp_id was not parsed correctly (this should not happen"); 1542 1568 } 1569 # endif 1543 1570 1544 1571 // check that the specified exp_ids actually exist in the iteration zero … … 1599 1626 psArray *newInputExps = psArrayAllocEmpty(psListLength(exp_id_list)); 1600 1627 while ((mItem = psListGetAndIncrement(iter))) { 1601 detInputExpRow *inputExp = psHashLookup(valid_exp_ids,1602 (char *)mItem->data.V);1603 if (!inputExp) {1628 psString exp_idStr = psDBIntToString(mItem->data.S64); 1629 detInputExpRow *inputExp = psHashLookup(valid_exp_ids, exp_idStr); 1630 if (!inputExp) { 1604 1631 // rollback 1605 1632 if (!psDBRollback(config->dbh)) { … … 1607 1634 } 1608 1635 // invalid exp_id 1609 psError(PS_ERR_UNKNOWN, false, "exp_id %s is invalid for det_id %" PRId64, 1610 (char *)mItem->data.V, det_id); 1636 psError(PS_ERR_UNKNOWN, false, "exp_id %" PRId64 " is invalid for det_id %" PRId64, mItem->data.S64, det_id); 1611 1637 psFree(iter); 1612 1638 psFree(valid_exp_ids); … … 2452 2478 psMetadata *where = psMetadataAlloc(); 2453 2479 for (long i = 0; i < psArrayLength(inputExps); i++) { 2480 XXX note that exp_id is not a STRING 2454 2481 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 2455 2482 PS_META_DUPLICATE_OK, "==",
Note:
See TracChangeset
for help on using the changeset viewer.
