Changeset 41582 for trunk/ippTools/src/pztool.c
- Timestamp:
- May 15, 2021, 8:38:08 AM (5 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pztool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pztool.c
r39519 r41582 49 49 static bool updatepzexpMode(pxConfig *config); 50 50 static bool updatenewexpMode(pxConfig *config); 51 static bool updatesummitExpMode(pxConfig *config); 51 52 52 53 // static bool copydoneCompleteExp(pxConfig *config); … … 54 55 static psArray *pzArrayZip(psArray *arraySet, psS64 limit); 55 56 static bool pzDownloadExpSetState(pxConfig *config, const psS64 summit_id, const char *state); 57 static bool summitExpSetFault(pxConfig *config, const psS64 summit_id, const int fault); 56 58 57 59 # define MODECASE(caseName, func) \ … … 88 90 MODECASE(PZTOOL_MODE_UPDATEPZEXP, updatepzexpMode); 89 91 MODECASE(PZTOOL_MODE_UPDATENEWEXP, updatenewexpMode); 92 MODECASE(PZTOOL_MODE_UPDATESUMMITEXP, updatesummitExpMode); 90 93 default: 91 94 psAbort("invalid option (this should not happen)"); … … 933 936 } 934 937 938 static bool summitExpSetFault(pxConfig *config, const psS64 summit_id, const int fault) 939 { 940 // check that state is a valid string value 941 if ((fault < 0) || (fault > 2048)) { 942 psError(PS_ERR_UNKNOWN, false, 943 "invalid summitExp fault: %d", fault); 944 return false; 945 } 946 947 char *query = "UPDATE summitExp SET fault = %d WHERE summit_id = %ld"; 948 if (!p_psDBRunQueryF(config->dbh, query, fault, summit_id)) { 949 psError(PS_ERR_UNKNOWN, false, "failed to change state for %lld", (long long) summit_id); 950 return false; 951 } 952 953 return true; 954 } 955 956 static bool updatesummitExpMode(pxConfig *config) 957 { 958 PS_ASSERT_PTR_NON_NULL(config, false); 959 PXOPT_LOOKUP_S64(summit_id, config->args, "-summit_id", true, false); 960 PXOPT_LOOKUP_S32(state, config->args, "-set_fault",true, false); 961 962 if (!summitExpSetFault(config,summit_id, fault)) { 963 psError(PS_ERR_UNKNOWN, false, "failed to change state for %lld", (long long) summit_id); 964 return false; 965 } 966 return true; 967 } 968 969 935 970 static bool updatepzexpMode(pxConfig *config) 936 971 {
Note:
See TracChangeset
for help on using the changeset viewer.
