[SmartcardServices-Changes] [33] trunk/SmartCardServices/src/PCSC/debug.c
source_changes at macosforge.org
source_changes at macosforge.org
Thu Jul 30 02:07:06 PDT 2009
Revision: 33
http://trac.macosforge.org/projects/smartcardservices/changeset/33
Author: ludovic.rousseau at gmail.com
Date: 2009-07-30 02:07:04 -0700 (Thu, 30 Jul 2009)
Log Message:
-----------
reformat and remove WIN32 support
Modified Paths:
--------------
trunk/SmartCardServices/src/PCSC/debug.c
Modified: trunk/SmartCardServices/src/PCSC/debug.c
===================================================================
--- trunk/SmartCardServices/src/PCSC/debug.c 2009-07-30 09:00:46 UTC (rev 32)
+++ trunk/SmartCardServices/src/PCSC/debug.c 2009-07-30 09:07:04 UTC (rev 33)
@@ -3,7 +3,7 @@
*
* Copyright (C) 1999-2002
* David Corcoran <corcoran at linuxnet.com>
- * Copyright (C) 1999-2005
+ * Copyright (C) 1999-2008
* Ludovic Rousseau <ludovic.rousseau at free.fr>
*
* $Id: debuglog.c 1953 2006-03-21 13:46:28Z rousseau $
@@ -28,10 +28,9 @@
/* default level is a bit verbose to be backward compatible */
static char LogLevel = PCSC_LOG_ERROR;
-static signed char LogDoColor = 0; /* no color by default */
-void log_init(void);
+static signed char LogDoColor = 0; /**< no color by default */
-void log_init(void)
+static void log_init(void)
{
char *e;
@@ -43,8 +42,6 @@
if (e)
LogLevel = atoi(e);
- /* no color under Windows */
-#ifndef WIN32
/* log to stderr and stderr is a tty? */
if (isatty(fileno(stderr)))
{
@@ -68,7 +65,6 @@
}
}
}
-#endif
} /* log_init */
void log_msg(const int priority, const char *fmt, ...)
@@ -87,18 +83,9 @@
return;
va_start(argptr, fmt);
-#ifndef WIN32
- vsnprintf(DebugBuffer, DEBUG_BUF_SIZE, fmt, argptr);
-#else
-#if HAVE_VSNPRINTF
- vsnprintf(DebugBuffer, DEBUG_BUF_SIZE, fmt, argptr);
-#else
- vsprintf(DebugBuffer, fmt, argptr);
-#endif
-#endif
+ (void)vsnprintf(DebugBuffer, DEBUG_BUF_SIZE, fmt, argptr);
va_end(argptr);
-#ifndef WIN32
{
if (LogDoColor)
{
@@ -128,9 +115,6 @@
else
fprintf(stderr, "%s\n", DebugBuffer);
}
-#else
- fprintf(stderr, "%s\n", DebugBuffer);
-#endif
} /* log_msg */
void log_xxd(const int priority, const char *msg, const unsigned char *buffer,
@@ -146,7 +130,7 @@
debug_buf_end = DebugBuffer + DEBUG_BUF_SIZE - 5;
- strlcpy(DebugBuffer, msg, sizeof(DebugBuffer));
+ (void)strlcpy(DebugBuffer, msg, sizeof(DebugBuffer));
c = DebugBuffer + strlen(DebugBuffer);
for (i = 0; (i < len) && (c < debug_buf_end); ++i)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/smartcardservices-changes/attachments/20090730/b4941797/attachment.html>
More information about the SmartcardServices-Changes
mailing list