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

Ludovic Rousseau rousseau at costa.debian.org
Mon Nov 21 13:05:21 UTC 2005


Author: rousseau
Date: 2005-11-21 13:05:20 +0000 (Mon, 21 Nov 2005)
New Revision: 1722

Modified:
   trunk/PCSC/src/readerfactory.c
   trunk/PCSC/src/winscard.c
   trunk/PCSC/src/winscard_clnt.c
   trunk/PCSC/src/winscard_scf.c
Log:
use NULL instead of 0 for pointers


Modified: trunk/PCSC/src/readerfactory.c
===================================================================
--- trunk/PCSC/src/readerfactory.c	2005-11-21 12:52:49 UTC (rev 1721)
+++ trunk/PCSC/src/readerfactory.c	2005-11-21 13:05:20 UTC (rev 1722)
@@ -167,8 +167,8 @@
 	(sReadersContexts[dwContext])->pthThread = 0;
 	(sReadersContexts[dwContext])->dwLockId = 0;
 	(sReadersContexts[dwContext])->vHandle = 0;
-	(sReadersContexts[dwContext])->pdwFeeds = 0;
-	(sReadersContexts[dwContext])->pdwMutex = 0;
+	(sReadersContexts[dwContext])->pdwFeeds = NULL;
+	(sReadersContexts[dwContext])->pdwMutex = NULL;
 	(sReadersContexts[dwContext])->dwIdentity =
 		(dwContext + 1) << (sizeof(DWORD) / 2) * 8;
 	(sReadersContexts[dwContext])->readerState = NULL;
@@ -202,13 +202,13 @@
 		{
 			Log1(PCSC_LOG_INFO, "Driver is thread safe");
 			(sReadersContexts[dwContext])->mMutex = 0;
-			(sReadersContexts[dwContext])->pdwMutex = 0;
+			(sReadersContexts[dwContext])->pdwMutex = NULL;
 		}
 		else
 			*(sReadersContexts[dwContext])->pdwMutex += 1;
 	}
 
-	if ((sReadersContexts[dwContext])->pdwFeeds == 0)
+	if ((sReadersContexts[dwContext])->pdwFeeds == NULL)
 	{
 		(sReadersContexts[dwContext])->pdwFeeds = 
 		  (DWORD *)malloc(sizeof(DWORD));
@@ -228,7 +228,7 @@
 		SYS_MutexInit((sReadersContexts[dwContext])->mMutex);
 	}
 
-	if ((sReadersContexts[dwContext])->pdwMutex == 0)
+	if ((sReadersContexts[dwContext])->pdwMutex == NULL)
 	{
 		(sReadersContexts[dwContext])->pdwMutex = 
 		  (DWORD *)malloc(sizeof(DWORD));
@@ -269,7 +269,7 @@
 		if (*(sReadersContexts[dwContext])->pdwMutex == 0)
 		{
 			free((sReadersContexts[dwContext])->pdwMutex);
-			(sReadersContexts[dwContext])->pdwMutex = 0;
+			(sReadersContexts[dwContext])->pdwMutex = NULL;
 		}
 
 		*(sReadersContexts[dwContext])->pdwFeeds -= 1;
@@ -277,7 +277,7 @@
 		if (*(sReadersContexts[dwContext])->pdwFeeds == 0)
 		{
 			free((sReadersContexts[dwContext])->pdwFeeds);
-			(sReadersContexts[dwContext])->pdwFeeds = 0;
+			(sReadersContexts[dwContext])->pdwFeeds = NULL;
 		}
 
 		dwNumReadersContexts -= 1;
@@ -446,7 +446,7 @@
 			if (*(sReadersContexts[dwContextB])->pdwMutex == 0)
 			{
 				free((sReadersContexts[dwContextB])->pdwMutex);
-				(sReadersContexts[dwContextB])->pdwMutex = 0;
+				(sReadersContexts[dwContextB])->pdwMutex = NULL;
 			}
 
 			*(sReadersContexts[dwContextB])->pdwFeeds -= 1;
@@ -454,7 +454,7 @@
 			if (*(sReadersContexts[dwContextB])->pdwFeeds == 0)
 			{
 				free((sReadersContexts[dwContextB])->pdwFeeds);
-				(sReadersContexts[dwContextB])->pdwFeeds = 0;
+				(sReadersContexts[dwContextB])->pdwFeeds = NULL;
 			}
 
 			dwNumReadersContexts -= 1;

Modified: trunk/PCSC/src/winscard.c
===================================================================
--- trunk/PCSC/src/winscard.c	2005-11-21 12:52:49 UTC (rev 1721)
+++ trunk/PCSC/src/winscard.c	2005-11-21 13:05:20 UTC (rev 1722)
@@ -194,7 +194,7 @@
 	/*
 	 * Check for NULL parameters
 	 */
-	if (szReader == 0 || phCard == 0 || pdwActiveProtocol == 0)
+	if (szReader == NULL || phCard == NULL || pdwActiveProtocol == NULL)
 		return SCARD_E_INVALID_PARAMETER;
 	else
 		*phCard = 0;
@@ -417,7 +417,7 @@
 			!(dwPreferredProtocols & SCARD_PROTOCOL_ANY_OLD))
 		return SCARD_E_PROTO_MISMATCH;
 
