[Pcsclite-cvs-commit] r2114 - trunk/PCSC/src

Ludovic Rousseau rousseau at costa.debian.org
Mon Jul 31 13:28:51 UTC 2006


Author: rousseau
Date: 2006-07-31 13:28:50 +0000 (Mon, 31 Jul 2006)
New Revision: 2114

Modified:
   trunk/PCSC/src/configfile.l
   trunk/PCSC/src/readerfactory.c
   trunk/PCSC/src/testpcsc.c
   trunk/PCSC/src/winscard_clnt.c
Log:
do not cast malloc() return value


Modified: trunk/PCSC/src/configfile.l
===================================================================
--- trunk/PCSC/src/configfile.l	2006-07-31 09:51:57 UTC (rev 2113)
+++ trunk/PCSC/src/configfile.l	2006-07-31 13:28:50 UTC (rev 2114)
@@ -75,7 +75,7 @@
 		{
 			if (pcFriendlyname == NULL)
 			{
-				pcFriendlyname = (char *) malloc(strlen(pcCurrent) - 1);
+				pcFriendlyname = malloc(strlen(pcCurrent) - 1);
 				for (n = 0; n < strlen(pcCurrent); n++)
 				{
 					if (pcCurrent[n] != '"')

Modified: trunk/PCSC/src/readerfactory.c
===================================================================
--- trunk/PCSC/src/readerfactory.c	2006-07-31 09:51:57 UTC (rev 2113)
+++ trunk/PCSC/src/readerfactory.c	2006-07-31 13:28:50 UTC (rev 2114)
@@ -57,7 +57,7 @@
 	 */
 	for (i = 0; i < PCSCLITE_MAX_READERS_CONTEXTS; i++)
 	{
-		sReadersContexts[i] = (PREADER_CONTEXT) malloc(sizeof(READER_CONTEXT));
+		sReadersContexts[i] = malloc(sizeof(READER_CONTEXT));
 		(sReadersContexts[i])->vHandle = NULL;
 		(sReadersContexts[i])->readerState = NULL;
 	}
@@ -224,7 +224,7 @@
 	if ((sReadersContexts[dwContext])->mMutex == 0)
 	{
 		(sReadersContexts[dwContext])->mMutex =
-		  (PCSCLITE_MUTEX_T) malloc(sizeof(PCSCLITE_MUTEX));
+			malloc(sizeof(PCSCLITE_MUTEX));
 		SYS_MutexInit((sReadersContexts[dwContext])->mMutex);
 	}
 
@@ -402,7 +402,7 @@
 		if (rv == IFD_SUCCESS && dwGetSize == 1 && ucThread[0] == 1)
 		{
 			(sReadersContexts[dwContextB])->mMutex =
-				(PCSCLITE_MUTEX_T) malloc(sizeof(PCSCLITE_MUTEX));
+				malloc(sizeof(PCSCLITE_MUTEX));
 			SYS_MutexInit((sReadersContexts[dwContextB])->mMutex);
 
 			(sReadersContexts[dwContextB])->pdwMutex = malloc(sizeof(DWORD));

Modified: trunk/PCSC/src/testpcsc.c
===================================================================
--- trunk/PCSC/src/testpcsc.c	2006-07-31 09:51:57 UTC (rev 2113)
+++ trunk/PCSC/src/testpcsc.c	2006-07-31 13:28:50 UTC (rev 2114)
@@ -83,7 +83,7 @@
 		return -1;
 	}
 
-	mszGroups = (char *) malloc(sizeof(char) * dwGroups);
+	mszGroups = malloc(sizeof(char) * dwGroups);
 	rv = SCardListReaderGroups(hContext, mszGroups, &dwGroups);
 
 	if (rv != SCARD_S_SUCCESS)
@@ -117,7 +117,7 @@
 		return -1;
 	}
 
-	mszReaders = (char *) malloc(sizeof(char) * dwReaders);
+	mszReaders = malloc(sizeof(char) * dwReaders);
 	rv = SCardListReaders(hContext, mszGroups, mszReaders, &dwReaders);
 
 	if (rv != SCARD_S_SUCCESS)
@@ -260,7 +260,7 @@
 	printf("Testing SCardStatus              : ");
 
 	dwReaderLen = 50;
-	pcReaders   = (char *) malloc(sizeof(char) * 50);
+	pcReaders   = malloc(sizeof(char) * 50);
 	dwAtrLen    = MAX_ATR_SIZE;
 
 	rv = SCardStatus(hCard, pcReaders, &dwReaderLen, &dwState, &dwProt,

Modified: trunk/PCSC/src/winscard_clnt.c
===================================================================
--- trunk/PCSC/src/winscard_clnt.c	2006-07-31 09:51:57 UTC (rev 2113)
+++ trunk/PCSC/src/winscard_clnt.c	2006-07-31 13:28:50 UTC (rev 2114)
@@ -3013,7 +3013,7 @@
 			psContextMap[i].hContext = hContext;
 			psContextMap[i].dwClientID = dwClientID;
 			psContextMap[i].contextBlockStatus = BLOCK_STATUS_RESUME;
-			psContextMap[i].mMutex = (PCSCLITE_MUTEX_T) malloc(sizeof(PCSCLITE_MUTEX));
+			psContextMap[i].mMutex = malloc(sizeof(PCSCLITE_MUTEX));
 			SYS_MutexInit(psContextMap[i].mMutex);
 			return SCARD_S_SUCCESS;
 		}




More information about the Pcsclite-cvs-commit mailing list