IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 26, 2008, 3:39:54 PM (18 years ago)
Author:
jhoblitt
Message:

consitently handle *_id fields as numeric values instead of converting back of forth between ints and strings

File:
1 edited

Legend:

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

    r17872 r18336  
    9191
    9292    if (!newExpInsert(config->dbh,
    93                 0x0,    // exp_id
     93                0,    // exp_id
    9494                tmp_exp_name,
    9595                tmp_camera,
     
    110110    }
    111111
    112     psS64 lastInsertID = psDBLastInsertID(config->dbh);
    113     psString exp_id = psDBIntToString(lastInsertID);
     112    psS64 exp_id = psDBLastInsertID(config->dbh);
    114113
    115114    psMetadata *md = psMetadataAlloc();
    116     if (!psMetadataAddStr(md, PS_LIST_TAIL, "exp_id", 0, NULL, exp_id)) {
     115    if (!psMetadataAddS64(md, PS_LIST_TAIL, "exp_id", 0, NULL, exp_id)) {
    117116        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
    118117        psFree(md);
    119         psFree(exp_id);
    120118    }
    121     psFree(exp_id);
    122119
    123120    // negate simple so the default is true
     
    137134    PS_ASSERT_PTR_NON_NULL(config, false);
    138135
    139     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", true, false);
     136    PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false);
    140137    PXOPT_LOOKUP_STR(tmp_class_id, config->args, "-tmp_class_id", true, false);
    141138    PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false);
    142139
    143140    // insert with error flag state set to 0 (no errors)
    144     if (!newImfileInsert(config->dbh, (psS64)atoll(exp_id), tmp_class_id, uri, NULL)) {
     141    if (!newImfileInsert(config->dbh, exp_id, tmp_class_id, uri, NULL)) {
    145142        psError(PS_ERR_UNKNOWN, false, "database error");
    146143        return false;
     
    155152    PS_ASSERT_PTR_NON_NULL(config, false);
    156153
    157     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", true, false);
     154    PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false);
    158155    PXOPT_LOOKUP_STR(state, config->args, "-state", true, false);
    159156
Note: See TracChangeset for help on using the changeset viewer.