IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1081


Ignore:
Timestamp:
Jun 23, 2004, 5:12:19 PM (22 years ago)
Author:
desonia
Message:

Fixed some namespace issues.

Location:
trunk/psLib/src
Files:
6 edited

Legend:

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

    r1073 r1081  
    88 *  @author Robert Lupton, Princeton University
    99 *
    10  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-06-23 23:00:15 $
     10 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-06-24 03:12:19 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    182182 * N.b. If the block wasn't allocated by psAlloc, it will appear corrupted
    183183 */
    184 #define ALIGNED(P) ((void *)((long)(P) & ~03) == (P))
    185184
    186185static int checkMemBlock(const psMemBlock *m, const char* funcName)
     
    191190    if (m == NULL) {
    192191        psError(funcName,"Memory Corruption: NULL memory block found.");
    193         return(1);
    194     }
    195 
    196     if (!ALIGNED(m)) {
    197         psError(funcName, "psMemCheckCorruption: non-aligned memory block");
    198192        return(1);
    199193    }
  • trunk/psLib/src/sys/psTrace.c

    r1013 r1081  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-06-12 05:50:01 $
     11 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-06-24 03:12:19 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4040#include "psError.h"
    4141
    42 static Component *p_psCroot = NULL;       // The root of the trace component
     42static p_psComponent *p_psCroot = NULL;       // The root of the trace component
    4343static FILE *p_psTraceFP = NULL;          // File destination for messages.
     44
     45static void componentFree(p_psComponent *comp);
     46static p_psComponent *componentAlloc(const char *name,int level);
     47
    4448/*****************************************************************************
    4549componentAlloc(): allocate memory for a new node, and initialize members.
    4650 *****************************************************************************/
    47 Component *componentAlloc(const char *name,
    48                           int level)
    49 {
    50     Component *comp = psAlloc(sizeof(Component));
     51static p_psComponent *componentAlloc(const char *name,
     52                                     int level)
     53{
     54    p_psComponent *comp = psAlloc(sizeof(p_psComponent));
     55    p_psMemSetDeallocator(comp,(psFreeFcn)componentFree);
    5156    comp->name = psStringCopy(name);
    5257    comp->level = level;
     
    6166nodes as well.
    6267 *****************************************************************************/
    63 static void componentFree(Component *comp)
     68static void componentFree(p_psComponent *comp)
    6469{
    6570    if (comp == NULL) {
     
    6974    if (comp->subcomp != NULL) {
    7075        for (int i = 0; i < comp->n; i++) {
    71             componentFree(comp->subcomp[i]);
     76            psFree(comp->subcomp[i]);
    7277        }
    7378        psFree(comp->subcomp);
     
    7580
    7681    psFree((char *)comp->name);
    77     psFree(comp);
    7882}
    7983
     
    9397Set all trace levels to zero.
    9498 *****************************************************************************/
    95 void p_psTraceReset(Component *currentNode)
     99void p_psTraceReset(p_psComponent *currentNode)
    96100{
    97101    int i = 0;
     
    128132void psTraceFree()
    129133{
    130     componentFree(p_psCroot);
     134    psFree(p_psCroot);
    131135}
    132136
     
    145149    char      *pname=name;
    146150    char      *firstComponent = NULL;       // first component of name
    147     Component *currentNode = p_psCroot;
     151    p_psComponent *currentNode = p_psCroot;
    148152    int        nodeExists = 0;
    149153
     
    181185        if (nodeExists == 0) {
    182186            currentNode->subcomp = psRealloc(currentNode->subcomp,
    183                                              (currentNode->n + 1) * sizeof(Component *));
     187                                             (currentNode->n + 1) * sizeof(p_psComponent*));
    184188            currentNode->n = (currentNode->n)+1;
    185189
     
    237241    char      *pname=name;
    238242    char      *firstComponent = NULL;   // first component of name
    239     Component *currentNode = p_psCroot;
     243    p_psComponent *currentNode = p_psCroot;
    240244    int        i = 0;
    241245
     
    310314 null
    311315 *****************************************************************************/
    312 static void doPrintTraceLevels(const Component *comp,
     316static void doPrintTraceLevels(const p_psComponent *comp,
    313317                               int depth)
    314318{
  • trunk/psLib/src/sys/psTrace.h

    r1013 r1081  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-06-12 05:50:01 $
     11 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-06-24 03:12:19 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2323    Component structure doesn't in fact contain it's full name, but only the
    2424    last part. */
    25 typedef struct Component
     25typedef struct p_psComponent
    2626{
    2727    const char *name;                     // last part of name of component
    2828    int level;                            // trace level for this component
    2929    int n;                                // number of subcomponents
    30     struct Component **subcomp;           // next level of subcomponents
     30    struct p_psComponent **subcomp;           // next level of subcomponents
    3131}
    32 Component;
     32p_psComponent;
    3333
    3434/** \addtogroup LogTrace
  • trunk/psLib/src/sysUtils/psMemory.c

    r1073 r1081  
    88 *  @author Robert Lupton, Princeton University
    99 *
    10  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-06-23 23:00:15 $
     10 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-06-24 03:12:19 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    182182 * N.b. If the block wasn't allocated by psAlloc, it will appear corrupted
    183183 */
    184 #define ALIGNED(P) ((void *)((long)(P) & ~03) == (P))
    185184
    186185static int checkMemBlock(const psMemBlock *m, const char* funcName)
     
    191190    if (m == NULL) {
    192191        psError(funcName,"Memory Corruption: NULL memory block found.");
    193         return(1);
    194     }
    195 
    196     if (!ALIGNED(m)) {
    197         psError(funcName, "psMemCheckCorruption: non-aligned memory block");
    198192        return(1);
    199193    }
  • trunk/psLib/src/sysUtils/psTrace.c

    r1013 r1081  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-06-12 05:50:01 $
     11 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-06-24 03:12:19 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4040#include "psError.h"
    4141
    42 static Component *p_psCroot = NULL;       // The root of the trace component
     42static p_psComponent *p_psCroot = NULL;       // The root of the trace component
    4343static FILE *p_psTraceFP = NULL;          // File destination for messages.
     44
     45static void componentFree(p_psComponent *comp);
     46static p_psComponent *componentAlloc(const char *name,int level);
     47
    4448/*****************************************************************************
    4549componentAlloc(): allocate memory for a new node, and initialize members.
    4650 *****************************************************************************/
    47 Component *componentAlloc(const char *name,
    48                           int level)
    49 {
    50     Component *comp = psAlloc(sizeof(Component));
     51static p_psComponent *componentAlloc(const char *name,
     52                                     int level)
     53{
     54    p_psComponent *comp = psAlloc(sizeof(p_psComponent));
     55    p_psMemSetDeallocator(comp,(psFreeFcn)componentFree);
    5156    comp->name = psStringCopy(name);
    5257    comp->level = level;
     
    6166nodes as well.
    6267 *****************************************************************************/
    63 static void componentFree(Component *comp)
     68static void componentFree(p_psComponent *comp)
    6469{
    6570    if (comp == NULL) {
     
    6974    if (comp->subcomp != NULL) {
    7075        for (int i = 0; i < comp->n; i++) {
    71             componentFree(comp->subcomp[i]);
     76            psFree(comp->subcomp[i]);
    7277        }
    7378        psFree(comp->subcomp);
     
    7580
    7681    psFree((char *)comp->name);
    77     psFree(comp);
    7882}
    7983
     
    9397Set all trace levels to zero.
    9498 *****************************************************************************/
    95 void p_psTraceReset(Component *currentNode)
     99void p_psTraceReset(p_psComponent *currentNode)
    96100{
    97101    int i = 0;
     
    128132void psTraceFree()
    129133{
    130     componentFree(p_psCroot);
     134    psFree(p_psCroot);
    131135}
    132136
     
    145149    char      *pname=name;
    146150    char      *firstComponent = NULL;       // first component of name
    147     Component *currentNode = p_psCroot;
     151    p_psComponent *currentNode = p_psCroot;
    148152    int        nodeExists = 0;
    149153
     
    181185        if (nodeExists == 0) {
    182186            currentNode->subcomp = psRealloc(currentNode->subcomp,
    183                                              (currentNode->n + 1) * sizeof(Component *));
     187                                             (currentNode->n + 1) * sizeof(p_psComponent*));
    184188            currentNode->n = (currentNode->n)+1;
    185189
     
    237241    char      *pname=name;
    238242    char      *firstComponent = NULL;   // first component of name
    239     Component *currentNode = p_psCroot;
     243    p_psComponent *currentNode = p_psCroot;
    240244    int        i = 0;
    241245
     
    310314 null
    311315 *****************************************************************************/
    312 static void doPrintTraceLevels(const Component *comp,
     316static void doPrintTraceLevels(const p_psComponent *comp,
    313317                               int depth)
    314318{
  • trunk/psLib/src/sysUtils/psTrace.h

    r1013 r1081  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-06-12 05:50:01 $
     11 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-06-24 03:12:19 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2323    Component structure doesn't in fact contain it's full name, but only the
    2424    last part. */
    25 typedef struct Component
     25typedef struct p_psComponent
    2626{
    2727    const char *name;                     // last part of name of component
    2828    int level;                            // trace level for this component
    2929    int n;                                // number of subcomponents
    30     struct Component **subcomp;           // next level of subcomponents
     30    struct p_psComponent **subcomp;           // next level of subcomponents
    3131}
    32 Component;
     32p_psComponent;
    3333
    3434/** \addtogroup LogTrace
Note: See TracChangeset for help on using the changeset viewer.