[Pcsclite-cvs-commit] PCSC/src debuglog.c,1.22,1.23 debuglog.h,1.11,1.12 dyn_macosx.c,1.6,1.7 eventhandler.c,1.15,1.16 hotplug_libusb.c,1.24,1.25 hotplug_linux.c,1.25,1.26 hotplug_macosx.c,1.19,1.20 muscletest.c,1.11,1.12 powermgt_macosx.c,1.13,1.14 testpcsc.c,1.13,1.14 thread_generic.h,1.10,1.11 thread_unix.c,1.10,1.11 winscard_msg.c,1.21,1.22 winscard_svc.c,1.23,1.24
rousseau@haydn.debian.org
rousseau@haydn.debian.org
Update of /cvsroot/pcsclite/PCSC/src
In directory haydn:/tmp/cvs-serv10545/src
Modified Files:
debuglog.c debuglog.h dyn_macosx.c eventhandler.c
hotplug_libusb.c hotplug_linux.c hotplug_macosx.c muscletest.c
powermgt_macosx.c testpcsc.c thread_generic.h thread_unix.c
winscard_msg.c winscard_svc.c
Log Message:
recompile using -pedantic and correct lots of cast "problems"
Index: debuglog.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/debuglog.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- debuglog.c 10 May 2004 13:14:30 -0000 1.22
+++ debuglog.c 25 May 2004 12:44:30 -0000 1.23
@@ -168,7 +168,8 @@
return debug_category;
}
-void DebugLogCategory(const int category, const char *buffer, const int len)
+void DebugLogCategory(const int category, const unsigned char *buffer,
+ const int len)
{
if ((category & DEBUG_CATEGORY_APDU)
&& (debug_category & DEBUG_CATEGORY_APDU))
Index: debuglog.h
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/debuglog.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- debuglog.h 21 Apr 2004 21:40:19 -0000 1.11
+++ debuglog.h 25 May 2004 12:44:30 -0000 1.12
@@ -3,7 +3,7 @@
*
* MUSCLE SmartCard Development ( http://www.linuxnet.com )
*
- * Copyright (C) 1999-2002
+ * Copyright (C) 1999-2004
* David Corcoran <corcoran@linuxnet.com>
* Ludovic Rousseau <ludovic.rousseau@free.fr>
*
@@ -45,7 +45,7 @@
DEBUGLOG_NO_DEBUG = 0,
DEBUGLOG_SYSLOG_DEBUG,
DEBUGLOG_STDERR_DEBUG,
- DEBUGLOG_STDOUT_DEBUG,
+ DEBUGLOG_STDOUT_DEBUG
} DebugLogType;
#define DEBUG_CATEGORY_NOTHING 0
@@ -75,7 +75,7 @@
void DebugLogSuppress(const int);
void DebugLogSetLogType(const int);
int DebugLogSetCategory(const int);
-void DebugLogCategory(const int, const char *, const int);
+void DebugLogCategory(const int, const unsigned char *, const int);
char *pcsc_stringify_error(long);
Index: dyn_macosx.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/dyn_macosx.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dyn_macosx.c 21 Apr 2004 21:42:33 -0000 1.6
+++ dyn_macosx.c 25 May 2004 12:44:30 -0000 1.7
@@ -10,15 +10,16 @@
*/
#include "config.h"
-#ifdef __APPLE__
-#include <CoreFoundation/CFBundle.h>
-#include <CoreFoundation/CFString.h>
-#include <CoreFoundation/CFURL.h>
#include "wintypes.h"
#include "pcsclite.h"
#include "dyn_generic.h"
#include "debuglog.h"
+
+#ifdef __APPLE__
+#include <CoreFoundation/CFBundle.h>
+#include <CoreFoundation/CFString.h>
+#include <CoreFoundation/CFURL.h>
/*
* / Load a module (if needed)
Index: eventhandler.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/eventhandler.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- eventhandler.c 21 Apr 2004 21:42:33 -0000 1.15
+++ eventhandler.c 25 May 2004 12:44:30 -0000 1.16
@@ -204,7 +204,7 @@
rContext->dwPublicID = i;
rv = SYS_ThreadCreate(&rContext->pthThread, NULL,
- (LPVOID) EHStatusHandlerThread, (LPVOID) rContext);
+ (PCSCLITE_THREAD_FUNCTION())EHStatusHandlerThread, (LPVOID) rContext);
if (rv == 1)
return SCARD_S_SUCCESS;
else
Index: hotplug_libusb.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/hotplug_libusb.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- hotplug_libusb.c 1 Apr 2004 09:14:05 -0000 1.24
+++ hotplug_libusb.c 25 May 2004 12:44:30 -0000 1.25
@@ -327,7 +327,7 @@
HPReadBundleValues();
SYS_ThreadCreate(&usbNotifyThread, NULL,
- (LPVOID) HPEstablishUSBNotifications, 0);
+ (PCSCLITE_THREAD_FUNCTION()) HPEstablishUSBNotifications, 0);
return 0;
}
Index: hotplug_linux.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/hotplug_linux.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- hotplug_linux.c 20 Mar 2004 17:53:22 -0000 1.25
+++ hotplug_linux.c 25 May 2004 12:44:30 -0000 1.26
@@ -14,8 +14,9 @@
*/
#include "config.h"
-#if defined(__linux__) && !defined(HAVE_LIBUSB)
#include <string.h>
+
+#if defined(__linux__) && !defined(HAVE_LIBUSB)
#include <sys/types.h>
#include <stdio.h>
#include <dirent.h>
Index: hotplug_macosx.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/hotplug_macosx.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- hotplug_macosx.c 6 May 2004 08:17:46 -0000 1.19
+++ hotplug_macosx.c 25 May 2004 12:44:30 -0000 1.20
@@ -12,6 +12,8 @@
*/
#include "config.h"
+#include "wintypes.h"
+
#ifdef __APPLE__
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOCFPlugIn.h>
@@ -20,7 +22,6 @@
#include <stdlib.h>
#include <string.h>
-#include "wintypes.h"
#include "pcsclite.h"
#include "readerfactory.h"
#include "winscard_msg.h"
Index: muscletest.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/muscletest.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- muscletest.c 10 May 2004 13:14:30 -0000 1.11
+++ muscletest.c 25 May 2004 12:44:30 -0000 1.12
@@ -153,11 +153,12 @@
printf("Currently logged identities : %04X\n", statusInf.loggedID);
printf("Please enter the PIN value: ");
- fgets(defaultPIN, sizeof(defaultPIN), stdin);
+ fgets((char *)defaultPIN, sizeof(defaultPIN), stdin);
if (defaultPIN[0] == '\n')
- strcpy(defaultPIN, "Muscle00\n");
+ strcpy((char *)defaultPIN, "Muscle00\n");
- rv = MSCVerifyPIN(&pConnection, 0, defaultPIN, strlen(defaultPIN) - 1);
+ rv = MSCVerifyPIN(&pConnection, 0, defaultPIN,
+ strlen((char *)defaultPIN) - 1);
printf("Verify default PIN : %s\n", msc_error(rv));
rv = MSCGetStatus(&pConnection, &statusInf);
@@ -180,7 +181,7 @@
if (rv == MSC_SUCCESS)
{
printf("Object data : %s\n", readData);
- if (strcmp(readData, myData) == 0)
+ if (strcmp((char *)readData, (char*)myData) == 0)
printf("Data comparison : Successful\n");
else
printf("Data comparison : Data mismatch\n");
Index: powermgt_macosx.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/powermgt_macosx.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- powermgt_macosx.c 21 Apr 2004 21:42:33 -0000 1.13
+++ powermgt_macosx.c 25 May 2004 12:44:30 -0000 1.14
@@ -21,8 +21,9 @@
*/
#include "config.h"
-#ifdef __APPLE__
#include <ctype.h>
+
+#ifdef __APPLE__
#include <stdlib.h>
#include <stdio.h>
Index: testpcsc.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/testpcsc.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- testpcsc.c 19 Apr 2004 16:26:02 -0000 1.13
+++ testpcsc.c 25 May 2004 12:44:30 -0000 1.14
@@ -195,7 +195,7 @@
}
printf("Testing SCardSetAttrib : ");
- rv = SCardSetAttrib(hCard, SCARD_ATTR_ATR_STRING, "", 1);
+ rv = SCardSetAttrib(hCard, SCARD_ATTR_ATR_STRING, (LPCBYTE)"", 1);
printf("%s\n", pcsc_stringify_error(rv));
printf("Testing SCardStatus : ");
Index: thread_generic.h
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/thread_generic.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- thread_generic.h 16 Jan 2004 11:33:17 -0000 1.10
+++ thread_generic.h 25 May 2004 12:44:30 -0000 1.11
@@ -6,6 +6,7 @@
* Copyright (C) 2000-2004
* David Corcoran <corcoran@linuxnet.com>
* Damien Sauveron <damien.sauveron@labri.fr>
+ * Ludovic Rousseau <ludovic.rousseau@free.fr>
*
* $Id$
*/
@@ -30,17 +31,19 @@
#define PCSCLITE_THREAD_T HANDLE
#define PCSCLITE_MUTEX CRITICAL_SECTION
#define PCSCLITE_MUTEX_T CRITICAL_SECTION*
+#define PCSCLITE_THREAD_FUNCTION(f) void *(*f)(void *)
#else
#define PCSCLITE_THREAD_T pthread_t
#define PCSCLITE_MUTEX pthread_mutex_t
#define PCSCLITE_MUTEX_T pthread_mutex_t*
+#define PCSCLITE_THREAD_FUNCTION(f) void *(*f)(void *)
#endif
int SYS_MutexInit(PCSCLITE_MUTEX_T);
int SYS_MutexDestroy(PCSCLITE_MUTEX_T);
int SYS_MutexLock(PCSCLITE_MUTEX_T);
int SYS_MutexUnLock(PCSCLITE_MUTEX_T);
- int SYS_ThreadCreate(PCSCLITE_THREAD_T *, LPVOID, LPVOID, LPVOID);
+ int SYS_ThreadCreate(PCSCLITE_THREAD_T *, LPVOID, PCSCLITE_THREAD_FUNCTION(), LPVOID);
int SYS_ThreadCancel(PCSCLITE_THREAD_T *);
int SYS_ThreadDetach(PCSCLITE_THREAD_T);
int SYS_ThreadJoin(PCSCLITE_THREAD_T *, LPVOID*);
Index: thread_unix.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/thread_unix.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- thread_unix.c 21 Jan 2004 06:46:40 -0000 1.10
+++ thread_unix.c 25 May 2004 12:44:30 -0000 1.11
@@ -46,7 +46,7 @@
}
int SYS_ThreadCreate(PCSCLITE_THREAD_T * pthThread, LPVOID pthAttr,
- LPVOID pvFunction, LPVOID pvArg)
+ PCSCLITE_THREAD_FUNCTION(pvFunction), LPVOID pvArg)
{
int retval;
Index: winscard_msg.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/winscard_msg.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- winscard_msg.c 6 May 2004 06:36:46 -0000 1.21
+++ winscard_msg.c 25 May 2004 12:44:30 -0000 1.22
@@ -128,7 +128,7 @@
int SHMProcessCommonChannelRequest(PDWORD pdwClientID)
{
- int clnt_len;
+ socklen_t clnt_len;
int new_sock;
struct sockaddr_un clnt_addr;
int one;
Index: winscard_svc.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/winscard_svc.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- winscard_svc.c 6 May 2004 06:36:13 -0000 1.23
+++ winscard_svc.c 25 May 2004 12:44:30 -0000 1.24
@@ -78,7 +78,8 @@
dwNextContextIndex = i;
if (SYS_ThreadCreate(&psContext[i].pthThread, NULL,
- (LPVOID) ContextThread, (LPVOID) &dwNextContextIndex) != 1)
+ (PCSCLITE_THREAD_FUNCTION()) ContextThread,
+ (LPVOID) &dwNextContextIndex) != 1)
{
SYS_CloseFile(psContext[i].dwClientID);
psContext[i].dwClientID = 0;