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.

Location:
trunk/psLib/src/sysUtils
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sysUtils/psMemory.c

    r1407 r1440  
    99*  @author Robert Lupton, Princeton University
    1010*
    11 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-07 00:06:06 $
     11*  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-08-09 23:34:58 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3131#define P_PS_LARGE_BLOCK_SIZE 65536        // size where under, we try to recycle
    3232
    33 static int checkMemBlock(const psMemBlock * m, const char *funcName);
    34 static psMemBlock *lastMemBlockAllocated = NULL;
     33static int checkMemBlock(const psMemBlock* m, const char *funcName);
     34static psMemBlock* lastMemBlockAllocated = NULL;
    3535static pthread_mutex_t memBlockListMutex = PTHREAD_MUTEX_INITIALIZER;
    3636static pthread_mutex_t memIdMutex = PTHREAD_MUTEX_INITIALIZER;
     
    4444
    4545// N.B. recycleBinSize should be terminated by P_PS_LARGE_BLOCK_SIZE (simplifies search loops)
    46 static psMemBlock *recycleMemBlockList[13] = {
     46static psMemBlock* recycleMemBlockList[13] = {
    4747            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
    4848        };
    4949
    5050#ifdef PS_MEM_DEBUG
    51 static psMemBlock *deadBlockList;       // a place to put dead memBlocks in debug mode.
     51static psMemBlock* deadBlockList;       // a place to put dead memBlocks in debug mode.
    5252#endif
    5353
     
    6969    while (level >= 0 && ptr == NULL) {
    7070        while (recycleMemBlockList[level] != NULL && ptr == NULL) {
    71             psMemBlock *old = recycleMemBlockList[level];
     71            psMemBlock* old = recycleMemBlockList[level];
    7272
    7373            recycleMemBlockList[level] = recycleMemBlockList[level]->nextBlock;
     
    9797}
    9898
    99 static void memProblemCallbackDefault(const psMemBlock * ptr, const char *file, int lineno)
     99static void memProblemCallbackDefault(const psMemBlock* ptr, const char *file, int lineno)
    100100{
    101101    if (ptr->refCounter < 1) {
     
    156156 * isn't resignalled)
    157157 */
    158 static psMemoryId memAllocateCallbackDefault(const psMemBlock * ptr)
     158static psMemoryId memAllocateCallbackDefault(const psMemBlock* ptr)
    159159{
    160160    static psMemoryId incr = 0; // "p_psMemAllocateID += incr"
     
    163163}
    164164
    165 static psMemoryId memFreeCallbackDefault(const psMemBlock * ptr)
     165static psMemoryId memFreeCallbackDefault(const psMemBlock* ptr)
    166166{
    167167    static psMemoryId incr = 0; // "p_psMemFreeID += incr"
     
    222222 */
    223223
    224 static int checkMemBlock(const psMemBlock * m, const char *funcName)
     224static int checkMemBlock(const psMemBlock* m, const char *funcName)
    225225{
    226226    // n.b. since this is called by psMemCheckCorruption while the memblock list is mutex locked,
     
    257257    pthread_mutex_lock(&memBlockListMutex);
    258258
    259     for (psMemBlock * iter = lastMemBlockAllocated; iter != NULL; iter = iter->nextBlock) {
     259    for (psMemBlock* iter = lastMemBlockAllocated; iter != NULL; iter = iter->nextBlock) {
    260260        if (checkMemBlock(iter, __func__)) {
    261261            nbad++;
     
    280280{
    281281
    282     psMemBlock *ptr = NULL;
     282    psMemBlock* ptr = NULL;
    283283
    284284    // memory is of the size I want to bother recycling?
     
    327327    // increment the memory id safely.
    328328    pthread_mutex_lock(&memBlockListMutex);
    329     *(psMemoryId *) & ptr->id = ++memid;
     329    *(psMemoryId* ) & ptr->id = ++memid;
    330330    pthread_mutex_unlock(&memBlockListMutex);
    331331
     
    363363        return p_psAlloc(size, file, lineno);
    364364    } else {
    365         psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
     365        psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    366366        bool isBlockLast = false;
    367367
     
    376376        isBlockLast = (ptr == lastMemBlockAllocated);
    377377
    378         ptr = (psMemBlock *) realloc(ptr, sizeof(psMemBlock) + size + sizeof(void *));
     378        ptr = (psMemBlock* ) realloc(ptr, sizeof(psMemBlock) + size + sizeof(void *));
    379379
    380380        if (ptr == NULL) {
     
    415415 * Check for memory leaks.
    416416 */
    417 int psMemCheckLeaks(psMemoryId id0, psMemBlock *** arr, FILE * fd)
     417int psMemCheckLeaks(psMemoryId id0, psMemBlock* ** arr, FILE * fd)
    418418{
    419419    int nleak = 0;
    420420    int j = 0;
    421     psMemBlock *topBlock = lastMemBlockAllocated;
     421    psMemBlock* topBlock = lastMemBlockAllocated;
    422422
    423423    pthread_mutex_lock(&memBlockListMutex);
    424424
    425     for (psMemBlock * iter = topBlock; iter != NULL; iter = iter->nextBlock) {
     425    for (psMemBlock* iter = topBlock; iter != NULL; iter = iter->nextBlock) {
    426426        if ((psMemGetRefCounter(iter + 1) > 0) && (iter->id >= id0)) {
    427427            nleak++;
     
    446446    pthread_mutex_lock(&memBlockListMutex);
    447447
    448     for (psMemBlock * iter = topBlock; iter != NULL; iter = iter->nextBlock) {
     448    for (psMemBlock* iter = topBlock; iter != NULL; iter = iter->nextBlock) {
    449449        if ((psMemGetRefCounter(iter + 1) > 0) && (iter->id >= id0)) {
    450450            (*arr)[j++] = iter;
     
    466466psReferenceCount psMemGetRefCounter(void *vptr)
    467467{
    468     psMemBlock *ptr;
     468    psMemBlock* ptr;
    469469    unsigned int refCount;
    470470
     
    473473    }
    474474
    475     ptr = ((psMemBlock *) vptr) - 1;
     475    ptr = ((psMemBlock* ) vptr) - 1;
    476476
    477477    if (checkMemBlock(ptr, __func__) != 0) {
     
    489489void *p_psMemIncrRefCounter(void *vptr, const char *file, int lineno)
    490490{
    491     psMemBlock *ptr;
     491    psMemBlock* ptr;
    492492
    493493    if (vptr == NULL) {
     
    495495    }
    496496
    497     ptr = ((psMemBlock *) vptr) - 1;
     497    ptr = ((psMemBlock* ) vptr) - 1;
    498498
    499499    if (checkMemBlock(ptr, __func__)) {
     
    515515    }
    516516
    517     psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
     517    psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    518518
    519519    if (checkMemBlock(ptr, __func__) != 0) {
     
    607607    }
    608608
    609     psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
     609    psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    610610
    611611    if (checkMemBlock(ptr, __func__) != 0) {
     
    622622    }
    623623
    624     psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
     624    psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    625625
    626626    if (checkMemBlock(ptr, __func__) != 0) {
  • trunk/psLib/src/sysUtils/psMemory.h

    r1426 r1440  
    1515 *  @ingroup MemoryManagement
    1616 *
    17  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    18  *  @date $Date: 2004-08-09 22:44:25 $
     17 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     18 *  @date $Date: 2004-08-09 23:34:58 $
    1919 *
    2020 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6464{
    6565    const void *startblock;     ///< initialised to p_psMEMMAGIC
    66     struct psMemBlock *previousBlock;   ///< previous block in allocation list
    67     struct psMemBlock *nextBlock;       ///< next block allocation list
     66    struct psMemBlock* previousBlock;   ///< previous block in allocation list
     67    struct psMemBlock* nextBlock;       ///< next block allocation list
    6868    psFreeFcn freeFcn;          ///< deallocator.  If NULL, use generic deallocation.
    6969    size_t userMemorySize;      ///< the size of the user-portion of the memory block
     
    8282 *  @ingroup memCallback
    8383 */
    84 typedef psMemoryId(*psMemAllocateCallback) (const psMemBlock * ptr      ///< the psMemBlock just allocated
     84typedef psMemoryId(*psMemAllocateCallback) (const psMemBlock* ptr      ///< the psMemBlock just allocated
    8585                                           );
    8686
     
    9090 *  @ingroup memCallback
    9191 */
    92 typedef psMemoryId(*psMemFreeCallback) (const psMemBlock * ptr  ///< the psMemBlock being freed
     92typedef psMemoryId(*psMemFreeCallback) (const psMemBlock* ptr  ///< the psMemBlock being freed
    9393                                       );
    9494
     
    100100 *  @ingroup memCallback
    101101 */
    102 typedef void (*psMemProblemCallback) (const psMemBlock * ptr,   ///< the pointer to the problematic memory
     102typedef void (*psMemProblemCallback) (const psMemBlock* ptr,   ///< the pointer to the problematic memory
    103103                                      // block.
    104104                                      const char *file, ///< the file in which the problem originated
     
    195195 */
    196196int psMemCheckLeaks(psMemoryId id0,     ///< don't list blocks with id < id0
    197                     psMemBlock *** arr, ///< pointer to array of pointers to leaked blocks, or NULL
     197                    psMemBlock* ** arr, ///< pointer to array of pointers to leaked blocks, or NULL
    198198                    FILE * fd   ///< print list of leaks to fd (or NULL)
    199199                   );
  • trunk/psLib/src/sysUtils/psTrace.c

    r1407 r1440  
    1010 *  @author George Gusciora, MHPCC
    1111 *
    12  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-07 00:06:06 $
     12 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-09 23:34:58 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4545#    include "psError.h"
    4646
    47 static p_psComponent *p_psCroot = NULL; // The root of the trace component
     47static p_psComponent* p_psCroot = NULL; // The root of the trace component
    4848static FILE *p_psTraceFP = NULL;        // File destination for messages.
    4949
    50 static void componentFree(p_psComponent * comp);
    51 static p_psComponent *componentAlloc(const char *name, int level);
     50static void componentFree(p_psComponent* comp);
     51static p_psComponent* componentAlloc(const char *name, int level);
    5252
    5353/*****************************************************************************
    5454componentAlloc(): allocate memory for a new node, and initialize members.
    5555 *****************************************************************************/
    56 static p_psComponent *componentAlloc(const char *name, int level)
    57 {
    58     p_psComponent *comp = psAlloc(sizeof(p_psComponent));
     56static p_psComponent* componentAlloc(const char *name, int level)
     57{
     58    p_psComponent* comp = psAlloc(sizeof(p_psComponent));
    5959
    6060    p_psMemSetDeallocator(comp, (psFreeFcn) componentFree);
     
    7070nodes as well.
    7171 *****************************************************************************/
    72 static void componentFree(p_psComponent * comp)
     72static void componentFree(p_psComponent* comp)
    7373{
    7474    if (comp == NULL) {
     
    9999Set all trace levels to zero.
    100100 *****************************************************************************/
    101 void p_psTraceReset(p_psComponent * currentNode)
     101void p_psTraceReset(p_psComponent* currentNode)
    102102{
    103103    int i = 0;
     
    147147    char *pname = name;
    148148    char *firstComponent = NULL;        // first component of name
    149     p_psComponent *currentNode = p_psCroot;
     149    p_psComponent* currentNode = p_psCroot;
    150150    int nodeExists = 0;
    151151
     
    182182        if (nodeExists == 0) {
    183183            currentNode->subcomp = psRealloc(currentNode->subcomp,
    184                                              (currentNode->n + 1) * sizeof(p_psComponent *));
     184                                             (currentNode->n + 1) * sizeof(p_psComponent* ));
    185185            currentNode->n = (currentNode->n) + 1;
    186186
     
    234234    char *pname = name;
    235235    char *firstComponent = NULL;        // first component of name
    236     p_psComponent *currentNode = p_psCroot;
     236    p_psComponent* currentNode = p_psCroot;
    237237    int i = 0;
    238238
     
    303303 null
    304304 *****************************************************************************/
    305 static void doPrintTraceLevels(const p_psComponent * comp, int depth)
     305static void doPrintTraceLevels(const p_psComponent* comp, int depth)
    306306{
    307307    int i = 0;
  • trunk/psLib/src/sysUtils/psTrace.h

    r1426 r1440  
    1010 *  @author George Gusciora, MHPCC
    1111 *
    12  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-09 22:44:25 $
     12 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-09 23:34:58 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5353            int level;                  // trace level for this component
    5454            int n;                      // number of subcomponents
    55             struct p_psComponent **subcomp;     // next level of subcomponents
     55            struct p_psComponent* *subcomp;     // next level of subcomponents
    5656        }
    5757p_psComponent;
Note: See TracChangeset for help on using the changeset viewer.