From bbf0836e37dbf8c0b3a354c7df445b5f0fcf6f1a Mon Sep 17 00:00:00 2001 From: jsing <> Date: Thu, 10 Jul 2014 20:42:45 +0000 Subject: Inline the only use of the HEX_SIZE macro and nuke both DECIMAL_SIZE and HEX_SIZE. ok beck@ miod@ --- src/lib/libcrypto/asn1/a_strex.c | 4 ++-- src/lib/libcrypto/cryptlib.h | 6 +----- src/lib/libssl/src/crypto/asn1/a_strex.c | 4 ++-- src/lib/libssl/src/crypto/cryptlib.h | 6 +----- 4 files changed, 6 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/asn1/a_strex.c b/src/lib/libcrypto/asn1/a_strex.c index 885b61efaf..e2e21a2292 100644 --- a/src/lib/libcrypto/asn1/a_strex.c +++ b/src/lib/libcrypto/asn1/a_strex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_strex.c,v 1.22 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: a_strex.c,v 1.23 2014/07/10 20:42:45 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -131,7 +131,7 @@ do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, char_io *io_ch, void *arg) { unsigned char chflgs, chtmp; - char tmphex[HEX_SIZE(long) + 3]; + char tmphex[sizeof(long) * 2 + 3]; if (c > 0xffffffffL) return -1; diff --git a/src/lib/libcrypto/cryptlib.h b/src/lib/libcrypto/cryptlib.h index bd4c4da3aa..ad669a2745 100644 --- a/src/lib/libcrypto/cryptlib.h +++ b/src/lib/libcrypto/cryptlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptlib.h,v 1.21 2014/07/10 20:02:58 jsing Exp $ */ +/* $OpenBSD: cryptlib.h,v 1.22 2014/07/10 20:42:45 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -76,10 +76,6 @@ extern "C" { #define X509_CERT_DIR_EVP "SSL_CERT_DIR" #define X509_CERT_FILE_EVP "SSL_CERT_FILE" -/* size of string representations */ -#define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1) -#define HEX_SIZE(type) (sizeof(type)*2) - void OPENSSL_cpuid_setup(void); extern unsigned int OPENSSL_ia32cap_P[]; void OPENSSL_showfatal(const char *fmta,...); diff --git a/src/lib/libssl/src/crypto/asn1/a_strex.c b/src/lib/libssl/src/crypto/asn1/a_strex.c index 885b61efaf..e2e21a2292 100644 --- a/src/lib/libssl/src/crypto/asn1/a_strex.c +++ b/src/lib/libssl/src/crypto/asn1/a_strex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_strex.c,v 1.22 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: a_strex.c,v 1.23 2014/07/10 20:42:45 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -131,7 +131,7 @@ do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, char_io *io_ch, void *arg) { unsigned char chflgs, chtmp; - char tmphex[HEX_SIZE(long) + 3]; + char tmphex[sizeof(long) * 2 + 3]; if (c > 0xffffffffL) return -1; diff --git a/src/lib/libssl/src/crypto/cryptlib.h b/src/lib/libssl/src/crypto/cryptlib.h index bd4c4da3aa..ad669a2745 100644 --- a/src/lib/libssl/src/crypto/cryptlib.h +++ b/src/lib/libssl/src/crypto/cryptlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptlib.h,v 1.21 2014/07/10 20:02:58 jsing Exp $ */ +/* $OpenBSD: cryptlib.h,v 1.22 2014/07/10 20:42:45 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -76,10 +76,6 @@ extern "C" { #define X509_CERT_DIR_EVP "SSL_CERT_DIR" #define X509_CERT_FILE_EVP "SSL_CERT_FILE" -/* size of string representations */ -#define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1) -#define HEX_SIZE(type) (sizeof(type)*2) - void OPENSSL_cpuid_setup(void); extern unsigned int OPENSSL_ia32cap_P[]; void OPENSSL_showfatal(const char *fmta,...); -- cgit v1.2.3-55-g6feb