IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 21, 2004, 1:15:04 PM (22 years ago)
Author:
desonia
Message:

removed some unnecessary psAborts, replacing them with psErrorMsg(...).

File:
1 edited

Legend:

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

    r1747 r1841  
    1111*  @author George Gusciora, MHPCC
    1212*
    13 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-09-09 02:23:27 $
     13*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-09-21 23:15:04 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2424#include "psString.h"
    2525#include "psTrace.h"
     26#include "psError.h"
    2627#include "psAbort.h"
     28
     29#include "psCollectionsErrors.h"
    2730
    2831static psHashBucket* hashBucketAlloc(const char *key, void *data, psHashBucket* next);
     
    8386static psHashBucket* hashBucketAlloc(const char *key, void *data, psHashBucket* next)
    8487{
    85     if (key == NULL) {
    86         psAbort(__func__, "psHashBucket() called with NULL key.");
    87     }
    8888    // Allocate memory for the new hash bucket.
    8989    psHashBucket* bucket = psAlloc(sizeof(psHashBucket));
     
    226226    // the way this procedure is called.
    227227    if ((table == NULL) || (key == NULL)) {
    228 
    229         psAbort(__func__, "psHashRemove() called with NULL key or table.");
     228        psErrorMsg(PS_ERRORNAME_DOMAIN "doHashWork",
     229                   PS_ERR_BAD_PARAMETER_NULL, true,
     230                   PS_ERRORTEXT_psHash_KEY_NULL);
     231        return NULL;
    230232    }
    231233    // NOTE: This is the originally supplied hash function.
     
    341343{
    342344    if (table == NULL) {
    343         psAbort(__func__, "psHashInsert() called with NULL hash table.");
     345        psErrorMsg(PS_ERRORNAME_DOMAIN "psHashAdd",
     346                   PS_ERR_BAD_PARAMETER_NULL, true,
     347                   PS_ERRORTEXT_psHash_KEY_NULL);
     348        return false;
    344349    }
    345350    if (key == NULL) {
    346         psAbort(__func__, "psHashInsert() called with NULL key.");
     351        psErrorMsg(PS_ERRORNAME_DOMAIN "psHashAdd",
     352                   PS_ERR_BAD_PARAMETER_NULL, true,
     353                   PS_ERRORTEXT_psHash_TABLE_NULL);
     354        return false;
    347355    }
    348356    if (data == NULL) {
    349         psAbort(__func__, "psHashLookup() called with NULL data.");
     357        psErrorMsg(PS_ERRORNAME_DOMAIN "psHashAdd",
     358                   PS_ERR_BAD_PARAMETER_NULL, true,
     359                   PS_ERRORTEXT_psHash_DATA_NULL);
    350360    }
    351361
     
    368378{
    369379    if (table == NULL) {
    370         psAbort(__func__, "psHashLookup() called with NULL hash table.");
     380        psErrorMsg(PS_ERRORNAME_DOMAIN "psHashLookup",
     381                   PS_ERR_BAD_PARAMETER_NULL, true,
     382                   PS_ERRORTEXT_psHash_KEY_NULL);
     383        return NULL;
    371384    }
    372385    if (key == NULL) {
    373         psAbort(__func__, "psHashLookup() called with NULL key.");
     386        psErrorMsg(PS_ERRORNAME_DOMAIN "psHashLookup",
     387                   PS_ERR_BAD_PARAMETER_NULL, true,
     388                   PS_ERRORTEXT_psHash_TABLE_NULL);
     389        return NULL;
    374390    }
    375391
     
    393409
    394410    if (table == NULL) {
    395         psAbort(__func__, "psHashRemove() called with NULL hash table.");
     411        psErrorMsg(PS_ERRORNAME_DOMAIN "psHashRemove",
     412                   PS_ERR_BAD_PARAMETER_NULL, true,
     413                   PS_ERRORTEXT_psHash_TABLE_NULL);
     414        return false;
    396415    }
    397416    if (key == NULL) {
    398         psAbort(__func__, "psHashRemove() called with NULL key.");
     417        psErrorMsg(PS_ERRORNAME_DOMAIN "psHashRemove",
     418                   PS_ERR_BAD_PARAMETER_NULL, true,
     419                   PS_ERRORTEXT_psHash_KEY_NULL);
     420        return false;
    399421    }
    400422
Note: See TracChangeset for help on using the changeset viewer.