IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 7, 2004, 3:05:01 PM (22 years ago)
Author:
desonia
Message:

rewrote psImageCopy so that macro need not be expanded.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psList.c

    r1127 r1193  
    66 *  @author Robert Daniel DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-06-29 23:19:11 $
     8 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-07-08 01:05:00 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8080}
    8181
    82 psList* psListAdd(psList *list, void *data, int where)
     82bool psListAdd(psList *list, void *data, int where)
    8383{
    8484    psListElem* position;
     
    8787
    8888    if (list == NULL) {
    89         return NULL;
     89        return false;
    9090    }
    9191
    9292    if (data == NULL) {
    93         return list;
    94     }
    95     elem = psAlloc(sizeof(psListElem));
    96 
    97     pthread_mutex_lock(&list->lock)
    98     ;
     93        return false;
     94    }
    9995
    10096    if (where <= PS_LIST_UNKNOWN) {
    10197        /// XXX What is the better way to communicate this failure to the caller?
    10298        psLogMsg(__func__,PS_LOG_WARN,
    103                  "The given insert location (%i) for psListAdd is invalid. Adding to head instead.",
     99                 "The given insert location (%i) for psListAdd is invalid.",
    104100                 where);
    105         where = PS_LIST_HEAD; // given I can't tell caller about this, should just add it somewhere???
    106     }
     101        return false;
     102    }
     103
     104    elem = psAlloc(sizeof(psListElem));
     105
     106    pthread_mutex_lock(&list->lock)
     107    ;
    107108
    108109    if (where > 0 && where > list->size) {
     
    162163    ;
    163164
    164     return list;
    165 }
    166 
    167 /*****************************************************************************/
    168 
    169 psList *psListAppend(psList *list, void *data)
    170 {
    171     return psListAdd(list, data, PS_LIST_TAIL);
     165    return true;
    172166}
    173167
     
    452446    n = arr->n;
    453447    for (int i = 0; i < n; i++) {
    454         psListAppend(list,arr->data.PTR[i]);
     448        psListAdd(list,arr->data.PTR[i],PS_LIST_TAIL);
    455449    }
    456450
Note: See TracChangeset for help on using the changeset viewer.