From 8a5ec725566fb5bc55130b5f6b2e3b2354609c5c Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 15 Oct 2021 13:17:40 -0400 Subject: [PATCH] Fix up some doc.go nits in asn1.h. Not quite ready to add it to doc.config, but this fixes up the different C++ guard styles, and a few mistakes in the comments. Bug: 426 Change-Id: I027f14b2f79861e510bfa7a958604f47ae78dda1 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/49911 Reviewed-by: Adam Langley --- include/openssl/asn1.h | 20 +++++++++----------- include/openssl/x509.h | 6 +++--- include/openssl/x509v3.h | 6 +++--- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index ead638490..3ac4b28c0 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h @@ -63,11 +63,10 @@ #include #include -#include - #include +#include -#ifdef __cplusplus +#if defined(__cplusplus) extern "C" { #endif @@ -556,10 +555,9 @@ OPENSSL_EXPORT int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in); // The following formats define encodings for use with functions like -// |ASN1_mbstring_copy|. +// |ASN1_mbstring_copy|. Note |MBSTRING_ASC| refers to Latin-1, not ASCII. #define MBSTRING_FLAG 0x1000 #define MBSTRING_UTF8 (MBSTRING_FLAG) -// |MBSTRING_ASC| refers to Latin-1, not ASCII. #define MBSTRING_ASC (MBSTRING_FLAG | 1) #define MBSTRING_BMP (MBSTRING_FLAG | 2) #define MBSTRING_UNIV (MBSTRING_FLAG | 4) @@ -781,8 +779,8 @@ DECLARE_ASN1_ITEM(ASN1_INTEGER) // success and zero on error. OPENSSL_EXPORT int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); -// ASN1_INTEGER_set sets |a| to an INTEGER with value |v|. It returns one on -// success and zero on error. +// ASN1_INTEGER_set_uint64 sets |a| to an INTEGER with value |v|. It returns one +// on success and zero on error. OPENSSL_EXPORT int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v); // ASN1_INTEGER_get returns the value of |a| as a |long|, or -1 if |a| is out of @@ -836,8 +834,8 @@ DECLARE_ASN1_ITEM(ASN1_ENUMERATED) // on success and zero on error. OPENSSL_EXPORT int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); -// ASN1_INTEGER_get returns the value of |a| as a |long|, or -1 if |a| is out of -// range or the wrong type. +// ASN1_ENUMERATED_get returns the value of |a| as a |long|, or -1 if |a| is out +// of range or the wrong type. OPENSSL_EXPORT long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a); // BN_to_ASN1_ENUMERATED sets |ai| to an ENUMERATED with value |bn| and returns @@ -1500,8 +1498,8 @@ OPENSSL_EXPORT ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf); OPENSSL_EXPORT ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf); -#ifdef __cplusplus -} +#if defined(__cplusplus) +} // extern C extern "C++" { diff --git a/include/openssl/x509.h b/include/openssl/x509.h index 59f2adfa9..070145b14 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -82,7 +82,7 @@ #include #include -#ifdef __cplusplus +#if defined(__cplusplus) extern "C" { #endif @@ -2336,8 +2336,8 @@ OPENSSL_EXPORT const X509_POLICY_NODE *X509_policy_node_get0_parent( const X509_POLICY_NODE *node); -#ifdef __cplusplus -} +#if defined(__cplusplus) +} // extern C #endif #if !defined(BORINGSSL_NO_CXX) diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h index 8e4a511c0..9c86b90fd 100644 --- a/include/openssl/x509v3.h +++ b/include/openssl/x509v3.h @@ -60,7 +60,7 @@ #include #include -#ifdef __cplusplus +#if defined(__cplusplus) extern "C" { #endif @@ -928,8 +928,8 @@ DEFINE_STACK_OF(X509_POLICY_NODE) // made after this point may be overwritten when the script is next run. -#ifdef __cplusplus -} +#if defined(__cplusplus) +} // extern C extern "C++" {