From b1e0a2287902704dfe165a7ba7d1fe23b22bf25f Mon Sep 17 00:00:00 2001 From: doug <> Date: Sat, 27 Jun 2015 22:42:02 +0000 Subject: Fix pointer to unsigned long conversion. bcook@ notes that this check really only impacted 64-bit Windows. Also, changed the check to be unsigned for consistency. ok bcook@ --- src/lib/libcrypto/cryptlib.c | 8 +++++--- src/lib/libcrypto/crypto/Makefile | 4 ++-- src/lib/libssl/src/crypto/cryptlib.c | 8 +++++--- src/lib/libssl/ssl/Makefile | 4 ++-- 4 files changed, 14 insertions(+), 10 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index dc92ac89fe..896e3d39cf 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptlib.c,v 1.34 2015/01/22 03:56:27 bcook Exp $ */ +/* $OpenBSD: cryptlib.c,v 1.35 2015/06/27 22:42:02 doug Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -114,7 +114,9 @@ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. */ +#include #include +#include #include #include @@ -431,9 +433,9 @@ CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr) { memset(id, 0, sizeof(*id)); id->ptr = ptr; -#if LONG_MAX >= INTPTR_MAX +#if ULONG_MAX >= UINTPTR_MAX /*s u 'ptr' can be embedded in 'val' without loss of uniqueness */ - id->val = (unsigned long)id->ptr; + id->val = (uintptr_t)id->ptr; #else { SHA256_CTX ctx; diff --git a/src/lib/libcrypto/crypto/Makefile b/src/lib/libcrypto/crypto/Makefile index d523e8029d..c1905516c2 100644 --- a/src/lib/libcrypto/crypto/Makefile +++ b/src/lib/libcrypto/crypto/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.58 2015/06/20 01:07:24 doug Exp $ +# $OpenBSD: Makefile,v 1.59 2015/06/27 22:42:02 doug Exp $ LIB= crypto SSL_SRC= ${.CURDIR}/../../libssl/src LCRYPTO_SRC= ${SSL_SRC}/crypto -CFLAGS+= -Wall -Werror +CFLAGS+= -Wall -Wundef -Werror .include # for 'NOPIC' definition .if !defined(NOPIC) diff --git a/src/lib/libssl/src/crypto/cryptlib.c b/src/lib/libssl/src/crypto/cryptlib.c index dc92ac89fe..896e3d39cf 100644 --- a/src/lib/libssl/src/crypto/cryptlib.c +++ b/src/lib/libssl/src/crypto/cryptlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptlib.c,v 1.34 2015/01/22 03:56:27 bcook Exp $ */ +/* $OpenBSD: cryptlib.c,v 1.35 2015/06/27 22:42:02 doug Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -114,7 +114,9 @@ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. */ +#include #include +#include #include #include @@ -431,9 +433,9 @@ CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr) { memset(id, 0, sizeof(*id)); id->ptr = ptr; -#if LONG_MAX >= INTPTR_MAX +#if ULONG_MAX >= UINTPTR_MAX /*s u 'ptr' can be embedded in 'val' without loss of uniqueness */ - id->val = (unsigned long)id->ptr; + id->val = (uintptr_t)id->ptr; #else { SHA256_CTX ctx; diff --git a/src/lib/libssl/ssl/Makefile b/src/lib/libssl/ssl/Makefile index a13fcdf512..0ff974e4de 100644 --- a/src/lib/libssl/ssl/Makefile +++ b/src/lib/libssl/ssl/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.52 2015/06/05 21:42:37 tobiasu Exp $ +# $OpenBSD: Makefile,v 1.53 2015/06/27 22:42:02 doug Exp $ LIB= ssl @@ -6,7 +6,7 @@ SSL_SRC= ${.CURDIR}/../../libssl/src LSSL_SRC= ${SSL_SRC}/ssl .include -CFLAGS+= -Wall +CFLAGS+= -Wall -Wundef .if ${COMPILER_VERSION:L} != "gcc3" CFLAGS+= -Werror .endif -- cgit v1.2.3-55-g6feb