Changeset 1127 for trunk/psLib/src/collections/psList.c
- Timestamp:
- Jun 29, 2004, 1:19:11 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/collections/psList.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psList.c
r1111 r1127 6 6 * @author Robert Daniel DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06-2 8 20:36:37$8 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-29 23:19:11 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 176 176 * Remove an element from a list 177 177 */ 178 void *psListRemove(psList *list, void *data, int which)178 bool psListRemove(psList *list, void *data, int which) 179 179 { 180 180 psListElem *elem = NULL; // element to remove … … 183 183 if (list == NULL) { 184 184 psError(__func__,"list parameter found to be NULL in %s",__func__); 185 return NULL;185 return false; 186 186 } 187 187 … … 204 204 if (which == PS_LIST_UNKNOWN) { 205 205 psError(__func__, "Failed to find item in given psList."); 206 return NULL;206 return false; 207 207 } 208 208 } … … 215 215 if (elem == NULL) { 216 216 psError(__func__, "Couldn't position to given index (%d) to remove element from list.",which); 217 return NULL;217 return false; 218 218 } 219 219 … … 245 245 ; 246 246 247 /* 248 * OK, delete list element and return the data 249 */ 250 data = elem->data; 247 // OK, delete list element and its data 248 psFree(elem->data); 251 249 psFree(elem); 252 return data; 250 251 return true; 253 252 } 254 253 … … 460 459 461 460 462 psList* psListSort(psList* list, psCompare Fcn compare)461 psList* psListSort(psList* list, psComparePtrFcn compare) 463 462 { 464 463 psVector* vector; … … 476 475 // convert back to linked list 477 476 list = psVectorToList(vector); 477 psFree(vector); 478 478 479 479 return list;
Note:
See TracChangeset
for help on using the changeset viewer.
