diff options
author | jsing <> | 2014-07-10 20:42:45 +0000 |
---|---|---|
committer | jsing <> | 2014-07-10 20:42:45 +0000 |
commit | bbf0836e37dbf8c0b3a354c7df445b5f0fcf6f1a (patch) | |
tree | c5c97614e5d4e9df864e05d4a28c65240933c79d | |
parent | b49f9185d82110f25ba34a9dfd3717c9d9c83a79 (diff) | |
download | openbsd-bbf0836e37dbf8c0b3a354c7df445b5f0fcf6f1a.tar.gz openbsd-bbf0836e37dbf8c0b3a354c7df445b5f0fcf6f1a.tar.bz2 openbsd-bbf0836e37dbf8c0b3a354c7df445b5f0fcf6f1a.zip |
Inline the only use of the HEX_SIZE macro and nuke both DECIMAL_SIZE and
HEX_SIZE.
ok beck@ miod@
-rw-r--r-- | src/lib/libcrypto/asn1/a_strex.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/cryptlib.h | 6 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/a_strex.c | 4 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/cryptlib.h | 6 |
4 files changed, 6 insertions, 14 deletions
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 @@ | |||
1 | /* $OpenBSD: a_strex.c,v 1.22 2014/06/12 15:49:27 deraadt Exp $ */ | 1 | /* $OpenBSD: a_strex.c,v 1.23 2014/07/10 20:42:45 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -131,7 +131,7 @@ do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, | |||
131 | char_io *io_ch, void *arg) | 131 | char_io *io_ch, void *arg) |
132 | { | 132 | { |
133 | unsigned char chflgs, chtmp; | 133 | unsigned char chflgs, chtmp; |
134 | char tmphex[HEX_SIZE(long) + 3]; | 134 | char tmphex[sizeof(long) * 2 + 3]; |
135 | 135 | ||
136 | if (c > 0xffffffffL) | 136 | if (c > 0xffffffffL) |
137 | return -1; | 137 | 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 @@ | |||
1 | /* $OpenBSD: cryptlib.h,v 1.21 2014/07/10 20:02:58 jsing Exp $ */ | 1 | /* $OpenBSD: cryptlib.h,v 1.22 2014/07/10 20:42:45 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -76,10 +76,6 @@ extern "C" { | |||
76 | #define X509_CERT_DIR_EVP "SSL_CERT_DIR" | 76 | #define X509_CERT_DIR_EVP "SSL_CERT_DIR" |
77 | #define X509_CERT_FILE_EVP "SSL_CERT_FILE" | 77 | #define X509_CERT_FILE_EVP "SSL_CERT_FILE" |
78 | 78 | ||
79 | /* size of string representations */ | ||
80 | #define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1) | ||
81 | #define HEX_SIZE(type) (sizeof(type)*2) | ||
82 | |||
83 | void OPENSSL_cpuid_setup(void); | 79 | void OPENSSL_cpuid_setup(void); |
84 | extern unsigned int OPENSSL_ia32cap_P[]; | 80 | extern unsigned int OPENSSL_ia32cap_P[]; |
85 | void OPENSSL_showfatal(const char *fmta,...); | 81 | 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 @@ | |||
1 | /* $OpenBSD: a_strex.c,v 1.22 2014/06/12 15:49:27 deraadt Exp $ */ | 1 | /* $OpenBSD: a_strex.c,v 1.23 2014/07/10 20:42:45 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -131,7 +131,7 @@ do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, | |||
131 | char_io *io_ch, void *arg) | 131 | char_io *io_ch, void *arg) |
132 | { | 132 | { |
133 | unsigned char chflgs, chtmp; | 133 | unsigned char chflgs, chtmp; |
134 | char tmphex[HEX_SIZE(long) + 3]; | 134 | char tmphex[sizeof(long) * 2 + 3]; |
135 | 135 | ||
136 | if (c > 0xffffffffL) | 136 | if (c > 0xffffffffL) |
137 | return -1; | 137 | 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 @@ | |||
1 | /* $OpenBSD: cryptlib.h,v 1.21 2014/07/10 20:02:58 jsing Exp $ */ | 1 | /* $OpenBSD: cryptlib.h,v 1.22 2014/07/10 20:42:45 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -76,10 +76,6 @@ extern "C" { | |||
76 | #define X509_CERT_DIR_EVP "SSL_CERT_DIR" | 76 | #define X509_CERT_DIR_EVP "SSL_CERT_DIR" |
77 | #define X509_CERT_FILE_EVP "SSL_CERT_FILE" | 77 | #define X509_CERT_FILE_EVP "SSL_CERT_FILE" |
78 | 78 | ||
79 | /* size of string representations */ | ||
80 | #define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1) | ||
81 | #define HEX_SIZE(type) (sizeof(type)*2) | ||
82 | |||
83 | void OPENSSL_cpuid_setup(void); | 79 | void OPENSSL_cpuid_setup(void); |
84 | extern unsigned int OPENSSL_ia32cap_P[]; | 80 | extern unsigned int OPENSSL_ia32cap_P[]; |
85 | void OPENSSL_showfatal(const char *fmta,...); | 81 | void OPENSSL_showfatal(const char *fmta,...); |