mirror of
https://github.com/pcsc-for-php/pcsc.git
synced 2026-08-16 16:31:30 +02:00
fix build warnings ([-Wunused-variable] and [-Wformat=])
This commit is contained in:
parent
7a3b2be482
commit
054ec3d5a3
1 changed files with 6 additions and 9 deletions
15
pcsc.c
15
pcsc.c
|
|
@ -1,8 +1,6 @@
|
||||||
/*
|
/*
|
||||||
+----------------------------------------------------------------------+
|
+----------------------------------------------------------------------+
|
||||||
| PHP Version 5 |
|
| Copyright (c) The PHP Group |
|
||||||
+----------------------------------------------------------------------+
|
|
||||||
| Copyright (c) 1997-2006 The PHP Group |
|
|
||||||
+----------------------------------------------------------------------+
|
+----------------------------------------------------------------------+
|
||||||
| This source file is subject to version 3.01 of the PHP license, |
|
| This source file is subject to version 3.01 of the PHP license, |
|
||||||
| that is bundled with this package in the file LICENSE, and is |
|
| that is bundled with this package in the file LICENSE, and is |
|
||||||
|
|
@ -102,13 +100,13 @@ static void php_pcsc_ctx_res_dtor(zend_resource *rsrc) {
|
||||||
context=(SCARDCONTEXT)rsrc->ptr;
|
context=(SCARDCONTEXT)rsrc->ptr;
|
||||||
rc = SCardIsValidContext(context);
|
rc = SCardIsValidContext(context);
|
||||||
if (rc != SCARD_S_SUCCESS) {
|
if (rc != SCARD_S_SUCCESS) {
|
||||||
php_error_docref(NULL, E_WARNING, "PC/SC context dtor: SCardIsValidContext returned %s (0x%x)", php_pcsc_error_to_string(rc), rc);
|
php_error_docref(NULL, E_WARNING, "PC/SC context dtor: SCardIsValidContext returned %s (0x%lx)", php_pcsc_error_to_string(rc), rc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = SCardReleaseContext(context);
|
rc = SCardReleaseContext(context);
|
||||||
if (rc != SCARD_S_SUCCESS) {
|
if (rc != SCARD_S_SUCCESS) {
|
||||||
php_error_docref(NULL, E_WARNING, "PC/SC context dtor: SCardReleaseContext returned %s (0x%x)", php_pcsc_error_to_string(rc), rc);
|
php_error_docref(NULL, E_WARNING, "PC/SC context dtor: SCardReleaseContext returned %s (0x%lx)", php_pcsc_error_to_string(rc), rc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
@ -127,7 +125,7 @@ static void php_pcsc_conn_res_dtor(zend_resource *rsrc) {
|
||||||
|
|
||||||
rc = SCardDisconnect(hCard, SCARD_LEAVE_CARD);
|
rc = SCardDisconnect(hCard, SCARD_LEAVE_CARD);
|
||||||
if (rc != SCARD_S_SUCCESS) {
|
if (rc != SCARD_S_SUCCESS) {
|
||||||
php_error_docref(NULL, E_WARNING, "PC/SC connection dtor: SCardDisconnect returned %s (0x%x)", php_pcsc_error_to_string(rc), rc);
|
php_error_docref(NULL, E_WARNING, "PC/SC connection dtor: SCardDisconnect returned %s (0x%lx)", php_pcsc_error_to_string(rc), rc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -539,7 +537,6 @@ PHP_FUNCTION(scard_is_valid_context)
|
||||||
Invalidate the PC/SC context */
|
Invalidate the PC/SC context */
|
||||||
PHP_FUNCTION(scard_release_context)
|
PHP_FUNCTION(scard_release_context)
|
||||||
{
|
{
|
||||||
LONG rc = 0;
|
|
||||||
zval* ctx_res;
|
zval* ctx_res;
|
||||||
SCARDCONTEXT context;
|
SCARDCONTEXT context;
|
||||||
|
|
||||||
|
|
@ -547,6 +544,7 @@ PHP_FUNCTION(scard_release_context)
|
||||||
RETURN_NULL();
|
RETURN_NULL();
|
||||||
}
|
}
|
||||||
ZEND_FETCH_RESOURCE(context, SCARDCONTEXT, &ctx_res, -1, PHP_PCSC_CTX_RES_NAME, le_pcsc_ctx_res);
|
ZEND_FETCH_RESOURCE(context, SCARDCONTEXT, &ctx_res, -1, PHP_PCSC_CTX_RES_NAME, le_pcsc_ctx_res);
|
||||||
|
(void)context;
|
||||||
|
|
||||||
zend_hash_index_del(&EG(regular_list), Z_RES_HANDLE_P(ctx_res));
|
zend_hash_index_del(&EG(regular_list), Z_RES_HANDLE_P(ctx_res));
|
||||||
RETURN_TRUE;
|
RETURN_TRUE;
|
||||||
|
|
@ -669,7 +667,7 @@ PHP_FUNCTION(scard_transmit)
|
||||||
SCARD_IO_REQUEST *recvPci = NULL;
|
SCARD_IO_REQUEST *recvPci = NULL;
|
||||||
BYTE *sendBuffer;
|
BYTE *sendBuffer;
|
||||||
BYTE *recvBuffer;
|
BYTE *recvBuffer;
|
||||||
DWORD sendLen, recvLen;
|
DWORD sendLen = 0, recvLen;
|
||||||
LONG rc;
|
LONG rc;
|
||||||
char *apdu;
|
char *apdu;
|
||||||
size_t apduLen;
|
size_t apduLen;
|
||||||
|
|
@ -734,7 +732,6 @@ PHP_FUNCTION(scard_status)
|
||||||
{
|
{
|
||||||
zval* conn_res;
|
zval* conn_res;
|
||||||
SCARDHANDLE hCard = 0;
|
SCARDHANDLE hCard = 0;
|
||||||
char *strReader = NULL;
|
|
||||||
DWORD dwProtocol, dwState;
|
DWORD dwProtocol, dwState;
|
||||||
BYTE atrBuffer[32];
|
BYTE atrBuffer[32];
|
||||||
DWORD atrLen;
|
DWORD atrLen;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue