IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 29, 2008, 2:44:04 PM (18 years ago)
Author:
eugene
Message:

merge cvs HEAD into cleanup branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cleanup/ippTools/src/difftool.c

    r18153 r18357  
    4242static bool definebyqueryMode(pxConfig *config);
    4343
    44 static bool setdiffRunState(pxConfig *config, const char *diff_id, const char *state);
     44static bool setdiffRunState(pxConfig *config, psS64 diff_id, const char *state);
    4545
    4646# define MODECASE(caseName, func) \
     
    146146
    147147    // required options
    148     PXOPT_LOOKUP_STR(diff_id, config->args, "-diff_id", true, false);
     148    PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", true, false);
    149149    PXOPT_LOOKUP_STR(state, config->args, "-state", true, false);
    150150
     
    163163
    164164    // required options
    165     PXOPT_LOOKUP_STR(diff_id, config->args, "-diff_id", true, false);
     165    PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", true, false);
    166166
    167167    // optional
    168     PXOPT_LOOKUP_STR(stack_id, config->args, "-stack_id", false, false);
    169     PXOPT_LOOKUP_STR(warp_id, config->args, "-warp_id", false, false);
     168    PXOPT_LOOKUP_S64(stack_id, config->args, "-stack_id", false, false);
     169    PXOPT_LOOKUP_S64(warp_id, config->args, "-warp_id", false, false);
    170170    PXOPT_LOOKUP_STR(kind, config->args, "-kind", false, false);
    171171
     
    188188    psString tess_id = NULL;
    189189    if (warp_id) {
    190         if (!p_psDBRunQuery(config->dbh, "SELECT * from diffRun WHERE diff_id = %" PRId64, (psS64)atoll(diff_id))) {
     190        if (!p_psDBRunQuery(config->dbh, "SELECT * from diffRun WHERE diff_id = %" PRId64, diff_id)) {
    191191            psError(PS_ERR_UNKNOWN, false, "database error");
    192192            return false;
     
    199199        }
    200200        if (!psArrayLength(output)) {
    201             psError(PS_ERR_UNKNOWN, false, "diff_id %" PRId64 " not found", (psS64)atoll(diff_id));
     201            psError(PS_ERR_UNKNOWN, false, "diff_id %" PRId64 " not found", diff_id);
    202202            psFree(output);
    203203            return false;
     
    215215
    216216    if (!diffInputSkyfileInsert(config->dbh,
    217             (psS64)atoll(diff_id),
     217            diff_id,
    218218            template,
    219             stack_id ? (psS64)atoll(stack_id) : PS_MAX_S64, // defined or NULL
    220             warp_id ? (psS64)atoll(warp_id) : PS_MAX_S64, // defined or NULL
     219            stack_id ? stack_id : PS_MAX_S64, // defined or NULL
     220            warp_id ? warp_id : PS_MAX_S64, // defined or NULL
    221221            skycell_id,
    222222            tess_id,
     
    230230    }
    231231
    232     if (!p_psDBRunQuery(config->dbh, "SELECT count(diff_id) FROM diffRun JOIN diffInputSkyfile USING(diff_id) WHERE diff_id = %" PRId64, (psS64)atoll(diff_id))) {
     232    if (!p_psDBRunQuery(config->dbh, "SELECT count(diff_id) FROM diffRun JOIN diffInputSkyfile USING(diff_id) WHERE diff_id = %" PRId64, diff_id)) {
    233233        if (!psDBRollback(config->dbh)) {
    234234            psError(PS_ERR_UNKNOWN, false, "database error");
     
    250250            psError(PS_ERR_UNKNOWN, false, "database error");
    251251        }
    252         psError(PS_ERR_UNKNOWN, false, "diff_id %" PRId64 " not found", (psS64)atoll(diff_id));
     252        psError(PS_ERR_UNKNOWN, false, "diff_id %" PRId64 " not found", diff_id);
    253253        psFree(output);
    254254        return false;
     
    333333
    334334    if (psArrayLength(output)) {
    335         if (!convertIdToStr(output)) {
    336             psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    337             psFree(output);
    338             return false;
    339         }
    340 
    341335        // negative simple so the default is true
    342336        if (!ippdbPrintMetadatas(stdout, output, "diffInputSkyfile", !simple)) {
     
    407401
    408402    if (psArrayLength(output)) {
    409         if (!convertIdToStr(output)) {
    410             psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    411             psFree(output);
    412             return false;
    413         }
    414 
    415403        // negative simple so the default is true
    416404        if (!ippdbPrintMetadatas(stdout, output, "diffSkyfile", !simple)) {
     
    432420
    433421    // required
    434     PXOPT_LOOKUP_STR(diff_id, config->args, "-diff_id", true, false);
     422    PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", true, false);
    435423
    436424    // default to 0
     
    465453
    466454    if (!diffSkyfileInsert(config->dbh,
    467                            (psS64)atoll(diff_id),
     455                           diff_id,
    468456                           uri,
    469457                           path_base,
     
    557545
    558546    if (psArrayLength(output)) {
    559         if (!convertIdToStr(output)) {
    560             psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");
    561             psFree(output);
    562             return false;
    563         }
    564 
    565547        // negative simple so the default is true
    566548        if (!ippdbPrintMetadatas(stdout, output, "diffSkyfile", !simple)) {
     
    609591
    610592
    611 static bool setdiffRunState(pxConfig *config, const char *diff_id, const char *state)
    612 {
    613     PS_ASSERT_PTR_NON_NULL(diff_id, false);
     593static bool setdiffRunState(pxConfig *config, psS64 diff_id, const char *state)
     594{
    614595    PS_ASSERT_PTR_NON_NULL(state, false);
    615596
     
    626607    }
    627608
    628     char *query = "UPDATE diffRun SET state = '%s' WHERE diff_id = '%s'";
     609    char *query = "UPDATE diffRun SET state = '%s' WHERE diff_id = %"PRId64;
    629610    if (!p_psDBRunQuery(config->dbh, query, state, diff_id)) {
    630611        psError(PS_ERR_UNKNOWN, false,
    631                 "failed to change state for diff_id %s", diff_id);
     612                "failed to change state for diff_id %"PRId64, diff_id);
    632613        return false;
    633614    }
     
    766747
    767748    // optional
    768     PXOPT_LOOKUP_STR(template_stack_id, config->args, "-template_stack_id", false, false);
    769     PXOPT_LOOKUP_STR(template_warp_id, config->args, "-template_warp_id", false, false);
     749    PXOPT_LOOKUP_S64(template_stack_id, config->args, "-template_stack_id", false, false);
     750    PXOPT_LOOKUP_S64(template_warp_id, config->args, "-template_warp_id", false, false);
    770751
    771752    if (template_stack_id && template_warp_id) {
     
    779760    }
    780761
    781     PXOPT_LOOKUP_STR(input_stack_id, config->args, "-input_stack_id", false, false);
    782     PXOPT_LOOKUP_STR(input_warp_id, config->args, "-input_warp_id", false, false);
     762    PXOPT_LOOKUP_S64(input_stack_id, config->args, "-input_stack_id", false, false);
     763    PXOPT_LOOKUP_S64(input_warp_id, config->args, "-input_warp_id", false, false);
    783764    if (input_stack_id && input_warp_id) {
    784765        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Only one input can be defined.");
     
    792773
    793774    return populatedrun(workdir, skycell_id, tess_id,
    794                         input_warp_id ? (psS64)atoll(input_warp_id) : PS_MAX_S64,
    795                         input_stack_id ? (psS64)atoll(input_stack_id) : PS_MAX_S64,
    796                         template_warp_id ? (psS64)atoll(template_warp_id) : PS_MAX_S64,
    797                         template_stack_id ? (psS64)atoll(template_stack_id) : PS_MAX_S64,
     775                        input_warp_id ? input_warp_id : PS_MAX_S64,
     776                        input_stack_id ? input_stack_id : PS_MAX_S64,
     777                        template_warp_id ? template_warp_id : PS_MAX_S64,
     778                        template_stack_id ? template_stack_id : PS_MAX_S64,
    798779                        config);
    799780
Note: See TracChangeset for help on using the changeset viewer.