IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11708


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

change psBitSetAlloc() to pass in file/lineno/func
whitespace fixes

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

Legend:

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

    r10999 r11708  
    1111 *  @author Robert DeSonia, MHPCC
    1212 *
    13  *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2007-01-09 22:38:53 $
     13 *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2007-02-08 21:33:57 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7575
    7676
    77 psBitSet* psBitSetAlloc(long nalloc)
     77psBitSet* p_psBitSetAlloc(const char *file,
     78                          unsigned int lineno,
     79                          const char *func,
     80                          long nalloc)
    7881{
    7982    if (nalloc < 0) {
     
    8891
    8992    numBytes = ceil(nalloc / 8.0);
    90     newObj = psAlloc(sizeof(psBitSet));
     93    newObj = p_psAlloc(file, lineno, func, sizeof(psBitSet));
    9194    psMemSetDeallocator(newObj, (psFreeFunc) bitSetFree);
    9295    newObj->n = numBytes;
     
    100103    return newObj;
    101104}
     105
    102106
    103107psBitSet* psBitSetSet(psBitSet* bitSet,
  • trunk/psLib/src/types/psBitSet.h

    r11248 r11708  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2007-01-23 22:47:23 $
     13 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2007-02-08 21:33:57 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4949/** Checks the type of a particular pointer.
    5050 *
    51  *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     51 *  Uses the appropriate deallocation function in psMemBlock to check the ptr
     52 *  datatype.
    5253 *
    5354 *  @return bool:     True if the pointer matches a psBitSet structure, false otherwise.
     
    5556bool psMemCheckBitSet(
    5657    psPtr ptr                          ///< the pointer whose type to check
    57 )
    58 ;
     58);
     59
    5960
    6061/** Allocate a psBitSet.
    6162 *
    62  *  Create a psBitSet with the number of bits specified by the user. All bits are set
    63  *  to zero upon allocation.
     63 *  Create a psBitSet with the number of bits specified by the user. All bits
     64 *  are set to zero upon allocation.
    6465 *
    6566 *  @return  psBitSet* : Pointer to struct containing array of bits and size of array.
    6667 */
     68#ifdef DOXYGEN
    6769psBitSet* psBitSetAlloc(
    6870    long nalloc                        ///< Number of bits in psBitSet array
    6971);
     72#else // ifdef DOXYGEN
     73psBitSet* p_psBitSetAlloc(
     74    const char *file,                   ///< File of caller
     75    unsigned int lineno,                ///< Line number of caller
     76    const char *func,                   ///< Function name of caller
     77    long nalloc                        ///< Number of bits in psBitSet array
     78);
     79#define psBitSetAlloc(nalloc) \
     80      p_psBitSetAlloc(__FILE__, __LINE__, __func__, nalloc)
     81#endif // ifdef DOXYGEN
     82
     83
     84
    7085
    7186/** Set a bit.
    7287 *
    73  *  Sets a bit at a given bit location. The bit is set based on a zero index with the
    74  *  first bit set in the zero bit slot of the zero element of the byte array. As an
    75  *  example, setting bit 3 in an array with two elements would result in an psBitSet
    76  *  that looks like 00000000 00001000.
     88 *  Sets a bit at a given bit location. The bit is set based on a zero index
     89 *  with the first bit set in the zero bit slot of the zero element of the byte
     90 *  array. As an example, setting bit 3 in an array with two elements would
     91 *  result in an psBitSet that looks like 00000000 00001000.
    7792 *
    7893 *  @return  psBitSet* : Pointer to struct containing psBitSet.
     
    8297    long bit                           ///< Bit to be set.
    8398);
     99
    84100
    85101/** Clear a bit.
     
    96112);
    97113
     114
    98115/** Test the value of a bit.
    99116 *
    100  *  Prints the value of a bit at a given bit location, either one or zero. The resulting
    101  *  bit is based on a zero index format with the first bit set in the zero bit slot of
    102  *  the zero element of the byte array.  As an example, testing bit 3 in a psBitSet with
    103  *  two bytes that looks like 00000000 00001000 would return a value of one, since that
    104  *  is the value that was set.
     117 *  Prints the value of a bit at a given bit location, either one or zero. The
     118 *  resulting bit is based on a zero index format with the first bit set in the
     119 *  zero bit slot of the zero element of the byte array.  As an example,
     120 *  testing bit 3 in a psBitSet with two bytes that looks like 00000000
     121 *  00001000 would return a value of one, since that is the value that was set.
    105122 *
    106123 *  @return  bool:      True if successful, otherwise false
     
    111128);
    112129
     130
    113131/** Perform a binary operation on two psBitSets
    114132 *
    115  *  Perform an AND, OR, or XOR on two psBitSets. If the BitMasks are not the same size,
    116  *  the operation will not be performed and an error message will be logged.
     133 *  Perform an AND, OR, or XOR on two psBitSets. If the BitMasks are not the
     134 *  same size, the operation will not be performed and an error message will be
     135 *  logged.
    117136 *
    118137 *  @return  psBitSet* : Pointer to struct containing result of binary operation.
     
    125144);
    126145
     146
    127147/** Perform a not operation on a psBitSet
    128148 *
    129  *  Toggles bits in a psBitset. All zero bits are set to one and all one bits are set
    130  *  to zero.
     149 *  Toggles bits in a psBitset. All zero bits are set to one and all one bits
     150 *  are set to zero.
    131151 *
    132152 *  @return  psBitSet* : Pointer to struct containing result of operation.
     
    137157);
    138158
     159
    139160/** Convert the psBitSet to a string of ones and zeros.
    140161 *
    141  *  Converts the contents of a psBitSet to a string representation of its binary form of
    142  *  ones and zeros. The LSB is the right-most chracter. Each set of eight characters
    143  *  represents one byte.
     162 *  Converts the contents of a psBitSet to a string representation of its
     163 *  binary form of ones and zeros. The LSB is the right-most chracter. Each set
     164 *  of eight characters represents one byte.
    144165 *
    145166 *  @return  psString:      Pointer to character array containing string data.
     
    149170);
    150171
     172
    151173/// @}
    152174#endif // #ifndef PSBITSET_H
Note: See TracChangeset for help on using the changeset viewer.