IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5530 for trunk/psLib/src/types


Ignore:
Timestamp:
Nov 16, 2005, 1:07:10 PM (21 years ago)
Author:
desonia
Message:

removed *(type*)& syntax for setting const values of struts.

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

Legend:

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

    r5216 r5530  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-10-01 02:22:15 $
     11 *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-11-16 23:06:35 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6363    psMemSetDeallocator(psArr, (psFreeFunc) arrayFree);
    6464
    65     *(long*)&psArr->nalloc = nalloc;
     65    P_PSARRAY_SET_NALLOC(psArr,nalloc);
    6666    psArr->n = nalloc;
    6767
     
    8787        // Realloc after decrementation to avoid accessing freed array elements
    8888        in->data = psRealloc(in->data, nalloc * sizeof(psPtr));
    89         *(long*)&in->nalloc = nalloc;
     89        P_PSARRAY_SET_NALLOC(in,nalloc);
    9090    }
    9191
  • trunk/psLib/src/types/psArray.h

    r5454 r5530  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-10-29 00:05:53 $
     13 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-11-16 23:06:35 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4040psArray;
    4141
    42 /*****************************************************************************/
     42#define P_PSARRAY_SET_NALLOC(vec,n) *(long*)&vec->nalloc = n
    4343
    44 /* FUNCTION PROTOTYPES                                                       */
     44        /*****************************************************************************/
    4545
    46 /*****************************************************************************/
     46        /* FUNCTION PROTOTYPES                                                       */
    4747
    48 /** Checks the type of a particular pointer.
    49  *
    50  *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
    51  *
    52  *  @return bool:       True if the pointer matches a psArray structure, false otherwise.
    53  */
    54 bool psMemCheckArray(
    55     psPtr ptr                          ///< the pointer whose type to check
    56 )
    57 ;
     48        /*****************************************************************************/
     49
     50        /** Checks the type of a particular pointer.
     51         *
     52         *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     53         *
     54         *  @return bool:       True if the pointer matches a psArray structure, false otherwise.
     55         */
     56        bool psMemCheckArray(
     57            psPtr ptr                          ///< the pointer whose type to check
     58        )
     59        ;
    5860
    5961
  • trunk/psLib/src/types/psPixels.c

    r5214 r5530  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-10-01 00:14:17 $
     9 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-11-16 23:06:35 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6666    }
    6767    out->n = nalloc;
    68     *(long*)&out->nalloc = nalloc;
     68    P_PSPIXELS_SET_NALLOC(out,nalloc);
    6969
    7070    psMemSetDeallocator(out, (psFreeFunc)pixelsFree);
     
    9494    }
    9595
    96     *(long*)&pixels->nalloc = nalloc;
     96    P_PSPIXELS_SET_NALLOC(pixels,nalloc);
    9797
    9898    if (pixels->n > pixels->nalloc) {
  • trunk/psLib/src/types/psPixels.h

    r5214 r5530  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-10-01 00:14:17 $
     9 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-11-16 23:06:35 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4848psPixels;
    4949
     50#define P_PSPIXELS_SET_NALLOC(pix,n) *(long*)&pix->nalloc = n
    5051
    51 /** Allocates a new psPixels structure
    52  *
    53  *  @return psPixels*   new psPixels
    54  */
    55 psPixels* psPixelsAlloc(
    56     long nalloc                       ///< the size of the coordinate vectors
    57 )
    58 ;
     52        /** Allocates a new psPixels structure
     53         *
     54         *  @return psPixels*   new psPixels
     55         */
     56        psPixels* psPixelsAlloc(
     57            long nalloc                       ///< the size of the coordinate vectors
     58        )
     59        ;
    5960
    6061/** Checks the type of a particular pointer.
Note: See TracChangeset for help on using the changeset viewer.