IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 14, 2004, 10:01:52 AM (22 years ago)
Author:
desonia
Message:

Updated files in src/collections to use new psError functionality. Also
cleaned up the code where needed, removing unnecessary error conditions,
etc.

File:
1 edited

Legend:

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

    r1648 r1807  
    1 
    21/** @file  psScalar.c
    32 *
     
    98 *  @author Ross Harman, MHPCC
    109 *
    11  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-08-27 23:34:05 $
     10 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-09-14 20:01:52 $
    1312 *
    1413 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1514 */
    1615
    17 /******************************************************************************/
    18 
    19 /*  INCLUDE FILES                                                             */
    20 
    21 /******************************************************************************/
    2216#include "psMemory.h"
    2317#include "psError.h"
     
    2620#include "psAbort.h"
    2721
    28 /******************************************************************************/
     22#include "psCollectionsErrors.h"
    2923
    30 /*  DEFINE STATEMENTS                                                         */
    31 
    32 /******************************************************************************/
    33 
    34 // None
    35 
    36 /******************************************************************************/
    37 
    38 /*  TYPE DEFINITIONS                                                          */
    39 
    40 /******************************************************************************/
    41 
    42 // None
    43 
    44 /*****************************************************************************/
    45 
    46 /*  GLOBAL VARIABLES                                                         */
    47 
    48 /*****************************************************************************/
    49 
    50 // None
    51 
    52 /*****************************************************************************/
    53 
    54 /*  FILE STATIC VARIABLES                                                    */
    55 
    56 /*****************************************************************************/
    57 
    58 // None
    59 
    60 /*****************************************************************************/
    61 
    62 /*  FUNCTION IMPLEMENTATION - LOCAL                                          */
    63 
    64 /*****************************************************************************/
    65 
    66 // None
    67 
    68 /*****************************************************************************/
    69 
    70 /* FUNCTION IMPLEMENTATION - PUBLIC                                          */
    71 
    72 /*****************************************************************************/
    7324psScalar* psScalarAlloc(psC64 value, psElemType dataType)
    7425{
     
    7728    // Create scalar
    7829    scalar = (psScalar* ) psAlloc(sizeof(psScalar));
    79     if (scalar == NULL) {
    80         psAbort(__func__, " : Line %d - Failed to allocate memory", __LINE__);
    81     }
    8230
    8331    scalar->type.dimen = PS_DIMEN_SCALAR;
     
    12270        break;
    12371    default:
    124         psError(__func__, ": Line %d - Invalid PS_TYPE: %d", __LINE__, dataType);
     72        psErrorMsg(PS_ERRORNAME_DOMAIN "psScalarAlloc",
     73                   PS_ERR_BAD_PARAMETER_TYPE, true,
     74                   PS_ERRORTEXT_psScalar_UNSUPPORTED_TYPE,
     75                   dataType);
    12576    }
    12677
     
    13485
    13586    if (scalar == NULL) {
    136         psError(__func__, "Null scalar not allowed");
     87        psErrorMsg(PS_ERRORNAME_DOMAIN "psScalarCopy",
     88                   PS_ERR_BAD_PARAMETER_NULL, true,
     89                   PS_ERRORTEXT_psScalar_COPY_NULL);
     90        return NULL;
    13791    }
    13892
     
    176130        break;
    177131    default:
    178         psError(__func__, ": Line %d - Invalid PS_TYPE: %d", __LINE__, dataType);
     132        psErrorMsg(PS_ERRORNAME_DOMAIN "psScalarCopy",
     133                   PS_ERR_BAD_PARAMETER_TYPE, true,
     134                   PS_ERRORTEXT_psScalar_UNSUPPORTED_TYPE,
     135                   dataType);
    179136    }
    180137
Note: See TracChangeset for help on using the changeset viewer.