-	if (pdwActiveProtocol == 0)
+	if (pdwActiveProtocol == NULL)
 		return SCARD_E_INVALID_PARAMETER;
 
 	rv = RFReaderInfoById(hCard, &rContext);

Modified: trunk/PCSC/src/winscard_clnt.c
===================================================================
--- trunk/PCSC/src/winscard_clnt.c	2005-11-21 12:52:49 UTC (rev 1721)
+++ trunk/PCSC/src/winscard_clnt.c	2005-11-21 13:05:20 UTC (rev 1722)
@@ -569,12 +569,12 @@
 	/*
 	 * Check for NULL parameters
 	 */
-	if (phCard == 0 || pdwActiveProtocol == 0)
+	if (phCard == NULL || pdwActiveProtocol == NULL)
 		return SCARD_E_INVALID_PARAMETER;
 	else
 		*phCard = 0;
 
-	if (szReader == 0)
+	if (szReader == NULL)
 		return SCARD_E_UNKNOWN_READER;
 
 	/*
@@ -742,7 +742,7 @@
 		return SCARD_E_INVALID_VALUE;
 	}
 
-	if (pdwActiveProtocol == 0)
+	if (pdwActiveProtocol == NULL)
 		return SCARD_E_INVALID_PARAMETER;
 
 	if (SCardCheckDaemonAvailability() != SCARD_S_SUCCESS)
@@ -1524,7 +1524,7 @@
 	DWORD dwContextIndex;
 	int currentReaderCount = 0;
 
-	if (rgReaderStates == 0 && cReaders > 0)
+	if (rgReaderStates == NULL && cReaders > 0)
 		return SCARD_E_INVALID_PARAMETER;
 
 	if (cReaders < 0)
@@ -1610,7 +1610,7 @@
 	{
 		currReader = &rgReaderStates[j];
 
-		if (currReader->szReader == 0)
+		if (currReader->szReader == NULL)
 		{
 			SYS_MutexUnLock(psContextMap[dwContextIndex].mMutex);	
 			return SCARD_E_INVALID_VALUE;
@@ -2442,8 +2442,8 @@
 	int i;
 	DWORD dwContextIndex, dwChannelIndex;
 
-	if (pbSendBuffer == 0 || pbRecvBuffer == 0 ||
-			pcbRecvLength == 0 || pioSendPci == 0)
+	if (pbSendBuffer == NULL || pbRecvBuffer == NULL ||
+			pcbRecvLength == NULL || pioSendPci == NULL)
 		return SCARD_E_INVALID_PARAMETER;
 
 	if (SCardCheckDaemonAvailability() != SCARD_S_SUCCESS)

Modified: trunk/PCSC/src/winscard_scf.c
===================================================================
--- trunk/PCSC/src/winscard_scf.c	2005-11-21 12:52:49 UTC (rev 1721)
+++ trunk/PCSC/src/winscard_scf.c	2005-11-21 13:05:20 UTC (rev 1722)
@@ -211,7 +211,7 @@
 		return SCARD_E_NO_SERVICE;
 
 /* Check for NULL parameters */
