IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26504


Ignore:
Timestamp:
Jan 4, 2010, 10:02:37 AM (16 years ago)
Author:
eugene
Message:

on free (not just decrement), set the pointer to NULL in the psFree macro; cast the pointer supplied to psFree to (void *) in case we are supplied a const pointer; in cases where we were casting away a const to pass it to psFree, drop this cast (it breaks the assignement code); change the arguments for several functions where parameter is claimed as const, but is not really const (ie, it may be freed)

Location:
branches/eam_branches/20091201/psLib/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psLib/src/imageops/psImageInterpolate.c

    r23231 r26504  
    197197{
    198198    // Casting away const
    199     psFree((psImage*)interp->image);
    200     psFree((psImage*)interp->mask);
    201     psFree((psImage*)interp->variance);
    202     psFree((psImage*)interp->kernel);
    203     psFree((psImage*)interp->kernel2);
    204     psFree((psVector*)interp->sumKernel2);
     199    psFree(interp->image);
     200    psFree(interp->mask);
     201    psFree(interp->variance);
     202    psFree(interp->kernel);
     203    psFree(interp->kernel2);
     204    psFree(interp->sumKernel2);
    205205}
    206206
  • branches/eam_branches/20091201/psLib/src/math/psBinaryOp.c

    r17050 r26504  
    379379}
    380380
    381 psMathType* psBinaryOp(psPtr out, const psPtr in1, const char *op, const psPtr in2)
     381psMathType* psBinaryOp(psPtr out, psPtr in1, const char *op, psPtr in2)
    382382{
    383383
  • branches/eam_branches/20091201/psLib/src/math/psBinaryOp.h

    r11248 r26504  
    5555psMathType* psBinaryOp(
    5656    psPtr out,                         ///< Output type, either psImage or psVector.
    57     const psPtr in1,                   ///< First input, either psImage or psVector.
     57    psPtr in1,                   ///< First input, either psImage or psVector.
    5858    const char *op,                    ///< Operator.
    59     const psPtr in2                    ///< Second input, either psImage or psVector.
     59    psPtr in2                    ///< Second input, either psImage or psVector.
    6060);
    6161
  • branches/eam_branches/20091201/psLib/src/math/psHistogram.c

    r21183 r26504  
    127127static void histogramFree(psHistogram* myHist)
    128128{
    129     psFree((void *)myHist->bounds);
     129    psFree(myHist->bounds);
    130130    psFree(myHist->nums);
    131131}
  • branches/eam_branches/20091201/psLib/src/math/psUnaryOp.c

    r17050 r26504  
    211211}
    212212
    213 psMathType* psUnaryOp(psPtr out, const psPtr in, const char *op)
     213psMathType* psUnaryOp(psPtr out, psPtr in, const char *op)
    214214{
    215215    #define psUnaryOp_EXIT { \
  • branches/eam_branches/20091201/psLib/src/math/psUnaryOp.h

    r11248 r26504  
    5959psMathType* psUnaryOp(
    6060    psPtr out,                         ///< Output type, either psImage or psVector.
    61     const psPtr in,                    ///< Input, either psImage or psVector.
     61    psPtr in,                          ///< Input, either psImage or psVector.
    6262    const char *op                     ///< Operator.
    6363);
  • branches/eam_branches/20091201/psLib/src/sys/psMemory.h

    r23305 r26504  
    336336#ifndef SWIG
    337337#define psFree(ptr) \
    338         psMemDecrRefCounter(ptr)
     338    ptr = psMemDecrRefCounter((void *)ptr);
    339339#endif // ifndef SWIG
    340340#endif // ifdef DOXYGEN
  • branches/eam_branches/20091201/psLib/src/sys/psTrace.c

    r20546 r26504  
    119119
    120120    psMemSetPersistent((psPtr)comp->name,false);
    121     psFree((void *)comp->name);
     121    psFree(comp->name);
    122122}
    123123
  • branches/eam_branches/20091201/psLib/src/types/psArray.c

    r15714 r26504  
    166166// drop an item from the array and free it
    167167bool psArrayRemoveData(psArray* array,
    168                        const psPtr data)
     168                       psPtr data)
    169169{
    170170    PS_ASSERT_ARRAY_NON_NULL(array, false);
  • branches/eam_branches/20091201/psLib/src/types/psArray.h

    r19056 r26504  
    186186bool psArrayRemoveData(
    187187    psArray* array,                    ///< array to operate on
    188     const psPtr data                   ///< the data pointer to remove from psArray
     188    psPtr data                         ///< the data pointer to remove from psArray
    189189);
    190190
Note: See TracChangeset for help on using the changeset viewer.