IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 22, 2012, 6:52:56 AM (14 years ago)
Author:
eugene
Message:

changes to satisfy more pedantic gcc

Location:
branches/eam_branches/ipp-20120601
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120601/Nebulous/nebclient/tests/tap/src/tap.c

    r12605 r34052  
    8787    if(test_name != NULL) {
    8888        va_start(ap, test_name);
    89         vasprintf(&local_test_name, test_name, ap);
     89        int status = vasprintf(&local_test_name, test_name, ap);
     90        if (status) {/* warning? */}
    9091        va_end(ap);
    9192
     
    303304
    304305    va_start(ap, fmt);
    305     asprintf(&skip_msg, fmt, ap);
     306    int status = asprintf(&skip_msg, fmt, ap);
     307    if (status) {/* warning? */}
    306308    va_end(ap);
    307309
     
    328330
    329331    va_start(ap, fmt);
    330     vasprintf(&todo_msg, fmt, ap);
     332    int status = vasprintf(&todo_msg, fmt, ap);
     333    if (status) {/* warning? */}
    331334    va_end(ap);
    332335
  • branches/eam_branches/ipp-20120601/ippTools/src/pstamptool.c

    r34051 r34052  
    10461046    // it's an allowed arg because add_poll_args adds it
    10471047    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    1048     if (limit) { /* do something?? */
     1048    if (limit) { /* do something?? */ }
    10491049
    10501050    PXOPT_LOOKUP_S16(fault, config->args, "-fault",  false, false);
     
    10551055    psString faultClause = psStringCopy("");
    10561056    if (!fault) {
    1057         psStringAppend(&faultClause, " \nAND (pstampJob.fault < %d)", PSTAMP_FIRST_ERROR_CODE);
     1057        psStringAppend(&faultClause, " \nAND (pstampJob.fault < %d)", PSTAMP_FIRST_ERROR_CODE);
    10581058    }
    10591059
    10601060    psString query = pxDataGet("pstamptool_revertjob.sql");
    10611061    if (!psListLength(where->list) && !all) {
    1062         psFree(where);
    1063         psError(PXTOOLS_ERR_CONFIG, false, "search parameters or -all are required");
    1064         return false;
     1062        psFree(where);
     1063        psError(PXTOOLS_ERR_CONFIG, false, "search parameters or -all are required");
     1064        return false;
    10651065    }
    10661066    if (psListLength(where->list)) {
    1067         psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    1068         psStringAppend(&query, " AND %s", whereClause);
    1069         psFree(whereClause);
     1067        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     1068        psStringAppend(&query, " AND %s", whereClause);
     1069        psFree(whereClause);
    10701070    }
    10711071    psFree(where);
     
    10751075    psString faultCountClause = NULL;
    10761076    if (clear_fault_count) {
    1077         psStringAppend(&faultCountClause, "\n, pstampJob.fault_count = 0");
     1077        psStringAppend(&faultCountClause, "\n, pstampJob.fault_count = 0");
    10781078    } else {
    1079         psStringAppend(&query, " AND pstampJob.fault_count < %d", PSTAMP_MAX_JOB_FAULTS);
     1079        psStringAppend(&query, " AND pstampJob.fault_count < %d", PSTAMP_MAX_JOB_FAULTS);
    10801080    }
    10811081
    10821082    if (!p_psDBRunQueryF(config->dbh, query, faultCountClause, faultClause)) {
    1083         psFree(faultCountClause);
    1084         psFree(faultClause);
    1085         psFree(query);
    1086         psError(PS_ERR_UNKNOWN, false, "database error");
    1087         return false;
     1083        psFree(faultCountClause);
     1084        psFree(faultClause);
     1085        psFree(query);
     1086        psError(PS_ERR_UNKNOWN, false, "database error");
     1087        return false;
    10881088    }
    10891089
     
    10941094    return true;
    10951095}
     1096
    10961097static bool addprojectMode(pxConfig *config)
    10971098{
     
    11071108
    11081109    if (!pstampProjectInsert(config->dbh,
    1109             0,
    1110             name,
    1111             state,
    1112             imagedb,
    1113             dvodb,
    1114             camera,
    1115             telescope,
    1116             need_magic
    1117         )) {
     1110                             0,
     1111                             name,
     1112                             state,
     1113                             imagedb,
     1114                             dvodb,
     1115                             camera,
     1116                             telescope,
     1117                             need_magic
     1118            )) {
    11181119        psError(PS_ERR_UNKNOWN, false, "database error");
    11191120        return false;
  • branches/eam_branches/ipp-20120601/ppBackground/src/ppBackgroundExit.c

    r28288 r34052  
    1010    }
    1111
    12     psErrorCode errorCode = psErrorCodeLast(); // Error code
     12    // gcc -Wswitch complains here if err is declared as type psErrorCode
     13    // the collection of ps*ErrorCode values are enums defined separately for
     14    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
     15    // not include the possible psphot values
     16
     17    // for now, to get around this, we just use an int for the switch
     18
     19    // psErrorCode errorCode = psErrorCodeLast(); // Error code
     20    int errorCode = psErrorCodeLast(); // Error code
     21
    1322    if (errorCode != PS_ERR_NONE) {
    1423        pmFPAfileFreeSetStrict(false);
  • branches/eam_branches/ipp-20120601/ppStack/src/ppStackConvolve.c

    r32170 r34052  
    77        psMetadataItem *item = psMetadataLookup(SOURCE->concepts, NAME); \
    88        psAssert(item, "Concept should be present");                    \
    9         psAssert(item->type == PS_TYPE_F32, "Concept should be F32");   \
     9        psAssert(item->type == PS_DATA_F32, "Concept should be F32");   \
    1010        item->data.F32 = VALUE;                                         \
    1111    }
     
    101101        if (!ppStackMatch(readout, target, options, i, config)) {
    102102            // XXX many things can cause a failure of ppStackMatch -- should some be handled differently?
    103             psErrorCode error = psErrorCodeLast(); // Error code
     103
     104            // gcc -Wswitch complains here if err is declared as type psErrorCode
     105            // the collection of ps*ErrorCode values are enums defined separately for
     106            // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
     107            // not include the possible psphot values
     108
     109            // for now, to get around this, we just use an int for the switch
     110
     111            // psErrorCode error = psErrorCodeLast(); // Error code
     112            int error = psErrorCodeLast(); // Error code
    104113            switch (error) {
    105114                // Fatal errors
  • branches/eam_branches/ipp-20120601/ppStack/src/ppStackFinish.c

    r30620 r34052  
    4545    }
    4646
    47     psErrorCode errorCode = psErrorCodeLast(); // Error code
     47    // gcc -Wswitch complains here if err is declared as type psErrorCode
     48    // the collection of ps*ErrorCode values are enums defined separately for
     49    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
     50    // not include the possible psphot values
     51
     52    // for now, to get around this, we just use an int for the switch
     53
     54    // psErrorCode errorCode = psErrorCodeLast(); // Error code
     55    int errorCode = psErrorCodeLast(); // Error code
    4856    if (errorCode == PS_ERR_NONE) {
    4957        return exitValue;
  • branches/eam_branches/ipp-20120601/ppStack/src/ppStackTarget.c

    r30620 r34052  
    191191
    192192        float norm = powf(10.0, -0.4 * options->norm->data.F32[i]); // Normalisation from stars
    193         float meanVariance = bg->robustMedian * PS_SQR(norm);       // Mean variance in normalised image
     193        float meanVariance = mean * PS_SQR(norm);       // Mean variance in normalised image
    194194
    195195        if (meanVariance < minVariance) {
  • branches/eam_branches/ipp-20120601/ppSub/src/ppSubExit.c

    r27719 r34052  
    1111    }
    1212
    13     psErrorCode errorCode = psErrorCodeLast(); // Error code
     13    // gcc -Wswitch complains here if err is declared as type psErrorCode
     14    // the collection of ps*ErrorCode values are enums defined separately for
     15    // each module (psphot, pswarp, etc).  the lowest type, psErrorCode is only the base set and does
     16    // not include the possible psphot values
     17
     18    // for now, to get around this, we just use an int for the switch
     19
     20    // psErrorCode errorCode = psErrorCodeLast(); // Error code
     21    int errorCode = psErrorCodeLast(); // Error code
    1422    if (errorCode != PS_ERR_NONE) {
    1523        pmFPAfileFreeSetStrict(false);
  • branches/eam_branches/ipp-20120601/ppSub/src/ppSubMatchPSFs.c

    r32676 r34052  
    266266        if (!detections->allSources) {
    267267            psFree(detections);
    268             psErrorCode error = psErrorCodeLast(); // Error code
     268            int error = psErrorCodeLast(); // Error code
    269269            if (error == PM_ERR_OBJECTS) {
    270270                psErrorStackPrint(stderr, "Unable to match source lists");
     
    439439
    440440    if (!success) {
    441         psErrorCode error = psErrorCodeLast(); // Error code
     441        int error = psErrorCodeLast(); // Error code
    442442        if (error == PM_ERR_STAMPS) {
    443443            psErrorStackPrint(stderr, "Unable to find stamps");
  • branches/eam_branches/ipp-20120601/psLib/src/imageops/psImageInterpolate.c

    r34045 r34052  
    997997    INTERPOLATE_SETUP(x, y);
    998998    xExact = yExact = false;
     999    if (xExact && yExact) { /* possible alternative */ }
    9991000
    10001001    psF32 xKernel[size], yKernel[size]; // Interpolation kernels
     
    10461047    INTERPOLATE_SETUP(x, y);
    10471048    xExact = yExact = false;
     1049    if (xExact && yExact) { /* possible alternative */ }
    10481050
    10491051    psF32 xKernel[size], yKernel[size]; // Interpolation kernels
  • branches/eam_branches/ipp-20120601/psLib/src/imageops/psImageStructManip.c

    r21347 r34052  
    212212    elementSize = PSELEMTYPE_SIZEOF(inDatatype);
    213213
     214    if (0) { fprintf (stderr, "%d elements, %d total memory\n", elements, elements * elementsSize); }
     215
    214216    output = p_psImageRecycle(file, lineno, func, output, numCols, numRows, type);
    215217    P_PSIMAGE_SET_COL0(output, input->col0);
  • branches/eam_branches/ipp-20120601/psLib/test/tap/src/tap.c

    r8958 r34052  
    8787    if(test_name != NULL) {
    8888        va_start(ap, test_name);
    89         vasprintf(&local_test_name, test_name, ap);
     89        int status = vasprintf(&local_test_name, test_name, ap);
     90        if (status) {/* warning? */}
    9091        va_end(ap);
    9192
     
    303304
    304305    va_start(ap, fmt);
    305     asprintf(&skip_msg, fmt, ap);
     306    int status = asprintf(&skip_msg, fmt, ap);
     307    if (status) {/* warning? */}
    306308    va_end(ap);
    307309
     
    328330
    329331    va_start(ap, fmt);
    330     vasprintf(&todo_msg, fmt, ap);
     332    int status = vasprintf(&todo_msg, fmt, ap);
     333    if (status) {/* warning? */}
    331334    va_end(ap);
    332335
  • branches/eam_branches/ipp-20120601/psModules/src/detrend/pmFringeStats.c

    r31069 r34052  
    662662        if (item->type == PS_DATA_VECTOR) { \
    663663            ARRAY->data[i] = psMemIncrRefCounter(item->data.V); \
    664         } else if (item->type == PS_TYPE_##TYPE) { \
     664        } else if (item->type == PS_DATA_##TYPE) { \
    665665            psVector *vector = psVectorAlloc(1, PS_TYPE_##TYPE); \
    666666            vector->data.TYPE[0] = item->data.TYPE; \
  • branches/eam_branches/ipp-20120601/psModules/src/detrend/pmNonLinear.c

    r34044 r34052  
    329329
    330330    bin = correction_fluxes->n - 1;
     331    psTrace("psModules.nonlin",6,"NLMN: %f %d %f %f\n",flux,bin,correction_fluxes->data.F32[0],correction_fluxes->data.F32[bin]);
     332    if (bin < 0) { /* warn? */ }
    331333    if (flux < correction_fluxes->data.F32[0]) {
    332334        return(0.0);
     
    357359    bin = correction_fluxes->n - 1;
    358360    psTrace("psModules.nonlin",6,"NLMN: %f %d %f %f\n",flux,bin,correction_fluxes->data.F32[0],correction_fluxes->data.F32[bin]);
     361    if (bin < 0) { /* warn? */ }
    359362    if (flux < correction_fluxes->data.F32[0]) {
    360363        return(0.0);
  • branches/eam_branches/ipp-20120601/psModules/src/extras/psPipe.c

    r34051 r34052  
    105105
    106106        status = execvp (argv[0], argv);
    107         psWarning ("error running exec for child process");
     107        if (status < 0) { psWarning ("error running exec for child process"); }
    108108        exit (1); // this statement exits the child, not the parent, process
    109109    }
  • branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_PGAUSS.c

    r32347 r34052  
    261261{
    262262    psF64 z;
    263     int Nstep = 0;
    264263    psEllipseShape shape;
    265264
     
    285284    // use the fact that f is monotonically decreasing
    286285    z = 0;
    287     Nstep = 0;
    288286
    289287    // choose a z value guaranteed to be beyond our limit
  • branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_PS1_V1.c

    r32347 r34052  
    283283{
    284284    psF64 z;
    285     int Nstep = 0;
    286285    psEllipseShape shape;
    287286
     
    308307    // use the fact that f is monotonically decreasing
    309308    z = 0;
    310     Nstep = 0;
    311309
    312310    // choose a z value guaranteed to be beyond our limit
  • branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_QGAUSS.c

    r33417 r34052  
    284284{
    285285    psF64 z;
    286     int Nstep = 0;
    287286    psEllipseShape shape;
    288287
     
    312311    // use the fact that f is monotonically decreasing
    313312    z = 0;
    314     Nstep = 0;
    315313
    316314    // choose a z value guaranteed to be beyond our limit
  • branches/eam_branches/ipp-20120601/psModules/src/objects/models/pmModel_RGAUSS.c

    r32347 r34052  
    273273{
    274274    psF64 z;
    275     int Nstep = 0;
    276275    psEllipseShape shape;
    277276
     
    296295    // use the fact that f is monotonically decreasing
    297296    z = 0;
    298     Nstep = 0;
    299297
    300298    // choose a z value guaranteed to be beyond our limit
  • branches/eam_branches/ipp-20120601/psModules/src/objects/pmSourceIO_CMP.c

    r34044 r34052  
    184184    }
    185185
    186     // find config information for output header
    187     float ZERO_POINT = psMetadataLookupF32 (&status, header, "ZERO_PT");
    188     if (!status)
    189         ZERO_POINT = 25.0;
     186    // XXX unused // find config information for output header
     187    // XXX unused float ZERO_POINT = psMetadataLookupF32 (&status, header, "ZERO_PT");
     188    // XXX unused if (!status)
     189    // XXX unused     ZERO_POINT = 25.0;
    190190
    191191    // how many lines in the header?
  • branches/eam_branches/ipp-20120601/psModules/test/tap/src/tap.c

    r11550 r34052  
    8787    if(test_name != NULL) {
    8888        va_start(ap, test_name);
    89         vasprintf(&local_test_name, test_name, ap);
     89        int status = vasprintf(&local_test_name, test_name, ap);
     90        if (status) {/* warning? */}
    9091        va_end(ap);
    9192
     
    303304
    304305    va_start(ap, fmt);
    305     asprintf(&skip_msg, fmt, ap);
     306    int status = asprintf(&skip_msg, fmt, ap);
     307    if (status) {/* warning? */}
    306308    va_end(ap);
    307309
     
    328330
    329331    va_start(ap, fmt);
    330     vasprintf(&todo_msg, fmt, ap);
     332    int status = vasprintf(&todo_msg, fmt, ap);
     333    if (status) {/* warning? */}
    331334    va_end(ap);
    332335
  • branches/eam_branches/ipp-20120601/pswarp/src/pswarpExit.c

    r34051 r34052  
    1919        return exitValue;
    2020    }
    21 
    2221
    2322    // gcc -Wswitch complains here if err is declared as type psErrorCode
Note: See TracChangeset for help on using the changeset viewer.