IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 27, 2006, 4:53:03 PM (20 years ago)
Author:
drobbin
Message:

Add Length functions/tests. Modified psPixelsAlloc to set n=0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psMemory.c

    r6425 r6500  
    88*  @author Robert Lupton, Princeton University
    99*
    10 *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2006-02-14 00:09:27 $
     10*  @version $Revision: 1.70 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2006-02-28 02:53:03 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    828828            return true;
    829829        else {
    830             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     830            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     831                    "Incorrect pointer.  Datatypes do not match.\n");
    831832            break;
    832833        }
     
    835836            return true;
    836837        else {
    837             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
    838             break;
    839         }
    840         /*    case PS_DATA_CELL:
    841                 if ( psMemCheckCell(ptr) )
    842                     return true;
    843                 else
    844                 {
    845                     psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
    846                     break;
    847                 }
    848             case PS_DATA_CHIP:
    849                 if ( psMemCheckChip(ptr) )
    850                     return true;
    851                 else
    852                 {
    853                     psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
    854                     break;
    855                 }
    856         */
     838            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     839                    "Incorrect pointer.  Datatypes do not match.\n");
     840            break;
     841        }
    857842    case PS_DATA_CUBE:
    858843        if ( psMemCheckCube(ptr) )
    859844            return true;
    860845        else {
    861             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
    862             break;
    863         }
    864 
    865 
     846            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     847                    "Incorrect pointer.  Datatypes do not match.\n");
     848            break;
     849        }
    866850    case PS_DATA_FITS:
    867851        if ( psMemCheckFits(ptr) )
    868852            return true;
    869853        else {
    870             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
    871             break;
    872         }
    873 
     854            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     855                    "Incorrect pointer.  Datatypes do not match.\n");
     856            break;
     857        }
    874858    case PS_DATA_HASH:
    875859        if ( psMemCheckHash(ptr) )
    876860            return true;
    877861        else {
    878             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     862            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     863                    "Incorrect pointer.  Datatypes do not match.\n");
    879864            break;
    880865        }
     
    883868            return true;
    884869        else {
    885             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     870            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     871                    "Incorrect pointer.  Datatypes do not match.\n");
    886872            break;
    887873        }
     
    890876            return true;
    891877        else {
    892             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     878            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     879                    "Incorrect pointer.  Datatypes do not match.\n");
    893880            break;
    894881        }
     
    897884            return true;
    898885        else {
    899             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     886            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     887                    "Incorrect pointer.  Datatypes do not match.\n");
    900888            break;
    901889        }
     
    904892            return true;
    905893        else {
    906             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     894            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     895                    "Incorrect pointer.  Datatypes do not match.\n");
    907896            break;
    908897        }
     
    911900            return true;
    912901        else {
    913             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     902            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     903                    "Incorrect pointer.  Datatypes do not match.\n");
    914904            break;
    915905        }
     
    918908            return true;
    919909        else {
    920             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     910            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     911                    "Incorrect pointer.  Datatypes do not match.\n");
    921912            break;
    922913        }
     
    925916            return true;
    926917        else {
    927             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     918            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     919                    "Incorrect pointer.  Datatypes do not match.\n");
    928920            break;
    929921        }
     
    932924            return true;
    933925        else {
    934             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     926            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     927                    "Incorrect pointer.  Datatypes do not match.\n");
    935928            break;
    936929        }
     
    939932            return true;
    940933        else {
    941             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     934            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     935                    "Incorrect pointer.  Datatypes do not match.\n");
    942936            break;
    943937        }
     
    946940            return true;
    947941        else {
    948             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     942            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     943                    "Incorrect pointer.  Datatypes do not match.\n");
    949944            break;
    950945        }
     
    953948            return true;
    954949        else {
    955             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     950            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     951                    "Incorrect pointer.  Datatypes do not match.\n");
    956952            break;
    957953        }
     
    960956            return true;
    961957        else {
    962             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     958            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     959                    "Incorrect pointer.  Datatypes do not match.\n");
    963960            break;
    964961        }
     
    967964            return true;
    968965        else {
    969             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     966            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     967                    "Incorrect pointer.  Datatypes do not match.\n");
    970968            break;
    971969        }
     
    974972            return true;
    975973        else {
    976             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     974            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     975                    "Incorrect pointer.  Datatypes do not match.\n");
    977976            break;
    978977        }
     
    981980            return true;
    982981        else {
    983             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     982            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     983                    "Incorrect pointer.  Datatypes do not match.\n");
    984984            break;
    985985        }
     
    988988            return true;
    989989        else {
    990             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     990            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     991                    "Incorrect pointer.  Datatypes do not match.\n");
    991992            break;
    992993        }
     
    995996            return true;
    996997        else {
    997             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
    998             break;
    999         }
    1000 
    1001         /*    case PS_DATA_READOUT:
    1002                 if ( psMemCheckReadout(ptr) )
    1003                     return true;
    1004                 else
    1005                 {
    1006                     psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
    1007                     break;
    1008                 }
    1009 
    1010         *//*    case PS_DATA_REGION:
    1011                 if ( psMemCheckRegion(ptr) )
    1012                     return true;
    1013                 else
    1014                 {
    1015                     psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
    1016                     break;
    1017                 }
    1018         */
     998            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     999                    "Incorrect pointer.  Datatypes do not match.\n");
     1000            break;
     1001        }
    10191002    case PS_DATA_SCALAR:
    10201003        if ( psMemCheckScalar(ptr) )
    10211004            return true;
    10221005        else {
    1023             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     1006            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1007                    "Incorrect pointer.  Datatypes do not match.\n");
    10241008            break;
    10251009        }
     
    10281012            return true;
    10291013        else {
    1030             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     1014            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1015                    "Incorrect pointer.  Datatypes do not match.\n");
    10311016            break;
    10321017        }
     
    10351020            return true;
    10361021        else {
    1037             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     1022            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1023                    "Incorrect pointer.  Datatypes do not match.\n");
    10381024            break;
    10391025        }
     
    10421028            return true;
    10431029        else {
    1044             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     1030            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1031                    "Incorrect pointer.  Datatypes do not match.\n");
    10451032            break;
    10461033        }
     
    10491036            return true;
    10501037        else {
    1051             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     1038            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1039                    "Incorrect pointer.  Datatypes do not match.\n");
    10521040            break;
    10531041        }
     
    10561044            return true;
    10571045        else {
    1058             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     1046            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1047                    "Incorrect pointer.  Datatypes do not match.\n");
    10591048            break;
    10601049        }
     
    10631052            return true;
    10641053        else {
    1065             psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Incorrect pointer.  Datatypes do not match.\n");
     1054            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1055                    "Incorrect pointer.  Datatypes do not match.\n");
    10661056            break;
    10671057        }
    10681058    default:
    1069         psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Invalid datatype specified.\n");
     1059        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     1060                "Invalid datatype specified.\n");
    10701061    }
    10711062    return false;
Note: See TracChangeset for help on using the changeset viewer.