IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 29, 2007, 2:59:23 PM (19 years ago)
Author:
gusciora
Message:

Adding several changes to the objects directory. Most of these changes are
mere additions of PS_ASSERTs to the beginning of psModule functions to ensure
that input parameters are correct.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20071023/psModules/src/objects/pmModel.c

    r15398 r15418  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.15.6.2 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-10-29 01:37:48 $
     8 *  @version $Revision: 1.15.6.3 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-10-30 00:59:23 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4646    psTrace("psModules.objects", 3, "---- %s() begin ----\n", __func__);
    4747
    48     pmModel *tmp = (pmModel *) psAlloc(sizeof(pmModel));
    49     psMemSetDeallocator(tmp, (psFreeFunc) modelFree);
    50 
    5148    pmModelClass *class = pmModelClassSelect (type);
    5249    if (class == NULL) {
     
    5451        return(NULL);
    5552    }
     53
     54    pmModel *tmp = (pmModel *) psAlloc(sizeof(pmModel));
     55    psMemSetDeallocator(tmp, (psFreeFunc) modelFree);
    5656
    5757    tmp->type = type;
     
    8989}
    9090
     91bool psMemCheckModel(psPtr ptr)
     92{
     93    PS_ASSERT_PTR(ptr, false);
     94    return ( psMemGetDeallocator(ptr) == (psFreeFunc) modelFree);
     95}
     96
    9197// copy model to a new structure
    9298pmModel *pmModelCopy (pmModel *model)
    9399{
     100    PS_ASSERT_PTR_NON_NULL(model, NULL);
    94101
    95102    pmModel *new = pmModelAlloc (model->type);
Note: See TracChangeset for help on using the changeset viewer.