[vlc-commits] misc/gnutls: do not declare variable if not needed

Filip Roséen git at videolan.org
Wed Mar 15 19:25:05 CET 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Wed Mar 15 10:07:47 2017 +0100| [a0ffc3d096e7f6d77e3ba84d3ba5bb146e002c70] | committer: Jean-Baptiste Kempf

misc/gnutls: do not declare variable if not needed

The variable in question is only needed within the preprocessor-if
that follows, as such it makes more sense to declare only declare it
if that is actually reached (while also supressing a warning
diagnostic related to the variable being unused).

An empty statement has been added after the label in order to comply
with the ISO C Standard, which mandates that a label preceedes a
statement (which a variable declaration is not).

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a0ffc3d096e7f6d77e3ba84d3ba5bb146e002c70
---

 modules/misc/gnutls.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
index 3b83a9b..f3e5d44 100644
--- a/modules/misc/gnutls.c
+++ b/modules/misc/gnutls.c
@@ -348,10 +348,11 @@ static int gnutls_ContinueHandshake(vlc_tls_creds_t *crd,
     msg_Err(crd, "TLS handshake error: %s", gnutls_strerror (val));
     return -1;
 
-    unsigned flags;
 done:
 #if (GNUTLS_VERSION_NUMBER >= 0x030500)
-    flags = gnutls_session_get_flags(session);
+    /* intentionally left blank */;
+
+    unsigned flags = gnutls_session_get_flags(session);
 
     if (flags & GNUTLS_SFLAGS_SAFE_RENEGOTIATION)
         msg_Dbg(crd, " - safe renegotiation (RFC5746) enabled");



More information about the vlc-commits mailing list