Changeset 7901 for trunk/psLib/src/sys/psMemory.c
- Timestamp:
- Jul 13, 2006, 4:26:25 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psMemory.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psMemory.c
r7617 r7901 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1.7 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-0 6-21 21:40:12$10 * @version $Revision: 1.74 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-07-14 02:26:25 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psAbort.h" 25 25 #include "psLogMsg.h" 26 27 26 #include "psBitSet.h" 28 //#include "psArray.h"29 //#include "psImage.h"30 //#include "psList.h"31 //#include "psLookupTable.h"32 //#include "psHash.h"33 34 //#include "psMetadata.h"35 27 #include "psFits.h" 36 28 #include "psPixels.h" 37 //#include "psScalar.h"38 //#include "psVector.h"39 //#include "psTime.h"40 //#include "psCoord.h"41 29 #include "psSphereOps.h" 42 //#include "psStats.h"43 30 #include "psMinimizeLMM.h" 44 31 #include "psImageConvolve.h" 45 32 #include "psTime.h" 46 33 #include "psLine.h" 34 #include "psRegion.h" 47 35 #include "psErrorText.h" 48 36 … … 837 825 } 838 826 827 bool is_psType(psPtr ptr) 828 { 829 if (ptr == NULL) { 830 return false; 831 } 832 psMemBlock* m = ((psMemBlock* ) ptr) - 1; 833 if (m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC) { 834 return false; //Probably not a psAllocated-Type 835 } else { 836 return true; 837 } 838 } 839 839 840 bool psMemCheckType(psDataType type, 840 841 psPtr ptr) 841 842 { 843 if (!is_psType(ptr)) { 844 return false; 845 } 846 842 847 switch(type) { 843 848 case PS_DATA_ARRAY: … … 905 910 break; 906 911 } 912 case PS_DATA_LINE: 913 if ( psMemCheckLine(ptr) ) 914 return true; 915 else { 916 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 917 "Incorrect pointer. Datatypes do not match.\n"); 918 break; 919 } 907 920 case PS_DATA_LIST: 908 921 if ( psMemCheckList(ptr) ) … … 1017 1030 break; 1018 1031 } 1032 case PS_DATA_REGION: 1033 if ( psMemCheckRegion(ptr) ) 1034 return true; 1035 else { 1036 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 1037 "Incorrect pointer. Datatypes do not match.\n"); 1038 break; 1039 } 1019 1040 case PS_DATA_SCALAR: 1020 1041 if ( psMemCheckScalar(ptr) ) … … 1051 1072 case PS_DATA_STATS: 1052 1073 if ( psMemCheckStats(ptr) ) 1074 return true; 1075 else { 1076 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 1077 "Incorrect pointer. Datatypes do not match.\n"); 1078 break; 1079 } 1080 case PS_DATA_STRING: 1081 if ( psMemCheckString(ptr) ) 1053 1082 return true; 1054 1083 else {
Note:
See TracChangeset
for help on using the changeset viewer.