-	if (pcchReaders == 0)
+	if (pcchReaders == NULL)
 	{
 		return SCARD_E_INVALID_PARAMETER;
 	}
@@ -236,7 +236,7 @@
 	if (1 >= dwReadersLen)
 		return SCARD_E_READER_UNAVAILABLE;
 
-	if (mszReaders == 0)
+	if (mszReaders == NULL)
 	{
 		*pcchReaders = dwReadersLen;
 		return SCARD_S_SUCCESS;
@@ -298,7 +298,7 @@
 	rv = 0;
 
 	/* Check for NULL parameters */
-	if (phCard == 0 || pdwActiveProtocol == 0)
+	if (phCard == NULL || pdwActiveProtocol == NULL)
 		return SCARD_E_INVALID_PARAMETER;
 	else
 		*phCard = 0;
@@ -307,7 +307,7 @@
 	if (SCardGetContextIndice(hContext) == -1)
 		return SCARD_E_INVALID_HANDLE;
 
-	if (szReader == 0)
+	if (szReader == NULL)
 		return SCARD_E_UNKNOWN_READER;
 
 	/* Check for uninitialized strings */
@@ -412,7 +412,7 @@
 	int retIndice = 0;
 	if (SCARD_S_SUCCESS != isOCFServerRunning())
 		return SCARD_E_NO_SERVICE;
-	if (pdwActiveProtocol == 0)
+	if (pdwActiveProtocol == NULL)
 		return SCARD_E_INVALID_PARAMETER;
 
 	if (dwInitialization != SCARD_LEAVE_CARD &&
@@ -601,8 +601,8 @@
 	i = 0;
 	/* Check for NULL parameters */
 
-	if (pcchReaderLen == 0 || pdwState == 0 ||
-		pdwProtocol == 0 || pcbAtrLen == 0)
+	if (pcchReaderLen == NULL || pdwState == NULL ||
+		pdwProtocol == NULL || pcbAtrLen == NULL)
 	{
 		return SCARD_E_INVALID_PARAMETER;
 	}
@@ -616,7 +616,7 @@
 	dwReaderLen =
 		strlen(psReaderMap[psChannelMap[retIndice].ReaderIndice].ReaderName);
 
-	if (mszReaderNames == 0)
+	if (mszReaderNames == NULL)
 	{
 		*pcchReaderLen = dwReaderLen;
 		*pcbAtrLen = 0;
@@ -714,7 +714,7 @@
 	readerIndice = 0;
 	dwBreakFlag = 0;
 
-	if (rgReaderStates == 0 && cReaders > 0)
+	if (rgReaderStates == NULL && cReaders > 0)
 		return SCARD_E_INVALID_PARAMETER;
 
 	if (cReaders < 0)
@@ -748,7 +748,7 @@
 	for (j = 0; j < cReaders; j++)
 	{
 		currReader = &rgReaderStates[j];
-		if (currReader->szReader == 0)
+		if (currReader->szReader == NULL)
 		{
 			return SCARD_E_INVALID_VALUE;
 		}
@@ -1030,8 +1030,8 @@
 	LONG localRecvLen = MAX_BUFFER_SIZE;
 	if (SCARD_S_SUCCESS != isOCFServerRunning())
 		return SCARD_E_NO_SERVICE;
-	if (pbSendBuffer == 0 || pbRecvBuffer == 0 ||
-		pcbRecvLength == 0 || pioSendPci == 0)
+	if (pbSendBuffer == NULL || pbRecvBuffer == NULL ||
+		pcbRecvLength == NULL || pioSendPci == NULL)
 	{
 		return SCARD_E_INVALID_PARAMETER;
 	}




More information about the Pcsclite-cvs-commit mailing list