[network-manager-openconnect] properties: fix compiler warning about mixing declarations and code
- From: Thomas Haller <thaller src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openconnect] properties: fix compiler warning about mixing declarations and code
- Date: Wed, 28 Jun 2017 08:10:57 +0000 (UTC)
commit 6aa7d39d5f40957e3a4fa4d19f7ed434ee1bc5d2
Author: Thomas Haller <thaller redhat com>
Date: Wed Jun 28 10:04:58 2017 +0200
properties: fix compiler warning about mixing declarations and code
nm-openconnect-editor-plugin.c:396:14: error: ISO C90 forbids mixing declarations and code
[-Werror,-Wdeclaration-after-statement]
const char *supported_protocols = nm_vpn_plugin_info_lookup_property (plugin_info,
"openconnect", "supported-protocols");
Fixes: 1ed6de801a398887277fbb9c35d9f5f5d6c4d5c3
properties/nm-openconnect-editor-plugin.c | 53 +++++++++++++++--------------
1 files changed, 27 insertions(+), 26 deletions(-)
---
diff --git a/properties/nm-openconnect-editor-plugin.c b/properties/nm-openconnect-editor-plugin.c
index 52b9ee7..7a03f24 100644
--- a/properties/nm-openconnect-editor-plugin.c
+++ b/properties/nm-openconnect-editor-plugin.c
@@ -367,36 +367,37 @@ notify_plugin_info_set (NMVpnEditorPlugin *plugin,
g_strfreev (priv->supported_protocols);
+ {
#if OPENCONNECT_CHECK_VER(5,5)
- struct oc_vpn_proto *protos, *p;
-
- if ((i = openconnect_get_supported_protocols(&protos)) < 0)
- priv->supported_protocols = g_new0(gchar *, 1);
- else {
- priv->supported_protocols = g_new0(gchar *, i+1);
- for (i=0, p=protos; p && p->name; p++) {
- priv->supported_protocols[i] = g_strdup(p->name);
+ struct oc_vpn_proto *protos, *p;
+
+ if ((i = openconnect_get_supported_protocols(&protos)) < 0)
+ priv->supported_protocols = g_new0(gchar *, 1);
+ else {
+ priv->supported_protocols = g_new0(gchar *, i+1);
+ for (i=0, p=protos; p && p->name; p++) {
+ priv->supported_protocols[i] = g_strdup(p->name);
+ }
+ openconnect_free_supported_protocols(protos);
}
- openconnect_free_supported_protocols(protos);
- }
-
#else
- const char *supported_protocols = nm_vpn_plugin_info_lookup_property (plugin_info, "openconnect",
"supported-protocols");
-
- priv->supported_protocols = supported_protocols
- ? g_strsplit_set (supported_protocols, ",", -1)
- : g_new0 (char *, 1);
-
- /*remove empty entries and whitespace */
- for (i = 0, j = 0; priv->supported_protocols[j]; j++) {
- g_strstrip (priv->supported_protocols[j]);
- if (priv->supported_protocols[j][0] == '\0')
- g_free (priv->supported_protocols[j]);
- else
- priv->supported_protocols[i++] = priv->supported_protocols[j];
- }
- priv->supported_protocols[i] = NULL;
+ const char *supported_protocols = nm_vpn_plugin_info_lookup_property (plugin_info,
"openconnect", "supported-protocols");
+
+ priv->supported_protocols = supported_protocols
+ ? g_strsplit_set (supported_protocols, ",", -1)
+ : g_new0 (char *, 1);
+
+ /*remove empty entries and whitespace */
+ for (i = 0, j = 0; priv->supported_protocols[j]; j++) {
+ g_strstrip (priv->supported_protocols[j]);
+ if (priv->supported_protocols[j][0] == '\0')
+ g_free (priv->supported_protocols[j]);
+ else
+ priv->supported_protocols[i++] = priv->supported_protocols[j];
+ }
+ priv->supported_protocols[i] = NULL;
#endif
+ }
}
static char **
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]