CR Problem - Continued

Ed Crenshaw <[email protected]>
Newsgroups gmane.comp.gnu.indent.bugs
Organization Panasonic
Message-ID <[email protected]>
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

_______________________________________________
bug-indent mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-indent
zp_debug.c (text/x-csrc, 1.1 KB)
#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
}
output.txt (text/plain, 1.2 KB)
#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
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.