From: Frank Lichtenheld <[email protected]> - Fix several constVariablePointer issues that were newly reported - Fix one unreadVariable issue that was newly reported - Remove --showtime=summary from cppcheck args again, it is now much more verbose
Change-Id: I6693b5aa2988102f5e7884a65119ebfc87dd07e1 Signed-off-by: Frank Lichtenheld <[email protected]> Acked-by: Gert Doering <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1954 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1954 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering <[email protected]> diff --git a/dev-tools/run-cppcheck.sh b/dev-tools/run-cppcheck.sh index ad012ac..3c71c83 100755 --- a/dev-tools/run-cppcheck.sh +++ b/dev-tools/run-cppcheck.sh @@ -33,7 +33,7 @@ --suppress-xml=${SCRIPT_DIR}/cppcheck-suppressions.xml --inline-suppr \ --cppcheck-build-dir=${CPPCHECK_DIR} \ --check-level=${CPPCHECK_CHECK_LEVEL} --max-configs=10 \ - --error-exitcode=1 --showtime=summary" + --error-exitcode=1" set -x diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index 6d88f6f..9fc0e3b 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -534,7 +534,7 @@ ASSERT(sock->info.connection_established); struct sockaddr *remoteaddr = &sock->info.lsa->actual.dest.addr.sa; - struct tls_multi *multi = c->c2.tls_multi; + const struct tls_multi *multi = c->c2.tls_multi; #ifdef TARGET_FREEBSD /* In Linux in P2P mode the kernel automatically removes an existing peer * when adding a new peer. FreeBSD needs to explicitly be told to do that */ diff --git a/src/openvpn/mudp.c b/src/openvpn/mudp.c index 4794b7e..2b08ada 100644 --- a/src/openvpn/mudp.c +++ b/src/openvpn/mudp.c @@ -316,10 +316,9 @@ multi_get_instance_udp_real(struct multi_context *m, struct mroute_addr *real) { struct hash *hash = m->hash; - struct hash_element *he; const uint64_t hv = hash_value(hash, real); struct hash_bucket *bucket = hash_bucket(hash, hv); - he = hash_lookup_fast(hash, bucket, real, hv); + const struct hash_element *he = hash_lookup_fast(hash, bucket, real, hv); if (he) { return he->value; diff --git a/src/openvpn/pkcs11_openssl.c b/src/openvpn/pkcs11_openssl.c index 69c5a50..24dce84 100644 --- a/src/openvpn/pkcs11_openssl.c +++ b/src/openvpn/pkcs11_openssl.c @@ -184,7 +184,6 @@ { tbs = buf; tbslen = (size_t)buflen; - sigalg.op = "Sign"; } else { diff --git a/src/openvpn/socks.c b/src/openvpn/socks.c index 19f3d54..65ecb3c 100644 --- a/src/openvpn/socks.c +++ b/src/openvpn/socks.c @@ -323,8 +323,7 @@ return port; } - struct servent *service; - service = getservbyname(servname, NULL); + const struct servent *service = getservbyname(servname, NULL); if (service) { return service->s_port; diff --git a/tests/unit_tests/openvpn/siphash_openssl.c b/tests/unit_tests/openvpn/siphash_openssl.c index c301f2d..99a7763 100644 --- a/tests/unit_tests/openvpn/siphash_openssl.c +++ b/tests/unit_tests/openvpn/siphash_openssl.c @@ -101,7 +101,7 @@ bool siphash_openssl_available(void *sip_context) { - struct siphash_context *sip = sip_context; + const struct siphash_context *sip = sip_context; return (bool)(sip->mac); } _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
