CR Problem - Continued

View: New views
1 Messages — Rating Filter:   Alert me  

CR Problem - Continued

by Ed Crenshaw-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I realized I didn't give much info.

I invoked indent as: indent zp_debug.c -o output.txt
My OS is Slackware Linux 11.0 running on Intel.

Files are attached.

Regards,

Ed
--
Panasonic Engineering Promotion Center of America
5000 Dearborn Circle, Suite 100
Mount Laurel, New Jersey 08054
Phone: 856-222-2290 Extension: 149
Fax:     856-787-0918

[zp_debug.c]

#include <stdio.h>
#include <stdarg.h>
#include <string.h>

#include "../include/zp_debug.h"

static FILE *zp_debugout = NULL;
static int zp_debugconfig[NUM_ZP_MODULES];
static int zp_debug_initialized = 0;

static void ZPDebug_default_config(void){
    int i;

    zp_debugout = stdout;
    for (i = 0; i < NUM_ZP_MODULES; i++) {
                zp_debugconfig[i] = ZP_DEBUG_DEFAULT_LEVEL;
    }
}

void ZPDebug_init(){
#ifndef ZAPPER_RELEASE
        if (zp_debug_initialized){
                return;
        }
   
    ZPDebug_default_config();
    zp_debug_initialized = 1;
#endif //ZAPPER_RELEASE
}

void ZPDebug_set_level(ZPModules mod, int level) {
#ifndef ZAPPER_RELEASE
        if (mod < NUM_ZP_MODULES){
        zp_debugconfig[mod] = level;
        }
#endif //ZAPPER_RELEASE
}

inline void ZPDebug(ZPModules mod, int level, const char* fmt, ...)
{
#ifndef ZAPPER_RELEASE
    va_list args;
   
        if (! zp_debug_initialized){
                return;
        }
        if (mod >= NUM_ZP_MODULES){
                return;
        }

    if (level <= zp_debugconfig[mod]) {
        va_start(args, fmt);
        fprintf(zp_debugout,"%s:", ZP_MODULE_NAMES[mod].name);
        vfprintf(zp_debugout, fmt, args);
        va_end(args);
    }
#endif //ZAPPER_RELEASE
}



#include <stdio.h>
#include <stdarg.h>
#include <string.h>

#include "../include/zp_debug.h"
static FILE *zp_debugout = NULL;
static int zp_debugconfig[NUM_ZP_MODULES];
static int zp_debug_initialized = 0;
static void
ZPDebug_default_config (void)
{
  int i;
  zp_debugout = stdout;
  for (i = 0; i < NUM_ZP_MODULES; i++)
    {
      zp_debugconfig[i] = ZP_DEBUG_DEFAULT_LEVEL;
    }
}
void
ZPDebug_init ()
{
 
#ifndef ZAPPER_RELEASE
    if (zp_debug_initialized)
    {
      return;
    }
  ZPDebug_default_config ();
  zp_debug_initialized = 1;
 
#endif //ZAPPER_RELEASE
}
void
ZPDebug_set_level (ZPModules mod, int level)
{
 
#ifndef ZAPPER_RELEASE
    if (mod < NUM_ZP_MODULES)
    {
      zp_debugconfig[mod] = level;
    }
 
#endif //ZAPPER_RELEASE
}
inline void
ZPDebug (ZPModules mod, int level, const char *fmt, ...)
{
 
#ifndef ZAPPER_RELEASE
    va_list args;
  if (!zp_debug_initialized)
    {
      return;
    }
  if (mod >= NUM_ZP_MODULES)
    {
      return;
    }
  if (level <= zp_debugconfig[mod])
    {
      va_start (args, fmt);
      fprintf (zp_debugout, "%s:", ZP_MODULE_NAMES[mod].name);
      vfprintf (zp_debugout, fmt, args);
      va_end (args);
    }
 
#endif //ZAPPER_RELEASE
}



_______________________________________________
bug-indent mailing list
bug-indent@...
http://lists.gnu.org/mailman/listinfo/bug-indent