IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11707


Ignore:
Timestamp:
Feb 8, 2007, 11:29:50 AM (19 years ago)
Author:
jhoblitt
Message:

change psPixel*Alloc() functions to pass in file/lineno/func
whitespace fixes

Location:
trunk/psLib/src/types
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psPixels.c

    r10999 r11707  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2007-01-09 22:38:53 $
     9 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2007-02-08 21:29:50 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5858}
    5959
    60 psPixels* psPixelsAlloc(long nalloc)
    61 {
    62     psPixels* out = psAlloc(sizeof(psPixels));
     60psPixels* p_psPixelsAlloc(const char *file,
     61                          unsigned int lineno,
     62                          const char *func,
     63                          long nalloc)
     64{
     65    psPixels* out = p_psAlloc(file, lineno, func, sizeof(psPixels));
    6366
    6467    if (nalloc > 0) {
    65         out->data = psAlloc(sizeof(psPixelCoord)*nalloc);
     68        out->data = p_psAlloc(file, lineno, func, sizeof(psPixelCoord)*nalloc);
    6669    } else {
    6770        out->data = NULL;
     
    8386
    8487
    85 psPixels* psPixelsRealloc(psPixels* pixels,
    86                           long nalloc)
    87 {
    88     if (pixels == NULL) {
    89         return psPixelsAlloc(nalloc);
     88psPixels* p_psPixelsRealloc(const char *file,
     89                            unsigned int lineno,
     90                            const char *func,
     91                            psPixels* pixels,
     92                            long nalloc)
     93{
     94    if (pixels == NULL) {
     95        return p_psPixelsAlloc(file, lineno, func, nalloc);
    9096    }
    9197
    9298    if (nalloc > 0) {
    93         pixels->data = psRealloc(pixels->data, sizeof(psPixelCoord)*nalloc);
     99        pixels->data = p_psRealloc(file, lineno, func, pixels->data, sizeof(psPixelCoord)*nalloc);
    94100    } else {
    95101        psFree(pixels->data);
     
    129135}
    130136
    131 psPixels* psPixelsCopy(psPixels* out,
    132                        const psPixels* pixels)
     137psPixels* p_psPixelsCopy(const char *file,
     138                         unsigned int lineno,
     139                         const char *func,
     140                         psPixels* out,
     141                         const psPixels* pixels)
    133142{
    134143    if (pixels == NULL) {
     
    138147    }
    139148
    140     out = psPixelsRealloc(out, pixels->n);
     149    out = p_psPixelsRealloc(file, lineno, func, out, pixels->n);
    141150
    142151    memcpy(out->data,pixels->data, pixels->n*sizeof(psPixelCoord));
  • trunk/psLib/src/types/psPixels.h

    r11248 r11707  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-01-23 22:47:23 $
     8 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-02-08 21:29:50 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5252
    5353
    54         /** Allocates a new psPixels structure
    55          *
    56          *  @return psPixels*   new psPixels
    57          */
    58         psPixels* psPixelsAlloc(
    59             long nalloc                       ///< the size of the coordinate vectors
    60         )
    61         ;
     54/** Allocates a new psPixels structure
     55 *
     56 *  @return psPixels*   new psPixels
     57 */
     58#ifdef DOXYGEN
     59psPixels* psPixelsAlloc(
     60    long nalloc                         ///< the size of the coordinate vectors
     61);
     62#else // ifdef DOXYGEN
     63psPixels* p_psPixelsAlloc(
     64    const char *file,                   ///< File of caller
     65    unsigned int lineno,                ///< Line number of caller
     66    const char *func,                   ///< Function name of caller
     67    long nalloc                         ///< the size of the coordinate vectors
     68);
     69#define psPixelsAlloc(nalloc) \
     70      p_psPixelsAlloc(__FILE__, __LINE__, __func__, nalloc)
     71#endif // ifdef DOXYGEN
     72
    6273
    6374/** Checks the type of a particular pointer.
    6475 *
    65  *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     76 *  Uses the appropriate deallocation function in psMemBlock to check the ptr
     77 *  datatype.
    6678 *
    6779 *  @return bool:       True if the pointer matches a psPixels structure, false otherwise.
     
    7688 *  @return psPixels*   resized psPixels
    7789 */
     90#ifdef DOXYGEN
    7891psPixels* psPixelsRealloc(
    7992    psPixels* pixels,                  ///< psPixels to resize, or NULL to create new psPixels
    8093    long nalloc                        ///< the size of the coordinate vectors
    8194);
     95#else // ifdef DOXYGEN
     96psPixels* p_psPixelsRealloc(
     97    const char *file,                   ///< File of caller
     98    unsigned int lineno,                ///< Line number of caller
     99    const char *func,                   ///< Function name of caller
     100    psPixels* pixels,                  ///< psPixels to resize, or NULL to create new psPixels
     101    long nalloc                        ///< the size of the coordinate vectors
     102);
     103#define psPixelsRealloc(pixels, nalloc) \
     104      p_psPixelsRealloc(__FILE__, __LINE__, __func__, pixels, nalloc)
     105#endif // ifdef DOXYGEN
     106
    82107
    83108/** Add a pixel location to a psPixels
     
    95120);
    96121
     122
    97123/** Copies a psPixels object
    98124 *
     
    102128 *  @return psPixels*   a new psPixels that is a duplicate to IN
    103129 */
     130#ifdef DOXYGEN
    104131psPixels* psPixelsCopy(
    105132    psPixels* out,                     ///< psPixels struct to recycle, or NULL
    106133    const psPixels* pixels             ///< psPixels struct to copy
    107134);
     135#else // ifdef DOXYGEN
     136psPixels* p_psPixelsCopy(
     137    const char *file,                   ///< File of caller
     138    unsigned int lineno,                ///< Line number of caller
     139    const char *func,                   ///< Function name of caller
     140    psPixels* out,                     ///< psPixels struct to recycle, or NULL
     141    const psPixels* pixels             ///< psPixels struct to copy
     142);
     143#define psPixelsCopy(out, pixels) \
     144      p_psPixelsCopy(__FILE__, __LINE__, __func__, out, pixels)
     145#endif // ifdef DOXYGEN
     146
    108147
    109148/** Generate a psImage from a psPixels
     
    126165);
    127166
     167
    128168/** Generate a psPixels from a mask psImage
    129169 *
     
    140180    psMaskType maskVal                 ///< the mask bit-values to act upon
    141181);
     182
    142183
    143184/** Concatenates two psPixels
     
    155196    const psPixels *pixels             ///< psPixels to append to OUT
    156197);
     198
    157199
    158200/** Prints a psPixels to specified destination.
     
    166208);
    167209
     210
    168211/** Sets the value of the the pixels array at the specified position to value.
    169212 *
     
    178221);
    179222
     223
    180224/** Returns the value of the pixels array at the specified position.
    181225 *
     
    189233);
    190234
     235
    191236/** Get the number of elements in use from a specified psPixels. (pixels.n)
    192237 *
     
    197242);
    198243
     244
    199245/// @}
    200246#endif // #ifndef PS_PIXELS_H
Note: See TracChangeset for help on using the changeset viewer.