IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 9, 2004, 1:34:58 PM (22 years ago)
Author:
desonia
Message:

cleanup of some indent-induced madness.

File:
1 edited

Legend:

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

    r1407 r1440  
    77 *  @author Robert Daniel DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-08-07 00:06:06 $
     9 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-08-09 23:34:57 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2929
    3030// private functions.
    31 static psListElem *listGetIterator(psList * list);
    32 static int listGetIteratorIndex(psList * list);
    33 static void listSetIterator(psList * list, int where, bool lockList);
    34 static void listFree(psList * list);
    35 
    36 psList *psListAlloc(void *data)
    37 {
    38     psList *list = psAlloc(sizeof(psList));
     31static psListElem* listGetIterator(psList* list);
     32static int listGetIteratorIndex(psList* list);
     33static void listSetIterator(psList* list, int where, bool lockList);
     34static void listFree(psList* list);
     35
     36psList* psListAlloc(void *data)
     37{
     38    psList* list = psAlloc(sizeof(psList));
    3939
    4040    p_psMemSetDeallocator(list, (psFreeFcn) listFree);
     
    5555}
    5656
    57 static void listFree(psList * list)
     57static void listFree(psList* list)
    5858{
    5959    if (list == NULL) {
     
    6464    ;
    6565
    66     for (psListElem * ptr = list->head; ptr != NULL;) {
    67         psListElem *next = ptr->next;
     66    for (psListElem* ptr = list->head; ptr != NULL;) {
     67        psListElem* next = ptr->next;
    6868
    6969        psFree(ptr->data);
     
    8181}
    8282
    83 bool psListAdd(psList * list, void *data, int where)
    84 {
    85     psListElem *position;
    86     psListElem *elem;
     83bool psListAdd(psList* list, void *data, int where)
     84{
     85    psListElem* position;
     86    psListElem* elem;
    8787    int cursorIndex = 0;
    8888
     
    168168 * Remove an element from a list
    169169 */
    170 bool psListRemove(psList * list, void *data, int which)
    171 {
    172     psListElem *elem = NULL;    // element to remove
     170bool psListRemove(psList* list, void *data, int which)
     171{
     172    psListElem* elem = NULL;    // element to remove
    173173    int cursorIndex = 0;
    174174
     
    186186        int i = 0;              // index
    187187
    188         for (psListElem * ptr = list->head; ptr != NULL; ptr = ptr->next) {
     188        for (psListElem* ptr = list->head; ptr != NULL; ptr = ptr->next) {
    189189            if (ptr->data == data) {
    190190                which = i;
     
    243243}
    244244
    245 void psListSetIterator(psList * list, int where)
     245void psListSetIterator(psList* list, int where)
    246246{
    247247    listSetIterator(list, where, true);
    248248}
    249249
    250 void listSetIterator(psList * list, int where, bool lockList)
    251 {
    252     psListElem *cursor;
     250void listSetIterator(psList* list, int where, bool lockList)
     251{
     252    psListElem* cursor;
    253253    int position;
    254254
     
    340340}
    341341
    342 psListElem *listGetIterator(psList * list)
     342psListElem* listGetIterator(psList* list)
    343343{
    344344    if (list == NULL) {
     
    355355}
    356356
    357 int listGetIteratorIndex(psList * list)
     357int listGetIteratorIndex(psList* list)
    358358{
    359359    if (list->iter == ITER_INIT_HEAD) {
     
    366366}
    367367
    368 void *psListGet(psList * list, int which)
    369 {
    370     psListElem *element;
     368void *psListGet(psList* list, int which)
     369{
     370    psListElem* element;
    371371
    372372    psListSetIterator(list, which);
     
    383383 * and now return the previous/next element of the list
    384384 */
    385 void *psListGetNext(psList * list)
     385void *psListGetNext(psList* list)
    386386{
    387387    return psListGet(list, PS_LIST_NEXT);
    388388}
    389389
    390 void *psListGetPrevious(psList * list)
     390void *psListGetPrevious(psList* list)
    391391{
    392392    return psListGet(list, PS_LIST_PREVIOUS);
    393393}
    394394
    395 void *psListGetCurrent(psList * list)
     395void *psListGetCurrent(psList* list)
    396396{
    397397    return psListGet(list, PS_LIST_CURRENT);
     
    401401 * Convert a psList to/from a psVoidPtrArray
    402402 */
    403 psArray *psListToArray(psList * restrict list)
    404 {
    405     psListElem *ptr;
     403psArray* psListToArray(psList* restrict list)
     404{
     405    psListElem* ptr;
    406406    unsigned int n;
    407     psArray *restrict arr;
     407    psArray* restrict arr;
    408408
    409409    if (list == NULL) {
     
    429429}
    430430
    431 psList *psArrayToList(psArray * arr)
     431psList* psArrayToList(psArray* arr)
    432432{
    433433    unsigned int n;
    434     psList *list;               // list of elements
     434    psList* list;               // list of elements
    435435
    436436    if (arr == NULL) {
     
    447447}
    448448
    449 psList *psListSort(psList * list, psComparePtrFcn compare)
    450 {
    451     psArray *arr;
     449psList* psListSort(psList* list, psComparePtrFcn compare)
     450{
     451    psArray* arr;
    452452
    453453    if (list == NULL) {
Note: See TracChangeset for help on using the changeset viewer.