IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

fixed indent-madness concerning preprocessor directives.

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

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sysUtils/psAbort.h

    r1426 r1441  
    1212 *  @author Eric Van Alst, MHPCC
    1313 *
    14  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-09 22:44:25 $
     14 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-09 23:40:55 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1919
    2020#ifndef PS_ABORT_H
    21 #    define PS_ABORT_H
     21#define PS_ABORT_H
    2222
    2323// Doxygen grouping tags
  • trunk/psLib/src/sysUtils/psError.h

    r1426 r1441  
    1313 *  @author Eric Van Alst, MHPCC
    1414 *
    15  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2004-08-09 22:44:25 $
     15 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2004-08-09 23:40:55 $
    1717 *
    1818 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2020
    2121#ifndef PS_ERROR_H
    22 #    define PS_ERROR_H
     22#define PS_ERROR_H
    2323
    2424/** @addtogroup ErrorHandling
  • trunk/psLib/src/sysUtils/psLogMsg.c

    r1407 r1441  
    1212 *  @author George Gusciora, MHPCC
    1313 *
    14  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-07 00:06:06 $
     14 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-09 23:40:55 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    216216
    217217#if !defined(HOST_NAME_MAX)                // should be in limits.h
    218 #    define HOST_NAME_MAX 256
     218#define HOST_NAME_MAX 256
    219219#endif
    220220
  • trunk/psLib/src/sysUtils/psLogMsg.h

    r1426 r1441  
    1212 *  @author George Gusciora, MHPCC
    1313 *
    14  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-09 22:44:25 $
     14 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-09 23:40:55 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1818 */
    1919#if !defined(PS_LOG_MSG_H)
    20 #    define PS_LOG_MSG_H
    21 #    include <stdarg.h>
     20#define PS_LOG_MSG_H
     21#include <stdarg.h>
    2222
    2323/** @addtogroup LogTrace
  • trunk/psLib/src/sysUtils/psMemory.h

    r1440 r1441  
    11#if !defined(PS_MEMORY_H)
    2 #    define PS_MEMORY_H
     2#define PS_MEMORY_H
    33
    44/** @file  psMemory.h
     
    1515 *  @ingroup MemoryManagement
    1616 *
    17  *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    18  *  @date $Date: 2004-08-09 23:34:58 $
     17 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     18 *  @date $Date: 2004-08-09 23:40:55 $
    1919 *
    2020 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    2121 */
    2222
    23 #    include <stdio.h>                     // needed for FILE
    24 #    include <stdbool.h>
    25 #    include <pthread.h>                   // we need a mutex to make this stuff thread safe.
     23#include <stdio.h>                     // needed for FILE
     24#include <stdbool.h>
     25#include <pthread.h>                   // we need a mutex to make this stuff thread safe.
    2626
    2727/** @addtogroup MemoryManagement
     
    122122 *  @see psFree
    123123 */
    124 #    ifdef DOXYGEN
     124#ifdef DOXYGEN
    125125void *psAlloc(size_t size       ///< Size required
    126126             );
    127 #    else
    128 
    129     void *p_psAlloc(size_t size,    ///< Size required
    130                     const char *file,       ///< File of call
    131                     int lineno      ///< Line number of call
    132                    );
     127#else
     128
     129void *p_psAlloc(size_t size,    ///< Size required
     130                const char *file,       ///< File of call
     131                int lineno      ///< Line number of call
     132               );
    133133
    134134void p_psMemSetDeallocator(void *ptr, psFreeFcn freeFcn);
     
    136136
    137137/// Memory allocation. psAlloc sends file and line number to p_psAlloc.
    138 #        define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__)
    139 #    endif
     138#define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__)
     139#endif
    140140
    141141/** Memory re-allocation.  This operates much like realloc(), but is guaranteed to return a non-NULL value.
     
    144144 *  @see psAlloc, psFree
    145145 */
    146 #    ifdef DOXYGEN
     146#ifdef DOXYGEN
    147147void *psRealloc(void *ptr       ///< Pointer to re-allocate
    148148                size_t size,    ///< Size required
    149149               );
    150 #    else
    151 
    152     void *p_psRealloc(void *ptr,    ///< Pointer to re-allocate
    153                       size_t size,  ///< Size required
    154                       const char *file,     ///< File of call
    155                       int lineno    ///< Line number of call
    156                      );
     150#else
     151
     152void *p_psRealloc(void *ptr,    ///< Pointer to re-allocate
     153                  size_t size,  ///< Size required
     154                  const char *file,     ///< File of call
     155                  int lineno    ///< Line number of call
     156                 );
    157157
    158158/// Memory re-allocation.  psRealloc sends file and line number to p_psRealloc.
    159 #        define psRealloc(ptr, size) p_psRealloc(ptr, size, __FILE__, __LINE__)
    160 
    161 #    endif
     159#define psRealloc(ptr, size) p_psRealloc(ptr, size, __FILE__, __LINE__)
     160
     161#endif
    162162
    163163/** Free memory.  This operates much like free().
     
    165165 *  @see psAlloc, psRealloc
    166166 */
    167 #    ifdef DOXYGEN
     167#ifdef DOXYGEN
    168168void psFree(void *ptr,          ///< Pointer to free, if NULL, function returns immediately.
    169169           );
    170 #    else
    171 
    172     void p_psFree(void *ptr,        ///< Pointer to free
    173                   const char *file, ///< File of call
    174                   int lineno        ///< Line number of call
    175                  );
     170#else
     171
     172void p_psFree(void *ptr,        ///< Pointer to free
     173              const char *file, ///< File of call
     174              int lineno        ///< Line number of call
     175             );
    176176
    177177/// Free memory.  psFree sends file and line number to p_psFree.
    178 #        define psFree(size) p_psFree(size, __FILE__, __LINE__)
    179 
    180 #    endif
     178#define psFree(size) p_psFree(size, __FILE__, __LINE__)
     179
     180#endif
    181181
    182182/** Check for memory leaks.  This scans for allocated memory buffers not freed with an ID not less than id0.
     
    218218 *  @ingroup memRefCount
    219219 */
    220 #    ifdef DOXYGEN
     220#ifdef DOXYGEN
    221221void *psMemIncrRefCounter(void *vptr    ///< Pointer to increment refCounter, and return
    222222                         );
    223 #    else
    224 
    225     void *p_psMemIncrRefCounter(void *vptr, ///< Pointer to increment refCounter, and return
    226                                 const char *file,   ///< File of call
    227                                 int lineno  ///< Line number of call
    228                                );
    229 
    230 #        define psMemIncrRefCounter(vptr) p_psMemIncrRefCounter(vptr, __FILE__, __LINE__)
    231 #    endif
     223#else
     224
     225void *p_psMemIncrRefCounter(void *vptr, ///< Pointer to increment refCounter, and return
     226                            const char *file,   ///< File of call
     227                            int lineno  ///< Line number of call
     228                           );
     229
     230#define psMemIncrRefCounter(vptr) p_psMemIncrRefCounter(vptr, __FILE__, __LINE__)
     231#endif
    232232
    233233/** Decrement reference counter and return the pointer
     
    235235 *  @ingroup memRefCount
    236236 */
    237 #    ifdef DOXYGEN
     237#ifdef DOXYGEN
    238238void *psMemDecrRefCounter(void *vptr    ///< Pointer to decrement refCounter, and return
    239239                         );
    240 #    else
    241 
    242     void *p_psMemDecrRefCounter(void *vptr, ///< Pointer to decrement refCounter, and return
    243                                 const char *file,   ///< File of call
    244                                 int lineno  ///< Line number of call
    245                                );
    246 
    247 #        define psMemDecrRefCounter(vptr) p_psMemDecrRefCounter(vptr, __FILE__, __LINE__)
    248 #    endif
     240#else
     241
     242void *p_psMemDecrRefCounter(void *vptr, ///< Pointer to decrement refCounter, and return
     243                            const char *file,   ///< File of call
     244                            int lineno  ///< Line number of call
     245                           );
     246
     247#define psMemDecrRefCounter(vptr) p_psMemDecrRefCounter(vptr, __FILE__, __LINE__)
     248#endif
    249249
    250250/** Set callback for problems
     
    297297//@} End of Memory Management Functions
    298298
    299 #    ifndef DOXYGEN
     299#ifndef DOXYGEN
    300300
    301301/*
    302302 * Ensure that any program using malloc/realloc/free will fail to compile
    303303 */
    304 #        ifndef PS_ALLOW_MALLOC
    305 #            ifdef __GNUC__
    306 #                pragma GCC poison malloc realloc calloc free
    307 #            else
    308     #                define malloc(S)       _Pragma("error Use of malloc is not allowed.  Use psAlloc instead.")
    309     #                define realloc(P,S)    _Pragma("error Use of realloc is not allowed.  Use psRealloc instead.")
    310     #                define calloc(S)       _Pragma("error Use of calloc is not allowed.  Use psAlloc instead.")
    311     #                define free(P)         _Pragma("error Use of free is not allowed.  Use psFree instead.")
    312     #            endif
    313     #        endif
    314 
    315     #    endif
    316     // doxygen skip
    317 
    318     #endif // end of header file
     304#ifndef PS_ALLOW_MALLOC
     305#ifdef __GNUC__
     306#pragma GCC poison malloc realloc calloc free
     307#else
     308#                define malloc(S)       _Pragma("error Use of malloc is not allowed.  Use psAlloc instead.")
     309#                define realloc(P,S)    _Pragma("error Use of realloc is not allowed.  Use psRealloc instead.")
     310#                define calloc(S)       _Pragma("error Use of calloc is not allowed.  Use psAlloc instead.")
     311#                define free(P)         _Pragma("error Use of free is not allowed.  Use psFree instead.")
     312#            endif
     313#        endif
     314
     315#    endif
     316// doxygen skip
     317
     318#endif // end of header file
  • trunk/psLib/src/sysUtils/psString.h

    r1407 r1441  
    1111 *  @author Eric Van Alst, MHPCC
    1212 *
    13  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-07 00:06:06 $
     13 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-08-09 23:40:55 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1818
    1919#ifndef PS_STRING_H
    20 #    define PS_STRING_H
     20#define PS_STRING_H
    2121
    2222/******************************************************************************/
     
    2727
    2828/** This macro will convert the arguement to a quoted string */
    29 #    define PS_STRING(S)  #S
     29#define PS_STRING(S)  #S
    3030
    3131/******************************************************************************/
  • trunk/psLib/src/sysUtils/psTrace.c

    r1440 r1441  
    1010 *  @author George Gusciora, MHPCC
    1111 *
    12  *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-09 23:34:58 $
     12 *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-09 23:40:55 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3636#ifndef PS_NO_TRACE
    3737
    38 #    include <stdlib.h>
    39 #    include <stdio.h>
    40 #    include <string.h>
    41 #    include <stdarg.h>
    42 #    include "psMemory.h"
    43 #    include "psTrace.h"
    44 #    include "psString.h"
    45 #    include "psError.h"
     38#include <stdlib.h>
     39#include <stdio.h>
     40#include <string.h>
     41#include <stdarg.h>
     42#include "psMemory.h"
     43#include "psTrace.h"
     44#include "psString.h"
     45#include "psError.h"
    4646
    4747static p_psComponent* p_psCroot = NULL; // The root of the trace component
  • trunk/psLib/src/sysUtils/psTrace.h

    r1440 r1441  
    1010 *  @author George Gusciora, MHPCC
    1111 *
    12  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-08-09 23:34:58 $
     12 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-08-09 23:40:55 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1616 */
    1717#if !defined(PS_TRACE_H)
    18 #    define PS_TRACE_H 1
     18#define PS_TRACE_H 1
    1919
    20 #    define PS_UNKNOWN_TRACE_LEVEL -9999   // we don't know this name's level
    21 #    define PS_DEFAULT_TRACE_LEVEL 0
     20#define PS_UNKNOWN_TRACE_LEVEL -9999   // we don't know this name's level
     21#define PS_DEFAULT_TRACE_LEVEL 0
    2222
    2323/** \addtogroup LogTrace
     
    2929//#define PS_NO_TRACE 1   ///< to turn off all tracing
    3030
    31 #    if defined(PS_NO_TRACE)
    32     #        define psTrace(facil, level, ...) (void)0
    33     /* do nothing */
    34     #        define p_psTrace(facil, level, ...)  (void)0
    35     /* do nothing */
    36     #        define psTraceSetLevel(facil,level) 0
    37     #        define psTraceGetLevel(facil) 0
    38     #        define psTraceReset() (void)0     /* do nothing */
    39     #        define psTraceFree() (void)0      /* do nothing */
    40     #        define psTracePrintLevels() (void)0
    41     /* do nothing */
    42     #        define psTraceSetDestination(fp) (void)0
    43     /* do nothing */
    44     #    else
     31#if defined(PS_NO_TRACE)
     32#        define psTrace(facil, level, ...) (void)0
     33/* do nothing */
     34#        define p_psTrace(facil, level, ...)  (void)0
     35/* do nothing */
     36#        define psTraceSetLevel(facil,level) 0
     37#        define psTraceGetLevel(facil) 0
     38#        define psTraceReset() (void)0     /* do nothing */
     39#        define psTraceFree() (void)0      /* do nothing */
     40#        define psTracePrintLevels() (void)0
     41/* do nothing */
     42#        define psTraceSetDestination(fp) (void)0
     43/* do nothing */
     44#    else
    4545
    46         /** Basic structure for the component tree.  A component is a string of the
    47             form aaa.bbb.ccc, and may itself contain further subcomponents.  The
    48             Component structure doesn't in fact contain it's full name, but only the
    49             last part. */
    50         typedef struct p_psComponent
    51         {
    52             const char *name;           // last part of name of component
    53             int level;                  // trace level for this component
    54             int n;                      // number of subcomponents
    55             struct p_psComponent* *subcomp;     // next level of subcomponents
    56         }
     46    /** Basic structure for the component tree.  A component is a string of the
     47        form aaa.bbb.ccc, and may itself contain further subcomponents.  The
     48        Component structure doesn't in fact contain it's full name, but only the
     49        last part. */
     50    typedef struct p_psComponent
     51    {
     52        const char *name;           // last part of name of component
     53        int level;                  // trace level for this component
     54        int n;                      // number of subcomponents
     55        struct p_psComponent* *subcomp;     // next level of subcomponents
     56    }
    5757p_psComponent;
    5858
    59 #        ifndef DOXYGEN
     59#ifndef DOXYGEN
    6060/// Send a trace message
    6161void p_psTrace(const char *facil,       ///< facilty of interest
     
    6363               ...)             ///< trace message arguments
    6464;
    65 #        endif
     65#endif
    6666
    6767/// Set trace level
     
    8888/* \} */// End of SystemGroup Functions
    8989
    90 #        define psTrace(facil, level, ...) p_psTrace(facil, level, __VA_ARGS__)
    91 #    endif
     90#define psTrace(facil, level, ...) p_psTrace(facil, level, __VA_ARGS__)
     91#endif
    9292
    9393#endif
  • trunk/psLib/src/sysUtils/psType.h

    r1426 r1441  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2004-08-09 22:44:25 $
     13*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2004-08-09 23:40:55 $
    1515*
    1616*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1818
    1919#ifndef PS_TYPE_H
    20 #    define PS_TYPE_H
     20#define PS_TYPE_H
    2121
    22 #    include <complex.h>
    23 #    include <stdint.h>
    24 #    include <float.h>
     22#include <complex.h>
     23#include <stdint.h>
     24#include <float.h>
    2525
    2626/// @addtogroup DataContainer
     
    7272} psElemType;
    7373
    74 #    define PS_TYPE_MASK PS_TYPE_U8        ///< the psElemType to use for mask image
    75 #    define PS_TYPE_MASK_DATA U8           ///< the data member to use for mask image
    76 #    define PS_TYPE_MASK_NAME "psU8"
     74#define PS_TYPE_MASK PS_TYPE_U8        ///< the psElemType to use for mask image
     75#define PS_TYPE_MASK_DATA U8           ///< the data member to use for mask image
     76#define PS_TYPE_MASK_NAME "psU8"
    7777typedef psU8 psMaskType;        ///< the C datatype for a mask image
    7878
    79 #    define PS_MIN_S8        INT8_MIN
    80 #    define PS_MIN_S16       INT16_MIN
    81 #    define PS_MIN_S32       INT32_MIN
    82 #    define PS_MIN_S64       INT64_MIN
    83 #    define PS_MIN_U8        0
    84 #    define PS_MIN_U16       0
    85 #    define PS_MIN_U32       0
    86 #    define PS_MIN_U64       0
    87 #    define PS_MIN_F32       -FLT_MAX
    88 #    define PS_MIN_F64       -DBL_MAX
    89 #    define PS_MIN_C32       -FLT_MAX
    90 #    define PS_MIN_C64       -DBL_MAX
     79#define PS_MIN_S8        INT8_MIN
     80#define PS_MIN_S16       INT16_MIN
     81#define PS_MIN_S32       INT32_MIN
     82#define PS_MIN_S64       INT64_MIN
     83#define PS_MIN_U8        0
     84#define PS_MIN_U16       0
     85#define PS_MIN_U32       0
     86#define PS_MIN_U64       0
     87#define PS_MIN_F32       -FLT_MAX
     88#define PS_MIN_F64       -DBL_MAX
     89#define PS_MIN_C32       -FLT_MAX
     90#define PS_MIN_C64       -DBL_MAX
    9191
    92 #    define PS_MAX_S8        INT8_MAX
    93 #    define PS_MAX_S16       INT16_MAX
    94 #    define PS_MAX_S32       INT32_MAX
    95 #    define PS_MAX_S64       INT64_MAX
    96 #    define PS_MAX_U8        UINT8_MAX
    97 #    define PS_MAX_U16       UINT16_MAX
    98 #    define PS_MAX_U32       UINT32_MAX
    99 #    define PS_MAX_U64       UINT64_MAX
    100 #    define PS_MAX_F32       FLT_MAX
    101 #    define PS_MAX_F64       DBL_MAX
    102 #    define PS_MAX_C32       FLT_MAX
    103 #    define PS_MAX_C64       DBL_MAX
     92#define PS_MAX_S8        INT8_MAX
     93#define PS_MAX_S16       INT16_MAX
     94#define PS_MAX_S32       INT32_MAX
     95#define PS_MAX_S64       INT64_MAX
     96#define PS_MAX_U8        UINT8_MAX
     97#define PS_MAX_U16       UINT16_MAX
     98#define PS_MAX_U32       UINT32_MAX
     99#define PS_MAX_U64       UINT64_MAX
     100#define PS_MAX_F32       FLT_MAX
     101#define PS_MAX_F64       DBL_MAX
     102#define PS_MAX_C32       FLT_MAX
     103#define PS_MAX_C64       DBL_MAX
    104104
    105105/// Macro to get the bad pixel reason code (stored as part of mask value)
    106 #    define PS_BADPIXEL_BITMASK 0x0f
    107 #    define PS_GET_BADPIXEL(maskValue) (maskValue & PS_BADPIXEL_BITMASK)
     106#define PS_BADPIXEL_BITMASK 0x0f
     107#define PS_GET_BADPIXEL(maskValue) (maskValue & PS_BADPIXEL_BITMASK)
    108108
    109 #    define PS_IS_BADPIXEL(maskValue) (PS_GET_BADPIXEL(maskValue) != 0)
     109#define PS_IS_BADPIXEL(maskValue) (PS_GET_BADPIXEL(maskValue) != 0)
    110110
    111111/// Macro to apply a bad pixel reason code to mask image
    112 #    define PS_SET_BADPIXEL(maskValue, reasonCode) \
     112#define PS_SET_BADPIXEL(maskValue, reasonCode) \
    113113{ \
    114114    maskValue = (psMaskType)((reasonCode & PS_BADPIXEL_BITMASK) | (maskValue & ~PS_BADPIXEL_BITMASK)); \
     
    116116
    117117/// Macro to determine if the psElemType is an integer.
    118 #    define PS_IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
     118#define PS_IS_PSELEMTYPE_INT(x) ((x & 0x100) == 0x100)
    119119/// Macro to determine if the psElemType is unsigned.
    120 #    define PS_IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
     120#define PS_IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
    121121/// Macro to determine if the psElemType is a real (non-complex) floating-point type.
    122 #    define PS_IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
     122#define PS_IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
    123123/// Macro to determine if the psElemType is complex number type.
    124 #    define PS_IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
     124#define PS_IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
    125125/// Macro to determine the storage size, in bytes, of the psElemType.
    126 #    define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) :(x & 0xFF) )
     126#define PSELEMTYPE_SIZEOF(x) ( (x==PS_TYPE_PTR) ? sizeof(void*) :(x & 0xFF) )
    127127
    128128/** Dimensions of a data type.
Note: See TracChangeset for help on using the changeset viewer.