Changeset 18336 for trunk/ippTools/src/difftool.c
- Timestamp:
- Jun 26, 2008, 3:39:54 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/difftool.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/difftool.c
r18093 r18336 42 42 static bool definebyqueryMode(pxConfig *config); 43 43 44 static bool setdiffRunState(pxConfig *config, const char *diff_id, const char *state);44 static bool setdiffRunState(pxConfig *config, psS64 diff_id, const char *state); 45 45 46 46 # define MODECASE(caseName, func) \ … … 146 146 147 147 // required options 148 PXOPT_LOOKUP_S TR(diff_id, config->args, "-diff_id", true, false);148 PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", true, false); 149 149 PXOPT_LOOKUP_STR(state, config->args, "-state", true, false); 150 150 … … 163 163 164 164 // required options 165 PXOPT_LOOKUP_S TR(diff_id, config->args, "-diff_id", true, false);165 PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", true, false); 166 166 167 167 // optional 168 PXOPT_LOOKUP_S TR(stack_id, config->args, "-stack_id", false, false);169 PXOPT_LOOKUP_S TR(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); 170 170 PXOPT_LOOKUP_STR(kind, config->args, "-kind", false, false); 171 171 … … 188 188 psString tess_id = NULL; 189 189 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)) { 191 191 psError(PS_ERR_UNKNOWN, false, "database error"); 192 192 return false; … … 199 199 } 200 200 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); 202 202 psFree(output); 203 203 return false; … … 215 215 216 216 if (!diffInputSkyfileInsert(config->dbh, 217 (psS64)atoll(diff_id),217 diff_id, 218 218 template, 219 stack_id ? (psS64)atoll(stack_id): PS_MAX_S64, // defined or NULL220 warp_id ? (psS64)atoll(warp_id): PS_MAX_S64, // defined or NULL219 stack_id ? stack_id : PS_MAX_S64, // defined or NULL 220 warp_id ? warp_id : PS_MAX_S64, // defined or NULL 221 221 skycell_id, 222 222 tess_id, … … 230 230 } 231 231 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)) { 233 233 if (!psDBRollback(config->dbh)) { 234 234 psError(PS_ERR_UNKNOWN, false, "database error"); … … 250 250 psError(PS_ERR_UNKNOWN, false, "database error"); 251 251 } 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); 253 253 psFree(output); 254 254 return false; … … 333 333 334 334 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 341 335 // negative simple so the default is true 342 336 if (!ippdbPrintMetadatas(stdout, output, "diffInputSkyfile", !simple)) { … … 407 401 408 402 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 415 403 // negative simple so the default is true 416 404 if (!ippdbPrintMetadatas(stdout, output, "diffSkyfile", !simple)) { … … 432 420 433 421 // required 434 PXOPT_LOOKUP_S TR(diff_id, config->args, "-diff_id", true, false);422 PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", true, false); 435 423 436 424 // default to 0 … … 465 453 466 454 if (!diffSkyfileInsert(config->dbh, 467 (psS64)atoll(diff_id),455 diff_id, 468 456 uri, 469 457 path_base, … … 557 545 558 546 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 565 547 // negative simple so the default is true 566 548 if (!ippdbPrintMetadatas(stdout, output, "diffSkyfile", !simple)) { … … 609 591 610 592 611 static bool setdiffRunState(pxConfig *config, const char *diff_id, const char *state) 612 { 613 PS_ASSERT_PTR_NON_NULL(diff_id, false); 593 static bool setdiffRunState(pxConfig *config, psS64 diff_id, const char *state) 594 { 614 595 PS_ASSERT_PTR_NON_NULL(state, false); 615 596 … … 626 607 } 627 608 628 char *query = "UPDATE diffRun SET state = '%s' WHERE diff_id = '%s'";609 char *query = "UPDATE diffRun SET state = '%s' WHERE diff_id = %"PRId64; 629 610 if (!p_psDBRunQuery(config->dbh, query, state, diff_id)) { 630 611 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); 632 613 return false; 633 614 } … … 766 747 767 748 // optional 768 PXOPT_LOOKUP_S TR(template_stack_id, config->args, "-template_stack_id", false, false);769 PXOPT_LOOKUP_S TR(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); 770 751 771 752 if (template_stack_id && template_warp_id) { … … 779 760 } 780 761 781 PXOPT_LOOKUP_S TR(input_stack_id, config->args, "-input_stack_id", false, false);782 PXOPT_LOOKUP_S TR(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); 783 764 if (input_stack_id && input_warp_id) { 784 765 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Only one input can be defined."); … … 792 773 793 774 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, 798 779 config); 799 780
Note:
See TracChangeset
for help on using the changeset viewer.
