IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 6, 2007, 3:27:59 PM (19 years ago)
Author:
jhoblitt
Message:

try to always handle det_id as a psS64

File:
1 edited

Legend:

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

    r14045 r14046  
    8080//static psArray *validDetInputClassIds(pxConfig *config, const char *det_id);
    8181//static psArray *searchInputImfiles(pxConfig *config, const char *det_id);
    82 static detInputExpRow *rawDetrenTodetInputExpRow(rawExpRow *rawExp, psS32 det_id, psS32 iteration);
     82static detInputExpRow *rawDetrenTodetInputExpRow(rawExpRow *rawExp, psS64 det_id, psS32 iteration);
    8383static psArray *searchRawImfiles(pxConfig *config, psMetadata *where);
    8484static psS32 incrementIteration(pxConfig *config, const char *det_id);
     
    569569    psFree(use_begin);
    570570    psFree(use_end);
    571     long det_id = psDBLastInsertID(config->dbh);
     571    psS64 det_id = psDBLastInsertID(config->dbh);
    572572
    573573    // create new detInputExp row(s) from the rawExp row(s)
     
    617617    {
    618618        psMetadata *where = psMetadataAlloc();
    619         psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", det_id);
     619        psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==", det_id);
    620620        detRuns = psDBSelectRows(config->dbh, "detRun", where, 0);
    621621        psFree(where);
     
    627627    // sanity check results
    628628    if (psArrayLength(detRuns) != 1) {
    629         psAbort("found more then one detRun matching det_id %ld(this should not happen)", det_id);
     629        psAbort("found more then one detRun matching det_id %" PRId64 " (this should not happen)", det_id);
    630630        return false;
    631631    }
     
    13001300    psFree(use_begin);
    13011301    psFree(use_end);
    1302     long det_id = psDBLastInsertID(config->dbh);
     1302    psS64 det_id = psDBLastInsertID(config->dbh);
    13031303
    13041304    // create new detInputExp row(s) from the rawExp row(s)
     
    13391339    {
    13401340        psMetadata *where = psMetadataAlloc();
    1341         psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", det_id);
     1341        psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==", det_id);
    13421342        detRuns = psDBSelectRows(config->dbh, "detRun", where, 0);
    13431343        psFree(where);
     
    13491349    // sanity check results
    13501350    if (psArrayLength(detRuns) != 1) {
    1351         psAbort("found more then one detRun matching det_id %ld(this should not happen)", det_id);
     1351        psAbort("found more then one detRun matching det_id %" PRId64 " (this should not happen)", det_id);
    13521352        return false;
    13531353    }
     
    17611761
    17621762    // get the det_id
    1763     long newDet_id = psDBLastInsertID(config->dbh);
     1763    psS64 newDet_id = psDBLastInsertID(config->dbh);
    17641764
    17651765    psString query = psStringCopy(
     
    18101810    {
    18111811        psMetadata *where = psMetadataAlloc();
    1812         psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", newDet_id);
     1812        psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==", newDet_id);
    18131813        newDetRuns = psDBSelectRows(config->dbh, "detRun", where, 0);
    18141814        psFree(where);
     
    18201820    // sanity check the result... we should have only found one det_id
    18211821    if (psArrayLength(newDetRuns) != 1) {
    1822         psAbort("found more then one detRun matching det_id %ld(this should not happen)", newDet_id);
     1822        psAbort("found more then one detRun matching det_id %" PRId64 " (this should not happen)", newDet_id);
    18231823        return false;                   // unreachable
    18241824    }
     
    19721972}
    19731973
    1974 static detInputExpRow *rawDetrenTodetInputExpRow(rawExpRow *rawExp, psS32 det_id, psS32 iteration)
     1974static detInputExpRow *rawDetrenTodetInputExpRow(rawExpRow *rawExp, psS64 det_id, psS32 iteration)
    19751975{
    19761976    PS_ASSERT_PTR_NON_NULL(rawExp, NULL);
     
    23722372    // create a new detProcessedImfile object
    23732373    detProcessedImfileRow *detRow = detProcessedImfileRowAlloc(
    2374         (psS32)atol(det_id),
     2374        (psS64)atoll(det_id),
    23752375        (psS64)atoll(exp_id),
    23762376        class_id,
     
    26492649    // create a new detProcessedImfile object
    26502650    detProcessedExpRow *detRow = detProcessedExpRowAlloc(
    2651         (psS32)atol(det_id),
     2651        (psS64)atoll(det_id),
    26522652        (psS64)atoll(exp_id),
    26532653        recipe,
     
    30663066    // det_id
    30673067    psMetadata *where = psMetadataAlloc();
    3068     if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",
     3068    if (!psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==",
    30693069            (psS64)atoll(det_id))) {
    30703070        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
     
    30953095    // create a new detStackedImfile object
    30963096    detStackedImfileRow *stackedImfile = detStackedImfileRowAlloc(
    3097             (psS32)atol(det_id),
     3097            (psS64)atoll(det_id),
    30983098            iteration,
    30993099            class_id,
     
    40534053    // create a new detProcessedImfile object
    40544054    detNormalizedExpRow *detRow = detNormalizedExpRowAlloc(
    4055         (psS32)atol(det_id),
     4055        (psS32)atoll(det_id),
    40564056        iteration,
    40574057        recipe,
     
    51605160    bool status = false;
    51615161    // values from row
    5162     psS32 det_id = psMetadataLookupS32(&status, row, "det_id");
     5162    psS64 det_id = psMetadataLookupS64(&status, row, "det_id");
    51635163    if (!status) {
    51645164        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for det_id");
     
    58025802    bool status = false;
    58035803    // from row
    5804     psS32 det_id = psMetadataLookupS32(&status, row, "det_id");
     5804    psS64 det_id = psMetadataLookupS64(&status, row, "det_id");
    58055805    if (!status) {
    58065806        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for det_id");
     
    61086108        if (!detInputExpInsert(
    61096109                    config->dbh,
    6110                     (psS32)atol(det_id),
     6110                    (psS64)atoll(det_id),
    61116111                    newIteration,
    61126112                    (psS64)atoll(exp_id),
     
    61876187        psFree(iter);
    61886188    } else {
    6189         psAbort(                "-exp_id was not parsed correctly (this should not happen");
     6189        psAbort("-exp_id was not parsed correctly (this should not happen");
    61906190    }
    61916191
     
    61946194
    61956195    // add the det_id & iteration == 0 to the where clause
    6196     if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",
    6197                 (psS32)atol(det_id))) {
     6196    if (!psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==",
     6197                (psS64)atoll(det_id))) {
    61986198        psError(PS_ERR_UNKNOWN, false, "failed to add item det_id");
    61996199        psFree(where);
     
    62676267        }
    62686268        detInputExpRow *newInputExp = detInputExpRowAlloc(
    6269             (psS32)atol(det_id),
     6269            (psS64)atoll(det_id),
    62706270            newIteration,
    62716271            inputExp->exp_id,
     
    66106610    {
    66116611        psMetadata *where = psMetadataAlloc();
    6612         psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", det_id);
     6612        psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==", det_id);
    66136613        detRuns = psDBSelectRows(config->dbh, "detRun", where, 0);
    66146614        psFree(where);
     
    67806780    psMetadata *where = psMetadataAlloc();
    67816781    if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",
    6782                 (psS32)atol(det_id))) {
     6782                (psS32)atoll(det_id))) {
    67836783        psError(PS_ERR_UNKNOWN, false, "failed to add item det_id");
    67846784        psFree(where);
Note: See TracChangeset for help on using the changeset viewer.