Changeset 15562 for trunk/psModules/src/objects/pmModelClass.c
- Timestamp:
- Nov 9, 2007, 3:09:20 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmModelClass.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmModelClass.c
r14938 r15562 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2007- 09-21 00:09:05$8 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-11-10 01:09:20 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 57 57 static void ModelClassFree (pmModelClass *modelClass) 58 58 { 59 60 59 if (modelClass == NULL) 61 60 return; … … 70 69 } 71 70 71 bool psMemCheckModelClass(psPtr ptr) 72 { 73 PS_ASSERT_PTR(ptr, false); 74 return ( psMemGetDeallocator(ptr) == (psFreeFunc) ModelClassFree); 75 } 76 72 77 void pmModelClassAdd (pmModelClass *model) 73 78 { 74 79 if (models == NULL) { 75 pmModelClassInit ();80 pmModelClassInit(); 76 81 } 77 82 … … 85 90 { 86 91 // if we do not need to init, return false; 87 if (models != NULL) 92 if (models != NULL) { 88 93 return false; 94 } 89 95 90 96 int Nnew = sizeof (defaultModels) / sizeof (pmModelClass); … … 100 106 pmModelClass *pmModelClassSelect (pmModelType type) 101 107 { 108 if (models == NULL) { 109 pmModelClassInit(); 110 } 111 102 112 if ((type < 0) || (type >= Nmodels)) { 103 113 psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType"); … … 111 121 psFree (models); 112 122 models = NULL; 123 Nmodels = 0; 113 124 return; 114 125 } … … 116 127 psS32 pmModelClassParameterCount (pmModelType type) 117 128 { 129 if (models == NULL) { 130 pmModelClassInit(); 131 } 132 118 133 if ((type < 0) || (type >= Nmodels)) { 119 134 psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType"); … … 125 140 psS32 pmModelClassGetType (char *name) 126 141 { 142 if (models == NULL) { 143 pmModelClassInit(); 144 } 145 127 146 for (int i = 0; i < Nmodels; i++) { 128 147 if (!strcmp(models[i].name, name)) { … … 135 154 char *pmModelClassGetName (pmModelType type) 136 155 { 156 if (models == NULL) { 157 pmModelClassInit(); 158 } 159 137 160 if ((type < 0) || (type >= Nmodels)) { 138 161 psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType");
Note:
See TracChangeset
for help on using the changeset viewer.
