IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1841


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

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

Location:
trunk/psLib/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psCollectionsErrors.dat

    r1807 r1841  
    2525psScalar_UNSUPPORTED_TYPE              Specified datatype (%d) is unsupported by psScalar.
    2626psScalar_COPY_NULL                     Can not copy a NULL psScalar.
     27#
     28psHash_KEY_NULL                        Input key can not be NULL.
     29psHash_TABLE_NULL                      Input psHash can not be NULL.
     30psHash_DATA_NULL                       Input data can not be NULL.
     31
  • trunk/psLib/src/collections/psCollectionsErrors.h

    r1807 r1841  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-09-14 20:01:52 $
     9 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-09-21 23:15:04 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4545#define PS_ERRORTEXT_psScalar_UNSUPPORTED_TYPE "Specified datatype (%d) is unsupported by psScalar."
    4646#define PS_ERRORTEXT_psScalar_COPY_NULL "Can not copy a NULL psScalar."
     47#define PS_ERRORTEXT_psHash_KEY_NULL "Input key can not be NULL."
     48#define PS_ERRORTEXT_psHash_TABLE_NULL "Input psHash can not be NULL."
     49#define PS_ERRORTEXT_psHash_DATA_NULL "Input data can not be NULL."
    4750//~End
    4851
  • 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
  • trunk/psLib/src/image/psImage.c

    r1840 r1841  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-09-21 22:30:19 $
     12 *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-09-21 23:15:04 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2222
    2323#include "psMemory.h"
    24 #include "psAbort.h"
    2524#include "psError.h"
    2625#include "psImage.h"
     
    5049    psImage* image = (psImage* ) psAlloc(sizeof(psImage));
    5150
    52     if (image == NULL) {
    53         psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
    54     }
    55 
    5651    p_psMemSetDeallocator(image, (psFreeFcn) imageFree);
    5752
    5853    image->data.V = psAlloc(sizeof(void *) * numRows);
    59     if (image->data.V == NULL) {
    60         psFree(image);
    61         psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
    62     }
    6354
    6455    image->rawDataBuffer = psAlloc(area * elementSize);
    65     if (image->rawDataBuffer == NULL) {
    66         psFree(image);
    67         psFree(image->data.V);
    68         psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
    69     }
    7056
    7157    // set the row pointers.
  • trunk/psLib/src/image/psImageStats.c

    r1840 r1841  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-09-21 22:30:19 $
     12*  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-09-21 23:15:04 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626#include "psTrace.h"
    2727#include "psError.h"
    28 #include "psAbort.h"
    2928#include "psStats.h"
    3029#include "psImage.h"
  • trunk/psLib/src/imageops/psImageStats.c

    r1840 r1841  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-09-21 22:30:19 $
     12*  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-09-21 23:15:04 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626#include "psTrace.h"
    2727#include "psError.h"
    28 #include "psAbort.h"
    2928#include "psStats.h"
    3029#include "psImage.h"
  • trunk/psLib/src/mathtypes/psImage.c

    r1840 r1841  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-09-21 22:30:19 $
     12 *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-09-21 23:15:04 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2222
    2323#include "psMemory.h"
    24 #include "psAbort.h"
    2524#include "psError.h"
    2625#include "psImage.h"
     
    5049    psImage* image = (psImage* ) psAlloc(sizeof(psImage));
    5150
    52     if (image == NULL) {
    53         psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
    54     }
    55 
    5651    p_psMemSetDeallocator(image, (psFreeFcn) imageFree);
    5752
    5853    image->data.V = psAlloc(sizeof(void *) * numRows);
    59     if (image->data.V == NULL) {
    60         psFree(image);
    61         psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
    62     }
    6354
    6455    image->rawDataBuffer = psAlloc(area * elementSize);
    65     if (image->rawDataBuffer == NULL) {
    66         psFree(image);
    67         psFree(image->data.V);
    68         psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
    69     }
    7056
    7157    // set the row pointers.
  • trunk/psLib/src/types/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.