IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34089 for trunk/psLib


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

changes to support pedantic gcc warnings; add configure option for debug-build and no-as-needed

Location:
trunk/psLib
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/configure.ac

    r29542 r34089  
    2727AC_SUBST(PSLIB_LT_VERSION,$PSLIB_LT_VERSION)
    2828
    29 IPP_STDCFLAGS
     29IPP_STDLDFLAGS
    3030
    3131dnl ------------------- PERL options ---------------------
     
    473473dnl ------- enable -Werror after all of the probes have run ---------
    474474IPP_STDOPTS
    475 
    476 CFLAGS="${CFLAGS} -Wall -Werror"
    477 dnl enable POSIX/XSI and C99 compliance
     475IPP_STDCFLAGS
    478476CFLAGS="${CFLAGS=} -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L"
    479477
  • trunk/psLib/m4/ipp_stdopts.m4

    r23793 r34089  
    11
     2dnl IPP_STDCFLAGS must go *after* external probes (to avoid Werror confusing things)
    23AC_DEFUN([IPP_STDCFLAGS],
    34[
     5    dnl this section currently overrides a user-defined CFLAGS
    46    AC_ARG_ENABLE(optimize,
    57      [AS_HELP_STRING(--enable-optimize,enable compiler optimization)],
     
    1214      ]
    1315    )
     16    dnl this section accepts a user-defined CFLAGS, and sets CFLAGS to the empty string if not present
     17    AC_ARG_ENABLE(debug-build,
     18      [AS_HELP_STRING(--enable-debug-build,enable debug build: ie disable Werror)],
     19      [AC_MSG_RESULT(debug build enabled)
     20        if test x"${CFLAGS}" == x; then
     21          CFLAGS="-Wall"
     22        else
     23          CFLAGS="${CFLAGS=} -Wall"
     24        fi
     25      ],
     26      [AC_MSG_RESULT([compile optimization disabled])
     27        if test x"${CFLAGS}" == x; then
     28          CFLAGS="-Wall -Werror"
     29        else
     30          CFLAGS="${CFLAGS=} -Wall -Werror"
     31        fi
     32      ]
     33    )
    1434])
     35
     36dnl IPP_STDLDFLAGS must go *before* external probes (so linking is done with --no-as-needed if needed)
     37AC_DEFUN([IPP_STDLDFLAGS],
     38[
     39    dnl this section accepts a user-defined LDFLAGS, and sets LDFLAGS to the empty string if not present
     40    AC_ARG_ENABLE(no-as-needed,
     41      [AS_HELP_STRING(--enable-no-as-needed, prevent as-needed option sometimes supplied to gcc such as Ubuntu after 11.11)],
     42      [AC_MSG_RESULT(no-as-needed passed to linker)
     43        if test x"${LDFLAGS}" == x; then
     44          LDFLAGS="-Wl,--no-as-needed"
     45        else
     46          LDFLAGS="${LDFLAGS=} -Wl,--no-as-needed"
     47        fi
     48      ],
     49      [AC_MSG_RESULT(as-needed linker flags accepted)
     50        if test x"${LDFLAGS}" == x; then
     51          LDFLAGS=""
     52        fi
     53      ]
     54    )
     55])
     56dnl
    1557
    1658AC_DEFUN([IPP_STDOPTS],
  • trunk/psLib/src/astro/psTime.c

    r30724 r34089  
    223223static bool timeInit(const char *fileName)
    224224{
    225     psS32 numLines = 0;
    226225    bool foundTable = false;
    227226    char *tableDir = NULL;
     
    390389        if (i < numTables) {
    391390            table = psLookupTableAlloc(fullTableName, (const char*)tableFormat, tablesIndex->data.S32[i]);
    392             numLines = psLookupTableRead(table);
     391            psLookupTableRead(table);
    393392        } else {
    394393            psError(PS_ERR_BAD_PARAMETER_VALUE, no_problem,
  • trunk/psLib/src/fits/psFitsTable.c

    r31152 r34089  
    511511                colSpec *spec = psAlloc(sizeof(colSpec)); // Specification for this column
    512512                // BOOL type is not a valid vector type, so we translate it to U8
    513                 spec->type = colItem->type == PS_TYPE_BOOL ? PS_TYPE_U8 : colItem->type;
     513                spec->type = colItem->type == PS_DATA_BOOL ? PS_DATA_U8 : colItem->type;
    514514                spec->size = size;
    515515                if (colItem->type == PS_DATA_VECTOR) {
     
    526526                }
    527527                if (colItem->type != spec->type &&
    528                     colItem->type != PS_TYPE_BOOL && spec->type != PS_TYPE_U8) {
     528                    colItem->type != PS_DATA_BOOL && spec->type != PS_DATA_U8) {
    529529                    psWarning("Differing type found for column %s: %x vs %x --- using the first found.\n",
    530530                              colSpecItem->name, colItem->type, spec->type);
  • trunk/psLib/src/imageops/psImageGeomManip.c

    r31446 r34089  
    580580    psS32 outRows;
    581581    psS32 outCols;
    582     psS32 elementSize;
    583582    psElemType type;
    584583
     
    594593    outCols = input->numCols;
    595594    type = input->type.type;
    596     elementSize = PSELEMTYPE_SIZEOF(type);
     595    // XXX unused psS32 elementSize = PSELEMTYPE_SIZEOF(type);
    597596    out = psImageRecycle(out, outCols, outRows, type);
    598597
  • trunk/psLib/src/imageops/psImageInterpolate.c

    r31446 r34089  
    461461    }
    462462
     463#define INTERPOLATE_CHECK() \
     464    if (xMin < 0) { /* XXX warn or error? */ } \
     465    if (yMin < 0) { /* XXX warn or error? */ } \
     466    if (xMax >= image->numCols) { /* XXX warn or error? */ } \
     467    if (yMax >= image->numRows) { /* XXX warn or error? */ } \
     468
    463469// Determine the result of the interpolation after all the math has been done
    464470static psImageInterpolateStatus interpolateResult(const psImageInterpolation *interp,
     
    523529    }
    524530    INTERPOLATE_RANGE();
     531    INTERPOLATE_CHECK();
    525532
    526533    // Get the appropriate kernels
     
    779786    }
    780787    INTERPOLATE_RANGE();
     788    INTERPOLATE_CHECK();
    781789
    782790    // Get the appropriate kernels
     
    989997    INTERPOLATE_SETUP(x, y);
    990998    xExact = yExact = false;
     999    if (xExact && yExact) { /* possible alternative */ }
    9911000
    9921001    psF32 xKernel[size], yKernel[size]; // Interpolation kernels
     
    10381047    INTERPOLATE_SETUP(x, y);
    10391048    xExact = yExact = false;
     1049    if (xExact && yExact) { /* possible alternative */ }
    10401050
    10411051    psF32 xKernel[size], yKernel[size]; // Interpolation kernels
  • trunk/psLib/src/imageops/psImageStructManip.c

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

    r28998 r34089  
    367367    psF32 c = 0.0;
    368368    psF32 n = 0.0;
    369     psF32 fa = 0.0;
    370     psF32 fb = 0.0;
    371     psF32 fc = 0.0;
    372369    psF32 fn = 0.0;
    373370    psF32 mul = 0.0;
     
    415412        PS_VECTOR_ADD_MULTIPLE(params, paramMask, line, tmpb, b);
    416413        PS_VECTOR_ADD_MULTIPLE(params, paramMask, line, tmpc, c);
    417         fa = func(tmpa, coords);
    418         fb = func(tmpb, coords);
    419         fc = func(tmpc, coords);
     414        psF32 fb = func(tmpb, coords);
     415# if (PS_TRACE_ON)
     416        psF32 fa = func(tmpa, coords);
     417        psF32 fc = func(tmpc, coords);
    420418        psTrace("psLib.math", 6, "LineMin: f(%f %f %f) is (%f %f %f)\n", a, b, c, fa, fb, fc);
     419# endif
    421420
    422421        // We determine which is the biggest segment in [a,b,c] then split
  • trunk/psLib/src/mathtypes/psVector.c

    r26892 r34089  
    322322            PSVECTOR_COPY_SAME_CASE(F32);
    323323            PSVECTOR_COPY_SAME_CASE(F64);
    324         default: {
    325                 char* typeStr;
    326                 PS_TYPE_NAME(typeStr,type);
    327                 psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    328                         //                        _("Input psVector is an unsupported type (0x%x)."), typeStr);
    329                         "Input psVector is an unsupported type.\n");
    330                 psFree(output);
    331                 return NULL;
    332             }
     324          default: {
     325              psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Input psVector is an unsupported type.\n");
     326              psFree(output);
     327              return NULL;
     328          }
    333329        }
    334330        return output;
  • trunk/psLib/src/types/psLookupTable.c

    r27774 r34089  
    607607    psU64 loIdx = 0;
    608608    long  numRows = 0;
    609     long numCols = 0;
    610609    psF64 out = 0.0;
    611610    psF64 denom = 0.0;
     
    619618    values = table->values;
    620619    numRows = table->index->n;
    621     numCols = table->values->n;
    622620    valuesVec = (psVector*)values->data[column];
    623621
  • trunk/psLib/src/types/psMetadata.c

    r30024 r34089  
    15041504              fprintf(fd, "\n");
    15051505              break;
    1506             case PS_DATA_UNKNOWN:
    15071506            default:
    15081507              fprintf(fd, "<Unsupported type>\n");
  • trunk/psLib/src/types/psMetadataConfig.c

    r31902 r34089  
    15731573            }
    15741574            break;
    1575         case PS_DATA_UNKNOWN:
    15761575        default:
    15771576            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
  • trunk/psLib/src/types/psMetadataItemCompare.c

    r20479 r34089  
    129129  case PS_TYPE_##COMPARETYPENAME: { \
    130130      TEMPLATETYPE valueC = (TEMPLATETYPE)compare->data.COMPARENAME; \
    131       TEMPLATETYPE valueT = (TEMPLATETYPE)template->data.TEMPLATENAME; \
    132       /* XXX check the validiy of the type casting? */ \
    133       if (valueC != compare->data.COMPARENAME) { \
    134           return false; \
    135       } \
    136       COMPARE_VALUES(valueT, valueC, (template->type == PS_TYPE_F32 || template->type == PS_TYPE_F64)); \
     131      TEMPLATETYPE valueT = (TEMPLATETYPE)template->data.TEMPLATENAME;  \
     132      /* XXX check the validiy of the type casting? */                  \
     133      if (valueC != compare->data.COMPARENAME) {                        \
     134        return false;                                                   \
     135      }                                                                 \
     136      COMPARE_VALUES(valueT, valueC, (template->type == PS_DATA_F32 || template->type == PS_DATA_F64)); \
     137      /* COMPARE_VALUES(valueT, valueC, 1);                             */  \
    137138      psAbort("Should never reach here."); \
    138139  }
     
    277278                    return false;
    278279                }
    279                 double compareValue = compare->type == PS_TYPE_F32 ? compare->data.F32 : compare->data.F64;
     280                double compareValue = compare->type == PS_DATA_F32 ? compare->data.F32 : compare->data.F64;
    280281                COMPARE_VALUES(templateValue, compareValue, true);
    281282            }
  • trunk/psLib/test/tap/src/tap.c

    r8958 r34089  
    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
Note: See TracChangeset for help on using the changeset viewer.