IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4352


Ignore:
Timestamp:
Jun 22, 2005, 1:48:39 PM (21 years ago)
Author:
desonia
Message:

changed parameters of the name 'table' to 'hash'.

Location:
trunk/psLib/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psHash.c

    r4343 r4352  
    1212*  @author GLG, MHPCC
    1313*
    14 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-06-22 03:00:27 $
     14*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-06-22 23:48:39 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    343343    boolean value defining success or failure
    344344 *****************************************************************************/
    345 bool psHashAdd(psHash* table,
     345bool psHashAdd(psHash* hash,
    346346               const char *key,
    347347               psPtr data)
    348348{
    349     PS_ASSERT_PTR_NON_NULL(table, false);
     349    PS_ASSERT_PTR_NON_NULL(hash, false);
    350350    PS_ASSERT_PTR_NON_NULL(key, false);
    351351    PS_ASSERT_PTR_NON_NULL(data, false);
    352352
    353     return (doHashWork(table, key, data, false) != NULL);
     353    return (doHashWork(hash, key, data, false) != NULL);
    354354}
    355355
     
    365365    The data associated with that key.
    366366 *****************************************************************************/
    367 psPtr psHashLookup(const psHash* table,      // table to lookup key in
     367psPtr psHashLookup(const psHash* hash,      // hash to lookup key in
    368368                   const char *key)     // key to lookup
    369369{
    370     PS_ASSERT_PTR_NON_NULL(table, NULL);
     370    PS_ASSERT_PTR_NON_NULL(hash, NULL);
    371371    PS_ASSERT_PTR_NON_NULL(key, NULL);
    372372
    373     return doHashWork((psPtr)table, key, NULL, false);
     373    return doHashWork((psPtr)hash, key, NULL, false);
    374374}
    375375
     
    383383    boolean value defining success or failure
    384384 *****************************************************************************/
    385 bool psHashRemove(psHash* table,
     385bool psHashRemove(psHash* hash,
    386386                  const char *key)
    387387{
     
    389389    psBool retVal = false;
    390390
    391     PS_ASSERT_PTR_NON_NULL(table, false);
     391    PS_ASSERT_PTR_NON_NULL(hash, false);
    392392    PS_ASSERT_PTR_NON_NULL(key, false);
    393393
    394     data = doHashWork(table, key, NULL, true);
     394    data = doHashWork(hash, key, NULL, true);
    395395    if (data != NULL) {
    396396        retVal = true;
     
    402402}
    403403
    404 psArray* psHashToArray(const psHash* table)
    405 {
    406     PS_ASSERT_PTR_NON_NULL(table, NULL);
     404psArray* psHashToArray(const psHash* hash)
     405{
     406    PS_ASSERT_PTR_NON_NULL(hash, NULL);
    407407
    408408    // first, let's just count the number of data elements to know what size
    409409    // psArray we need to allocate.
    410410    int nElements = 0;
    411     int nbucket = table->nbucket;
     411    int nbucket = hash->nbucket;
    412412    for (int i = 0; i < nbucket; i++) {
    413         psHashBucket* tmpBucket = table->buckets[i];
     413        psHashBucket* tmpBucket = hash->buckets[i];
    414414        while (tmpBucket != NULL) {
    415415            nElements++;
     
    421421    result->n = nElements;
    422422
    423     // now fill in the array with the hash table's data
     423    // now fill in the array with the hash hash's data
    424424    psPtr* data = result->data;
    425425    for (int i = 0; i < nbucket; i++) {
    426         psHashBucket* tmpBucket = table->buckets[i];
     426        psHashBucket* tmpBucket = hash->buckets[i];
    427427        while (tmpBucket != NULL) {
    428428            *(data++) = psMemIncrRefCounter(tmpBucket->data);
  • trunk/psLib/src/collections/psHash.h

    r4343 r4352  
    1111 *  @author GLG, MHPCC
    1212 *
    13  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-06-22 03:00:27 $
     13 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-06-22 23:48:39 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5252/// Insert entry into table.
    5353bool psHashAdd(
    54     psHash* table,                     ///< The table to insert in.
     54    psHash* hash,                      ///< The table to insert in.
    5555    const char *key,                   ///< The key to use.
    5656    psPtr data                         ///< The data to insert.
     
    5959/// Lookup key in table.
    6060psPtr psHashLookup(
    61     const psHash* table,               ///< The table to lookup key in.
     61    const psHash* hash,                ///< The table to lookup key in.
    6262    const char *key                    ///< The key to lookup.
    6363);
     
    6565/// Remove key from table.
    6666bool psHashRemove(
    67     psHash* table,                     ///< The table to lookup key in.
     67    psHash* hash,                      ///< The table to lookup key in.
    6868    const char *key                    ///< The key to lookup.
    6969);
     
    7979 */
    8080psArray* psHashToArray(
    81     const psHash* table                ///< The table to convert to psArray.
     81    const psHash* hash                 ///< The table to convert to psArray.
    8282);
    8383
  • trunk/psLib/src/types/psHash.c

    r4343 r4352  
    1212*  @author GLG, MHPCC
    1313*
    14 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    15 *  @date $Date: 2005-06-22 03:00:27 $
     14*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     15*  @date $Date: 2005-06-22 23:48:39 $
    1616*
    1717*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    343343    boolean value defining success or failure
    344344 *****************************************************************************/
    345 bool psHashAdd(psHash* table,
     345bool psHashAdd(psHash* hash,
    346346               const char *key,
    347347               psPtr data)
    348348{
    349     PS_ASSERT_PTR_NON_NULL(table, false);
     349    PS_ASSERT_PTR_NON_NULL(hash, false);
    350350    PS_ASSERT_PTR_NON_NULL(key, false);
    351351    PS_ASSERT_PTR_NON_NULL(data, false);
    352352
    353     return (doHashWork(table, key, data, false) != NULL);
     353    return (doHashWork(hash, key, data, false) != NULL);
    354354}
    355355
     
    365365    The data associated with that key.
    366366 *****************************************************************************/
    367 psPtr psHashLookup(const psHash* table,      // table to lookup key in
     367psPtr psHashLookup(const psHash* hash,      // hash to lookup key in
    368368                   const char *key)     // key to lookup
    369369{
    370     PS_ASSERT_PTR_NON_NULL(table, NULL);
     370    PS_ASSERT_PTR_NON_NULL(hash, NULL);
    371371    PS_ASSERT_PTR_NON_NULL(key, NULL);
    372372
    373     return doHashWork((psPtr)table, key, NULL, false);
     373    return doHashWork((psPtr)hash, key, NULL, false);
    374374}
    375375
     
    383383    boolean value defining success or failure
    384384 *****************************************************************************/
    385 bool psHashRemove(psHash* table,
     385bool psHashRemove(psHash* hash,
    386386                  const char *key)
    387387{
     
    389389    psBool retVal = false;
    390390
    391     PS_ASSERT_PTR_NON_NULL(table, false);
     391    PS_ASSERT_PTR_NON_NULL(hash, false);
    392392    PS_ASSERT_PTR_NON_NULL(key, false);
    393393
    394     data = doHashWork(table, key, NULL, true);
     394    data = doHashWork(hash, key, NULL, true);
    395395    if (data != NULL) {
    396396        retVal = true;
     
    402402}
    403403
    404 psArray* psHashToArray(const psHash* table)
    405 {
    406     PS_ASSERT_PTR_NON_NULL(table, NULL);
     404psArray* psHashToArray(const psHash* hash)
     405{
     406    PS_ASSERT_PTR_NON_NULL(hash, NULL);
    407407
    408408    // first, let's just count the number of data elements to know what size
    409409    // psArray we need to allocate.
    410410    int nElements = 0;
    411     int nbucket = table->nbucket;
     411    int nbucket = hash->nbucket;
    412412    for (int i = 0; i < nbucket; i++) {
    413         psHashBucket* tmpBucket = table->buckets[i];
     413        psHashBucket* tmpBucket = hash->buckets[i];
    414414        while (tmpBucket != NULL) {
    415415            nElements++;
     
    421421    result->n = nElements;
    422422
    423     // now fill in the array with the hash table's data
     423    // now fill in the array with the hash hash's data
    424424    psPtr* data = result->data;
    425425    for (int i = 0; i < nbucket; i++) {
    426         psHashBucket* tmpBucket = table->buckets[i];
     426        psHashBucket* tmpBucket = hash->buckets[i];
    427427        while (tmpBucket != NULL) {
    428428            *(data++) = psMemIncrRefCounter(tmpBucket->data);
  • trunk/psLib/src/types/psHash.h

    r4343 r4352  
    1111 *  @author GLG, MHPCC
    1212 *
    13  *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-06-22 03:00:27 $
     13 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-06-22 23:48:39 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5252/// Insert entry into table.
    5353bool psHashAdd(
    54     psHash* table,                     ///< The table to insert in.
     54    psHash* hash,                      ///< The table to insert in.
    5555    const char *key,                   ///< The key to use.
    5656    psPtr data                         ///< The data to insert.
     
    5959/// Lookup key in table.
    6060psPtr psHashLookup(
    61     const psHash* table,               ///< The table to lookup key in.
     61    const psHash* hash,                ///< The table to lookup key in.
    6262    const char *key                    ///< The key to lookup.
    6363);
     
    6565/// Remove key from table.
    6666bool psHashRemove(
    67     psHash* table,                     ///< The table to lookup key in.
     67    psHash* hash,                      ///< The table to lookup key in.
    6868    const char *key                    ///< The key to lookup.
    6969);
     
    7979 */
    8080psArray* psHashToArray(
    81     const psHash* table                ///< The table to convert to psArray.
     81    const psHash* hash                 ///< The table to convert to psArray.
    8282);
    8383
Note: See TracChangeset for help on using the changeset viewer.