[pkg-opensc-commit] [pkcs11-helper] 133/253: Fix some pedantic warning

Eric Dorland eric at moszumanska.debian.org
Fri Jan 6 23:39:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository pkcs11-helper.

commit 4616fade68c768cdb97f699da313e5e6ffadb840
Author: Alon Bar-Lev <alon.barlev at gmail.com>
Date:   Fri Nov 9 18:41:51 2007 +0000

    Fix some pedantic warning
---
 configure.ac                              | 2 +-
 lib/pkcs11h-core.c                        | 9 +++++++++
 lib/pkcs11h-openssl.c                     | 2 +-
 lib/pkcs11h-session.c                     | 2 +-
 tests/test-certificate/test-certificate.c | 2 ++
 5 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0f21e4f..e5be603 100644
--- a/configure.ac
+++ b/configure.ac
@@ -367,7 +367,7 @@ if echo "${CC}" | grep gcc 2>&1 > /dev/null; then
 fi
 
 if test "$enable_pedantic" = "yes"; then
-	CFLAGS="${CFLAGS} -ansi -pedantic -D__STRICT_ANSI__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE -D_SVID_SOURCE"
+	CFLAGS="${CFLAGS} -ansi -pedantic -D__STRICT_ANSI__ -D_ISOC99_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE"
 fi
 
 if test "${enable_threading}" != "yes" -a "${enable_slotevent}" = "yes"; then
diff --git a/lib/pkcs11h-core.c b/lib/pkcs11h-core.c
index b64b414..842debc 100644
--- a/lib/pkcs11h-core.c
+++ b/lib/pkcs11h-core.c
@@ -633,12 +633,17 @@ pkcs11h_addProvider (
 #if defined(ENABLE_PKCS11H_THREADING)
 	PKCS11H_BOOL mutex_locked = FALSE;
 #endif
+#if defined(ENABLE_PKCS11H_DEBUG)
 #if defined(_WIN32)
 	int mypid = 0;
 #else
 	pid_t mypid = getpid ();
+#endif
+#endif
+#if !defined(_WIN32)
 	void *p;
 #endif
+
 	_pkcs11h_provider_t provider = NULL;
 	CK_C_GetFunctionList gfl = NULL;
 	CK_INFO info;
@@ -981,11 +986,13 @@ pkcs11h_forkFixup (void) {
 
 CK_RV
 pkcs11h_plugAndPlay (void) {
+#if defined(ENABLE_PKCS11H_DEBUG)
 #if defined(_WIN32)
 	int mypid = 0;
 #else
 	pid_t mypid = getpid ();
 #endif
+#endif
 
 	_PKCS11H_DEBUG (
 		PKCS11H_LOG_DEBUG2,
@@ -1252,7 +1259,9 @@ __pkcs11h_forkFixup (
 #if defined(ENABLE_PKCS11H_THREADING)
 	PKCS11H_BOOL mutex_locked = FALSE;
 #endif
+#if defined(ENABLE_PKCS11H_DEBUG)
 	pid_t mypid = getpid ();
+#endif
 
 	_PKCS11H_DEBUG (
 		PKCS11H_LOG_DEBUG2,
diff --git a/lib/pkcs11h-openssl.c b/lib/pkcs11h-openssl.c
index 4e9ec86..6961969 100644
--- a/lib/pkcs11h-openssl.c
+++ b/lib/pkcs11h-openssl.c
@@ -264,7 +264,7 @@ cleanup:
 		pkcs11h_getMessage (rv)
 	);
 
-	return rv == CKR_OK ? tlen : -1; 
+	return rv == CKR_OK ? (int)tlen : -1; 
 }
 
 #if OPENSSL_VERSION_NUMBER < 0x00907000L
diff --git a/lib/pkcs11h-session.c b/lib/pkcs11h-session.c
index 6919d34..93de26a 100644
--- a/lib/pkcs11h-session.c
+++ b/lib/pkcs11h-session.c
@@ -552,9 +552,9 @@ _pkcs11h_session_release (
 
 	rv = CKR_OK;
 
+#if defined(ENABLE_PKCS11H_THREADING)
 cleanup:
 
-#if defined(ENABLE_PKCS11H_THREADING)
 	if (mutex_locked) {
 		_pkcs11h_threading_mutexRelease (&session->mutex);
 		mutex_locked = FALSE;
diff --git a/tests/test-certificate/test-certificate.c b/tests/test-certificate/test-certificate.c
index 6811777..fbaf2d7 100644
--- a/tests/test-certificate/test-certificate.c
+++ b/tests/test-certificate/test-certificate.c
@@ -4,6 +4,8 @@
 #include <string.h>
 #if defined(_WIN32)
 #include <conio.h>
+#else
+#include <unistd.h>
 #endif
 
 #if !(defined(ENABLE_PKCS11H_CERTIFICATE) && (defined(ENABLE_PKCS11H_ENGINE_OPENSSL) || defined (ENABLE_PKCS11H_ENGINE_GNUTLS) || defined(ENABLE_PKCS11H_ENGINE_WIN32)))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/pkcs11-helper.git



More information about the pkg-opensc-commit mailing list