IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 28, 2007, 6:44:37 PM (19 years ago)
Author:
jhoblitt
Message:

rename all *_version fields to be *_id
change chip* tables to use a chip_id
change cam* tables to use a cam_id
change all *_id fields to be S64

File:
1 edited

Legend:

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

    r12123 r12131  
    2525#include <string.h>
    2626#include <stdlib.h>
     27#include <stdint.h>
     28
    2729#include <ippdb.h>
    2830
     
    7072static bool register_detrend_imfileMode(pxConfig *config);
    7173
    72 static bool convertDetIdToStr(psArray *mds);
    7374static detNormalizedStatImfileRow *detStackedToDetNormalizedStatImfile(pxConfig *config, detStackedImfileRow *stackedImfile);
    7475static  detNormalizedImfileRow *detNormalizedStatToDetNormalizedmfile(pxConfig *config, detNormalizedStatImfileRow *statImfile);
     
    598599    }
    599600
    600     // convert det_id to a str externally
    601     if (!convertDetIdToStr(detRuns)) {
    602         psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
     601    if (!convertIdToStr(detRuns)) {
     602        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    603603        psFree(detRuns);
    604604        return false;
     
    616616}
    617617
     618#if 0
    618619// This function is used to convert the det_id from an int, as it is used
    619620// internally, to be a string for external use.  The rational being that we may
     
    640641    return true;
    641642}
     643#endif
    642644
    643645static bool definebyqueryMode(pxConfig *config)
     
    12431245
    12441246    // convert det_id to a string externaly
    1245     if (!convertDetIdToStr(detRuns)) {
     1247    if (!convertIdToStr(detRuns)) {
    12461248        psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
    12471249        psFree(detRuns);
     
    12811283    {
    12821284        psMetadata *where = psMetadataAlloc();
    1283         psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", (psS32)atoi(det_id));
     1285        psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==", (psS64)atoll(det_id));
    12841286        detRuns = detRunSelectRowObjects(config->dbh, where, 0);
    12851287        psFree(where);
     
    12911293    // sanity check the result... we should have only found one det_id
    12921294    if (psArrayLength(detRuns) != 1) {
    1293         psAbort("found more then one detRun matching det_id %d(this should not happen)", (psS32)atoi(det_id));
     1295        psAbort("found more then one detRun matching det_id %" PRId64 " (this should not happen)", (psS64)atoll(det_id));
    12941296        return false;                   // unreachable
    12951297    }
     
    16241626    psFree(time_filter);
    16251627
    1626     if (!p_psDBRunQuery(config->dbh, query, (psS32)newDet_id, (psS32)atoi(det_id))) {
     1628    if (!p_psDBRunQuery(config->dbh, query, (psS64)newDet_id, (psS64)atoll(det_id))) {
    16271629        psError(PS_ERR_UNKNOWN, false, "database error");
    16281630        psFree(query);
     
    16661668
    16671669    // convert det_id to a string externaly
    1668     if (!convertDetIdToStr(newDetRuns)) {
    1669         psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
    1670         psFree(newDetRuns);
     1670    if (!convertIdToStr(detRuns)) {
     1671        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
     1672        psFree(detRuns);
    16711673        return false;
    16721674    }
     
    17011703
    17021704    // convert det_id to a string externaly
    1703     if (!convertDetIdToStr(runs)) {
    1704         psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
     1705    if (!convertIdToStr(runs)) {
     1706        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    17051707        psFree(runs);
    17061708        return false;
     
    17841786
    17851787    // convert det_id to a string externaly
    1786     if (!convertDetIdToStr(output)) {
    1787         psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
     1788    if (!convertIdToStr(output)) {
     1789        psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    17881790        psFree(output);
    17891791        return false;
     
    29072909    psMetadata *where = psMetadataAlloc();
    29082910    if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",
    2909             (psS32)atoi(det_id))) {
     2911            (psS64)atoll(det_id))) {
    29102912        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_tag");
    29112913        psFree(where);
     
    48704872            return false;
    48714873        }
    4872         if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", (psS32)atoi(det_id))) {
     4874        if (!psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==", (psS64)atoll(det_id))) {
    48734875            psError(PS_ERR_UNKNOWN, false, "failed to add item det_id");
    48744876            psFree(where);
     
    63326334            0.0,        // solang max
    63336335            label,      // label
    6334             atoi(parent)
     6336            (psS64)atoll(parent)
    63356337    )) {
    63366338        psError(PS_ERR_UNKNOWN, false, "database error");
     
    64356437    // the det_id is valid
    64366438    if (!detNormalizedImfileInsert(config->dbh,
    6437             (psS32)atoi(det_id),
     6439            (psS64)atoll(det_id),
    64386440            0,  // the iteration is fixed at 0
    64396441            class_id,
Note: See TracChangeset for help on using the changeset viewer.