From 8df455479f8801bbebad8839fc96abbffa711603 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 14 May 2020 00:05:04 +0200 Subject: source cleanup: remove all custom typedef structs - Stick to a single unified way to use structs - Make checksrc complain on 'typedef struct {' - Allow them in tests, public headers and examples - Let MD4_CTX, MD5_CTX, and SHA256_CTX typedefs remain as they actually typedef different types/structs depending on build conditions. Closes #5338 --- lib/sha256.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/sha256.c') diff --git a/lib/sha256.c b/lib/sha256.c index 00d98ce46..a3be92a4e 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -196,10 +196,11 @@ static void SHA256_Final(unsigned char *digest, SHA256_CTX *ctx) #include -typedef struct { +struct sha256_ctx { HCRYPTPROV hCryptProv; HCRYPTHASH hHash; -} SHA256_CTX; +}; +typedef struct sha256_ctx SHA256_CTX; #if !defined(CALG_SHA_256) #define CALG_SHA_256 0x0000800c @@ -280,7 +281,7 @@ do { \ } while(0) #endif -typedef struct sha256_state { +struct sha256_state { #ifdef HAVE_LONGLONG unsigned long long length; #else @@ -288,7 +289,8 @@ typedef struct sha256_state { #endif unsigned long state[8], curlen; unsigned char buf[64]; -} SHA256_CTX; +}; +typedef struct sha256_state SHA256_CTX; /* The K array */ static const unsigned long K[64] = { -- cgit v1.2.3