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/psHash.c

    r1420 r1440  
    1111*  @author George Gusciora, MHPCC
    1212*
    13 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-09 20:29:43 $
     13*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-09 23:34:57 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626#include "psAbort.h"
    2727
    28 static psHashBucket *hashBucketAlloc(const char *key, void *data, psHashBucket * next);
    29 static void hashBucketFree(psHashBucket * bucket);
    30 static void *doHashWork(psHash * table, const char *key, void *data, bool remove
     28static psHashBucket* hashBucketAlloc(const char *key, void *data, psHashBucket* next);
     29static void hashBucketFree(psHashBucket* bucket);
     30static void *doHashWork(psHash* table, const char *key, void *data, bool remove
    3131                           );
    32 static void hashFree(psHash * table);
     32static void hashFree(psHash* table);
    3333
    3434/******************************************************************************
     
    4040    The linked list
    4141 *****************************************************************************/
    42 psList *psHashKeyList(psHash * table)
     42psList* psHashKeyList(psHash* table)
    4343{
    4444    int i = 0;                  // Loop index variable
    45     psList *myLinkList = NULL;  // The output data structure
    46     psHashBucket *ptr = NULL;   // Used to step thru linked list.
     45    psList* myLinkList = NULL;  // The output data structure
     46    psHashBucket* ptr = NULL;   // Used to step thru linked list.
    4747
    4848    if (table == NULL) {
     
    8181    the new hash bucket.
    8282 *****************************************************************************/
    83 static psHashBucket *hashBucketAlloc(const char *key, void *data, psHashBucket * next)
     83static psHashBucket* hashBucketAlloc(const char *key, void *data, psHashBucket* next)
    8484{
    8585    if (key == NULL) {
     
    8787    }
    8888    // Allocate memory for the new hash bucket.
    89     psHashBucket *bucket = psAlloc(sizeof(psHashBucket));
     89    psHashBucket* bucket = psAlloc(sizeof(psHashBucket));
    9090
    9191    p_psMemSetDeallocator(bucket, (psFreeFcn) hashBucketFree);
     
    114114    NONE
    115115 *****************************************************************************/
    116 static void hashBucketFree(psHashBucket * bucket)
     116static void hashBucketFree(psHashBucket* bucket)
    117117{
    118118    if (bucket == NULL) {
     
    133133    The new hash table.
    134134 *****************************************************************************/
    135 psHash *psHashAlloc(int nbucket)        // initial number of buckets
     135psHash* psHashAlloc(int nbucket)        // initial number of buckets
    136136{
    137137    int i = 0;                  // loop index variable
    138138
    139139    // Create the new hash table.
    140     psHash *table = psAlloc(sizeof(psHash));
     140    psHash* table = psAlloc(sizeof(psHash));
    141141
    142142    p_psMemSetDeallocator(table, (psFreeFcn) hashFree);
    143143
    144144    // Allocate memory for the buckets.
    145     table->buckets = psAlloc(nbucket * sizeof(psHashBucket *));
     145    table->buckets = psAlloc(nbucket * sizeof(psHashBucket* ));
    146146    table->nbucket = nbucket;
    147147
     
    168168    NONE
    169169 *****************************************************************************/
    170 static void hashFree(psHash * table)
     170static void hashFree(psHash* table)
    171171{
    172172    int i = 0;                  // Loop index variable.
     
    210210there is little common code between those functions.
    211211  *****************************************************************************/
    212 static void *doHashWork(psHash * table, const char *key, void *data, bool remove
     212static void *doHashWork(psHash* table, const char *key, void *data, bool remove
    213213                           )
    214214{
     
    217217    // "hashed" from the key.
    218218    char *tmpchar = NULL;       // Used in computing the hash function.
    219     psHashBucket *ptr = NULL;   // Used to retrieve the hash bucket.
    220     psHashBucket *optr = NULL;  // "original pointer": used to step
     219    psHashBucket* ptr = NULL;   // Used to retrieve the hash bucket.
     220    psHashBucket* optr = NULL;  // "original pointer": used to step
    221221
    222222    // thru the linked list for a bucket.
     
    338338    boolean value defining success or failure
    339339 *****************************************************************************/
    340 bool psHashAdd(psHash * table, const char *key, void *data)
     340bool psHashAdd(psHash* table, const char *key, void *data)
    341341{
    342342    if (table == NULL) {
     
    364364    The data associated with that key.
    365365 *****************************************************************************/
    366 void *psHashLookup(psHash * table,      // table to lookup key in
     366void *psHashLookup(psHash* table,      // table to lookup key in
    367367                   const char *key)     // key to lookup
    368368{
     
    387387    boolean value defining success or failure
    388388 *****************************************************************************/
    389 bool psHashRemove(psHash * table, const char *key)
     389bool psHashRemove(psHash* table, const char *key)
    390390{
    391391    void *data = NULL;
Note: See TracChangeset for help on using the changeset viewer.