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/pmSourceIO.c

    r15398 r15418  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.52.2.2 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2007-10-29 01:37:48 $
     5 *  @version $Revision: 1.52.2.3 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2007-10-30 00:59:23 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4747int pmSourceGetDophotType (pmSource *source)
    4848{
     49    PS_ASSERT_PTR_NON_NULL(source, -1);
     50
    4951    switch (source->type) {
    5052
     
    7476bool pmSourceSetDophotType (pmSource *source, int type)
    7577{
     78    PS_ASSERT_PTR_NON_NULL(source, false);
     79
    7680    if (type == 4) {
    7781        source->mode |= PM_SOURCE_MODE_FAIL;
     
    106110bool pmFPAviewWriteObjects (const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    107111{
     112    PS_ASSERT_PTR_NON_NULL(view, false);
     113    PS_ASSERT_PTR_NON_NULL(file, false);
     114    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
    108115
    109116    pmFPA *fpa = file->fpa;
     
    165172bool pmFPAWriteObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    166173{
     174    PS_ASSERT_PTR_NON_NULL(view, false);
     175    PS_ASSERT_PTR_NON_NULL(fpa, false);
     176    PS_ASSERT_PTR_NON_NULL(fpa->chips, false);
     177
    167178    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
    168179    *thisView = *view;
     
    184195bool pmChipWriteObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    185196{
     197    PS_ASSERT_PTR_NON_NULL(chip, false);
     198    PS_ASSERT_PTR_NON_NULL(chip->cells, false);
     199    PS_ASSERT_PTR_NON_NULL(view, false);
     200
    186201    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
    187202    *thisView = *view;
     
    203218bool pmCellWriteObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    204219{
     220    PS_ASSERT_PTR_NON_NULL(cell, false);
     221    PS_ASSERT_PTR_NON_NULL(cell->readouts, false);
     222    PS_ASSERT_PTR_NON_NULL(view, false);
     223
    205224    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
    206225    *thisView = *view;
     
    222241bool pmReadoutWriteObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    223242{
     243    PS_ASSERT_PTR_NON_NULL(readout, false);
     244    PS_ASSERT_PTR_NON_NULL(view, false);
     245    PS_ASSERT_PTR_NON_NULL(file, false);
     246    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
    224247
    225248    bool status;
     
    418441
    419442// if this file needs to have a PHU written out, write one
    420 bool pmSource_CMF_WritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) {
     443bool pmSource_CMF_WritePHU (const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
     444{
     445    PS_ASSERT_PTR_NON_NULL(view, false);
     446    PS_ASSERT_PTR_NON_NULL(file, false);
    421447
    422448    bool status;
     
    527553bool pmFPAviewReadObjects (const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    528554{
     555    PS_ASSERT_PTR_NON_NULL(view, false);
     556    PS_ASSERT_PTR_NON_NULL(file, false);
     557    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
     558
    529559    pmFPA *fpa = file->fpa;
    530560
     
    566596bool pmFPAReadObjects (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    567597{
     598    PS_ASSERT_PTR_NON_NULL(view, false);
     599    PS_ASSERT_PTR_NON_NULL(file, false);
     600    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
     601    PS_ASSERT_PTR_NON_NULL(file->fpa->chips, false);
     602
    568603    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
    569604    *thisView = *view;
     
    587622bool pmChipReadObjects (pmChip *chip, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    588623{
     624    PS_ASSERT_PTR_NON_NULL(view, false);
     625    PS_ASSERT_PTR_NON_NULL(chip, false);
     626    PS_ASSERT_PTR_NON_NULL(chip->cells, false);
     627
    589628    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
    590629    *thisView = *view;
     
    611650bool pmCellReadObjects (pmCell *cell, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    612651{
     652    PS_ASSERT_PTR_NON_NULL(view, false);
     653    PS_ASSERT_PTR_NON_NULL(cell, false);
     654    PS_ASSERT_PTR_NON_NULL(cell->readouts, false);
     655
    613656    pmFPAview *thisView = pmFPAviewAlloc (view->nRows);
    614657    *thisView = *view;
     
    652695bool pmReadoutReadObjects (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, const pmConfig *config)
    653696{
     697    PS_ASSERT_PTR_NON_NULL(view, false);
     698    PS_ASSERT_PTR_NON_NULL(file, false);
    654699
    655700    bool status;
     
    789834bool pmFPAviewCheckDataStatusForSources (const pmFPAview *view, const pmFPAfile *file)
    790835{
     836    PS_ASSERT_PTR_NON_NULL(view, false);
     837    PS_ASSERT_PTR_NON_NULL(file, false);
     838    PS_ASSERT_PTR_NON_NULL(file->fpa, false);
     839
    791840    pmFPA *fpa = file->fpa;
    792841
     
    826875}
    827876
    828 bool pmFPACheckDataStatusForSources (const pmFPA *fpa) {
     877bool pmFPACheckDataStatusForSources (const pmFPA *fpa)
     878{
     879    PS_ASSERT_PTR_NON_NULL(fpa, false);
     880    PS_ASSERT_PTR_NON_NULL(fpa->chips, false);
    829881
    830882    for (int i = 0; i < fpa->chips->n; i++) {
     
    836888}
    837889
    838 bool pmChipCheckDataStatusForSources (const pmChip *chip) {
     890bool pmChipCheckDataStatusForSources (const pmChip *chip)
     891{
     892    PS_ASSERT_PTR_NON_NULL(chip, false);
     893    PS_ASSERT_PTR_NON_NULL(chip->cells, false);
    839894
    840895    for (int i = 0; i < chip->cells->n; i++) {
     
    846901}
    847902
    848 bool pmCellCheckDataStatusForSources (const pmCell *cell) {
     903bool pmCellCheckDataStatusForSources (const pmCell *cell)
     904{
     905    PS_ASSERT_PTR_NON_NULL(cell, false);
     906    PS_ASSERT_PTR_NON_NULL(cell->readouts, false);
    849907
    850908    for (int i = 0; i < cell->readouts->n; i++) {
     
    856914}
    857915
    858 bool pmReadoutCheckDataStatusForSources (const pmReadout *readout) {
     916bool pmReadoutCheckDataStatusForSources (const pmReadout *readout)
     917{
     918    PS_ASSERT_PTR_NON_NULL(readout, false);
    859919
    860920    bool status;
Note: See TracChangeset for help on using the changeset viewer.