IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 26, 2012, 11:19:48 AM (14 years ago)
Author:
eugene
Message:

fix a number of cases of unused variables (set but otherwise not used); some of these may have been used to check the presence of a mandatory argument

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src

  • trunk/ippTools/src/pstamptool.c

    r33337 r34081  
    4848static bool stopdependentjobMode(pxConfig *config);
    4949static bool revertjobMode(pxConfig *config);
     50
     51# if (0)
     52// these are unused functions -- since they are 'static', this raises an warning
    5053static bool addprojectMode(pxConfig *config);
    5154static bool projectMode(pxConfig *config);
     
    5962static bool listfileMode(pxConfig *config);
    6063static bool deletefileMode(pxConfig *config);
     64# endif
    6165
    6266# define MODECASE(caseName, func) \
     
    98102        MODECASE(PSTAMPTOOL_MODE_STOPDEPENDENTJOB, stopdependentjobMode);
    99103        MODECASE(PSTAMPTOOL_MODE_REVERTJOB, revertjobMode);
     104# if (0)
    100105        MODECASE(PSTAMPTOOL_MODE_ADDPROJECT, addprojectMode);
    101106        MODECASE(PSTAMPTOOL_MODE_MODPROJECT, modprojectMode);
     
    109114        MODECASE(PSTAMPTOOL_MODE_LISTFILE, listfileMode);
    110115        MODECASE(PSTAMPTOOL_MODE_DELETEFILE, deletefileMode);
     116# endif
    111117        default:
    112118            psAbort("invalid option (this should not happen)");
     
    693699static bool addjobMode(pxConfig *config)
    694700{
    695     bool    stampJob = false;
     701    bool stampJob = false;
    696702
    697703    PS_ASSERT_PTR_NON_NULL(config, false);
     
    739745        return false;
    740746    }
     747    if (stampJob) { /* do something?? */ }
     748
    741749    if (!pstampJobInsert(config->dbh,
    742750            0,          // job_id
     
    10441052    // it's an allowed arg because add_poll_args adds it
    10451053    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     1054    if (limit) { /* do something?? */ }
     1055
    10461056    PXOPT_LOOKUP_S16(fault, config->args, "-fault",  false, false);
    10471057
     
    10511061    psString faultClause = psStringCopy("");
    10521062    if (!fault) {
    1053         psStringAppend(&faultClause, " \nAND (pstampJob.fault < %d)", PSTAMP_FIRST_ERROR_CODE);
     1063        psStringAppend(&faultClause, " \nAND (pstampJob.fault < %d)", PSTAMP_FIRST_ERROR_CODE);
    10541064    }
    10551065
    10561066    psString query = pxDataGet("pstamptool_revertjob.sql");
    10571067    if (!psListLength(where->list) && !all) {
    1058         psFree(where);
    1059         psError(PXTOOLS_ERR_CONFIG, false, "search parameters or -all are required");
    1060         return false;
     1068        psFree(where);
     1069        psError(PXTOOLS_ERR_CONFIG, false, "search parameters or -all are required");
     1070        return false;
    10611071    }
    10621072    if (psListLength(where->list)) {
    1063         psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    1064         psStringAppend(&query, " AND %s", whereClause);
    1065         psFree(whereClause);
     1073        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     1074        psStringAppend(&query, " AND %s", whereClause);
     1075        psFree(whereClause);
    10661076    }
    10671077    psFree(where);
     
    10711081    psString faultCountClause = NULL;
    10721082    if (clear_fault_count) {
    1073         psStringAppend(&faultCountClause, "\n, pstampJob.fault_count = 0");
     1083        psStringAppend(&faultCountClause, "\n, pstampJob.fault_count = 0");
    10741084    } else {
    1075         psStringAppend(&query, " AND pstampJob.fault_count < %d", PSTAMP_MAX_JOB_FAULTS);
     1085        psStringAppend(&query, " AND pstampJob.fault_count < %d", PSTAMP_MAX_JOB_FAULTS);
    10761086    }
    10771087
    10781088    if (!p_psDBRunQueryF(config->dbh, query, faultCountClause, faultClause)) {
    1079         psFree(faultCountClause);
    1080         psFree(faultClause);
    1081         psFree(query);
    1082         psError(PS_ERR_UNKNOWN, false, "database error");
    1083         return false;
     1089        psFree(faultCountClause);
     1090        psFree(faultClause);
     1091        psFree(query);
     1092        psError(PS_ERR_UNKNOWN, false, "database error");
     1093        return false;
    10841094    }
    10851095
     
    10901100    return true;
    10911101}
     1102
     1103# if (0)
     1104// these are unused functions
    10921105static bool addprojectMode(pxConfig *config)
    10931106{
     
    11031116
    11041117    if (!pstampProjectInsert(config->dbh,
    1105             0,
    1106             name,
    1107             state,
    1108             imagedb,
    1109             dvodb,
    1110             camera,
    1111             telescope,
    1112             need_magic
    1113         )) {
     1118                             0,
     1119                             name,
     1120                             state,
     1121                             imagedb,
     1122                             dvodb,
     1123                             camera,
     1124                             telescope,
     1125                             need_magic
     1126            )) {
    11141127        psError(PS_ERR_UNKNOWN, false, "database error");
    11151128        return false;
     
    14481461    // it's an allowed arg because add_poll_args adds it
    14491462    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     1463    if (limit) { /* do something?? */ }
    14501464
    14511465    if (!psListLength(where->list)) {
     
    16281642    return true;
    16291643}
     1644# endif
Note: See TracChangeset for help on using the changeset viewer.