IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11710


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

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

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

Legend:

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

    r11674 r11710  
    77*  @author Ross Harman, MHPCC
    88*
    9 *  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2007-02-07 01:15:50 $
     9*  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2007-02-08 21:57:02 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    285285
    286286
    287 psLookupTable* psLookupTableAlloc(const char *filename,
    288                                   const char *format,
    289                                   long indexCol)
     287psLookupTable* p_psLookupTableAlloc(const char *file,
     288                                    unsigned int lineno,
     289                                    const char *func,
     290                                    const char *filename,
     291                                    const char *format,
     292                                    long indexCol)
    290293{
    291294    // Can't read table if you don't know its name
     
    298301
    299302    // Allocate lookup table
    300     outTable = (psLookupTable*)psAlloc(sizeof(psLookupTable));
     303    outTable = (psLookupTable*)p_psAlloc(file, lineno, func, sizeof(psLookupTable));
    301304
    302305    // Set deallocator
     
    608611}
    609612
    610 psLookupTable *psLookupTableImport(psLookupTable *table,
    611                                    const psArray *vectors,
    612                                    long indexCol)
     613psLookupTable *p_psLookupTableImport(const char *file,
     614                                     unsigned int lineno,
     615                                     const char *func,
     616                                     psLookupTable *table,
     617                                     const psArray *vectors,
     618                                     long indexCol)
    613619{
    614620    psLookupTable* outputTable = NULL;
     
    618624
    619625    // Check for NULL input table
     626    // XXX table/outputtable should be allocated if NULL
    620627    PS_ASSERT_PTR_NON_NULL(table,NULL);
    621628
  • trunk/psLib/src/types/psLookupTable.h

    r11248 r11710  
    66*  @author Ross Harman, MHPCC
    77*
    8 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2007-01-23 22:47:23 $
     8*  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2007-02-08 21:57:02 $
    1010*
    1111*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5353} psLookupStatusType;
    5454
     55
    5556/** Lookup table parse status and error conditions
    5657 *
     
    6465}psParseErrorType;
    6566
     67
    6668/** Checks the type of a particular pointer.
    6769 *
    68  *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     70 *  Uses the appropriate deallocation function in psMemBlock to check the ptr
     71 *  datatype.
    6972 *
    70  *  @return bool:       True if the pointer matches a psLookupTable structure, false otherwise.
     73 *  @return bool:       True if the pointer matches a psLookupTable structure,
     74 *  false otherwise.
    7175 */
    7276bool psMemCheckLookupTable(
     
    8185 *  @return psLookupTable*     New psLookupTable struct.
    8286 */
     87#ifdef DOXYGEN
    8388psLookupTable* psLookupTableAlloc(
    8489    const char *filename,              ///< Name of file to read
     
    8691    long indexCol                      ///< Column of the index vector (starting at zero)
    8792);
     93#else // ifdef DOXYGEN
     94psLookupTable* p_psLookupTableAlloc(
     95    const char *file,                   ///< File of caller
     96    unsigned int lineno,                ///< Line number of caller
     97    const char *func,                   ///< Function name of caller
     98    const char *filename,              ///< Name of file to read
     99    const char *format,                ///< scanf-like format string
     100    long indexCol                      ///< Column of the index vector (starting at zero)
     101);
     102#define psLookupTableAlloc(filename, format, indexCol) \
     103      p_psLookupTableAlloc(__FILE__, __LINE__, __func__, filename, format, indexCol)
     104#endif // ifdef DOXYGEN
     105
    88106
    89107/** Read vectors from file
     
    98116);
    99117
     118
    100119/** Import arrays of vectors into a table
    101120 *
     
    104123 *  @return psLookupTable*  Lookup table structure with array vector data
    105124 */
     125#ifdef DOXYGEN
    106126psLookupTable *psLookupTableImport(
    107127    psLookupTable *table,              ///< Lookup table into which to import
     
    109129    long indexCol                      ///< Index of the index vector in the array of vectors
    110130);
     131#else // ifdef DOXYGEN
     132psLookupTable *p_psLookupTableImport(
     133    const char *file,                   ///< File of caller
     134    unsigned int lineno,                ///< Line number of caller
     135    const char *func,                   ///< Function name of caller
     136    psLookupTable *table,               ///< Lookup table into which to import
     137    const psArray *vectors,             ///< Array of vectors
     138    long indexCol                       ///< Index of the index vector in the array of vectors
     139);
     140#define psLookupTableImport(table, vectors, indexCol) \
     141      p_psLookupTableImport(__FILE__, __LINE__, __func__, table, vectors, indexCol)
     142#endif // ifdef DOXYGEN
     143
    111144
    112145/** Read lookup table
     
    120153);
    121154
     155
    122156/** Lookup and interpolate value from table.
    123157 *
    124  *  Interpolates value from table. Sets status bit for success or one of several possible failure
    125  *  conditions.
     158 *  Interpolates value from table. Sets status bit for success or one of
     159 *  several possible failure conditions.
    126160 *
    127161 *  @return double     Interpolation value at index
     
    133167);
    134168
     169
    135170/** Lookup and interpolate all values from table.
    136171 *
    137  *  Interpolates all values from table. Sets status bit for success or one of several possible failure
    138  *  conditions.
     172 *  Interpolates all values from table. Sets status bit for success or one of
     173 *  several possible failure conditions.
    139174 *
    140175 *  @return psVector*     Interpolation values calculated at index
     
    145180);
    146181
     182
    147183/// @}
    148184#endif // #ifndef PS_LOOKUPTABLE_H
Note: See TracChangeset for help on using the changeset viewer.