[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 81/153: GCC: silence -Wcast-function-type uniformly
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 81/153: GCC: silence -Wcast-function-type uniformly |
Date: |
Tue, 11 Sep 2018 12:52:32 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit f31911a8002d3c9de109f5352328d8b6fbf035c2
Author: Marcel Raad <address@hidden>
AuthorDate: Fri Aug 10 17:32:01 2018 +0200
GCC: silence -Wcast-function-type uniformly
Pointed-out-by: Rikard Falkeborn
Closes https://github.com/curl/curl/pull/2860
---
lib/md5.c | 38 ++++++++++++++++++++++----------------
src/tool_metalink.c | 23 +++++++++--------------
2 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/lib/md5.c b/lib/md5.c
index d372c6da9..b819d3924 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -484,29 +484,35 @@ static void MD5_Final(unsigned char *result, MD5_CTX *ctx)
#endif /* CRYPTO LIBS */
-/* Disable this picky gcc-8 compiler warning */
-#if defined(__GNUC__) && (__GNUC__ >= 8)
-#pragma GCC diagnostic ignored "-Wcast-function-type"
-#endif
-
const HMAC_params Curl_HMAC_MD5[] = {
{
- (HMAC_hinit_func) MD5_Init, /* Hash initialization function. */
- (HMAC_hupdate_func) MD5_Update, /* Hash update function. */
- (HMAC_hfinal_func) MD5_Final, /* Hash computation end function. */
- sizeof(MD5_CTX), /* Size of hash context structure. */
- 64, /* Maximum key length. */
- 16 /* Result size. */
+ /* Hash initialization function. */
+ CURLX_FUNCTION_CAST(HMAC_hinit_func, MD5_Init),
+ /* Hash update function. */
+ CURLX_FUNCTION_CAST(HMAC_hupdate_func, MD5_Update),
+ /* Hash computation end function. */
+ CURLX_FUNCTION_CAST(HMAC_hfinal_func, MD5_Final),
+ /* Size of hash context structure. */
+ sizeof(MD5_CTX),
+ /* Maximum key length. */
+ 64,
+ /* Result size. */
+ 16
}
};
const MD5_params Curl_DIGEST_MD5[] = {
{
- (Curl_MD5_init_func) MD5_Init, /* Digest initialization function */
- (Curl_MD5_update_func) MD5_Update, /* Digest update function */
- (Curl_MD5_final_func) MD5_Final, /* Digest computation end function */
- sizeof(MD5_CTX), /* Size of digest context struct */
- 16 /* Result size */
+ /* Digest initialization function */
+ CURLX_FUNCTION_CAST(Curl_MD5_init_func, MD5_Init),
+ /* Digest update function */
+ CURLX_FUNCTION_CAST(Curl_MD5_update_func, MD5_Update),
+ /* Digest computation end function */
+ CURLX_FUNCTION_CAST(Curl_MD5_final_func, MD5_Final),
+ /* Size of digest context struct */
+ sizeof(MD5_CTX),
+ /* Result size */
+ 16
}
};
diff --git a/src/tool_metalink.c b/src/tool_metalink.c
index f8effd374..4c4261472 100644
--- a/src/tool_metalink.c
+++ b/src/tool_metalink.c
@@ -461,16 +461,11 @@ static void SHA256_Final(unsigned char digest[32],
SHA256_CTX *ctx)
#endif /* CRYPTO LIBS */
-/* Disable this picky gcc-8 compiler warning */
-#if defined(__GNUC__) && (__GNUC__ >= 8)
-#pragma GCC diagnostic ignored "-Wcast-function-type"
-#endif
-
const digest_params MD5_DIGEST_PARAMS[] = {
{
- (Curl_digest_init_func) MD5_Init,
- (Curl_digest_update_func) MD5_Update,
- (Curl_digest_final_func) MD5_Final,
+ CURLX_FUNCTION_CAST(Curl_digest_init_func, MD5_Init),
+ CURLX_FUNCTION_CAST(Curl_digest_update_func, MD5_Update),
+ CURLX_FUNCTION_CAST(Curl_digest_final_func, MD5_Final),
sizeof(MD5_CTX),
16
}
@@ -478,9 +473,9 @@ const digest_params MD5_DIGEST_PARAMS[] = {
const digest_params SHA1_DIGEST_PARAMS[] = {
{
- (Curl_digest_init_func) SHA1_Init,
- (Curl_digest_update_func) SHA1_Update,
- (Curl_digest_final_func) SHA1_Final,
+ CURLX_FUNCTION_CAST(Curl_digest_init_func, SHA1_Init),
+ CURLX_FUNCTION_CAST(Curl_digest_update_func, SHA1_Update),
+ CURLX_FUNCTION_CAST(Curl_digest_final_func, SHA1_Final),
sizeof(SHA_CTX),
20
}
@@ -488,9 +483,9 @@ const digest_params SHA1_DIGEST_PARAMS[] = {
const digest_params SHA256_DIGEST_PARAMS[] = {
{
- (Curl_digest_init_func) SHA256_Init,
- (Curl_digest_update_func) SHA256_Update,
- (Curl_digest_final_func) SHA256_Final,
+ CURLX_FUNCTION_CAST(Curl_digest_init_func, SHA256_Init),
+ CURLX_FUNCTION_CAST(Curl_digest_update_func, SHA256_Update),
+ CURLX_FUNCTION_CAST(Curl_digest_final_func, SHA256_Final),
sizeof(SHA256_CTX),
32
}
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 84/153: Split non-portable part off test 1133, (continued)
- [GNUnet-SVN] [gnurl] 84/153: Split non-portable part off test 1133, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 63/153: RELEASE-NOTES: synced, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 85/153: .travis.yml: verify that man pages can be regenerated, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 79/153: CURLINFO_SIZE_UPLOAD: fix missing counter update, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 61/153: windows: implement send buffer tuning, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 77/153: RELEASE-NOTES: synced, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 83/153: projects: Improve Windows perl detection in batch scripts, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 78/153: Documentation: fix CURLOPT_SSH_COMPRESSION copy/paste bug, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 55/153: DEPRECATE: remove release date from 7.62.0, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 82/153: docs: Improve the manual pages of some callbacks, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 81/153: GCC: silence -Wcast-function-type uniformly,
gnunet <=
- [GNUnet-SVN] [gnurl] 52/153: test1307: disabled, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 76/153: openssl: fix potential NULL pointer deref in is_pkcs11_uri, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 67/153: formdata: Remove unused macro HTTPPOST_CONTENTTYPE_DEFAULT, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 49/153: RELEASE-NOTES: synced, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 50/153: general: fix printf specifiers, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 60/153: ssl: set engine implicitly when a PKCS#11 URI is provided, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 74/153: lib1502: fix memory leak in torture test, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 75/153: travis: execute "set -eo pipefail" for coverage build, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 73/153: docs: mention NULL is fine input to several functions, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 66/153: telnet: Remove unused macros TELOPTS and TELCMDS, gnunet, 2018/09/11