Commit 79ac03f0 authored by Slava Monich's avatar Slava Monich

[connman] Housekeeping

Fixed compilation warnings with -Wsign-compare
parent dfb37271
/*
*
* Connection Manager wrapper implementation of the exposed iptables
* functions
* for SailfishOS MDM. Contains save, restore and clear functionality.
* functions for SailfishOS MDM. Contains save, restore and clear
* functionality.
*
* Copyright (C) 2017-2018 Jolla Ltd. All rights reserved.
* Contact: Jussi Laakkonen <jussi.laakkonen@jolla.com>
......@@ -874,7 +874,8 @@ out:
static int iptables_parse_policy(const gchar* table_name, const gchar* policy)
{
gint rval = 1, policy_tokens = 3;
gint rval = 1;
guint policy_tokens = 3;
if (!table_name || !(*table_name) || !policy || !(*policy))
return rval;
......
......@@ -776,7 +776,7 @@ void test_iptables_stdout_capture()
g_assert(!error);
g_assert(data.stdout_bytes_read);
g_assert(data.stdout_bytes_read == strlen(testprint));
g_assert(data.stdout_bytes_read == (int)strlen(testprint));
g_assert(data.stdout_pipes[0] == -1);
g_assert(data.stdout_pipes[1] == -1);
g_assert(data.stdout_saved == -1);
......
......@@ -89,7 +89,7 @@ void test_vpn_settings_no_config()
gchar* test_path = setup_test_directory();
gchar* file_path = g_strdup_printf("%s%s", test_path, "/connman-vpn.conf");
mode_t dir_p = 0700, file_p = 0600, umask = 0077;
gint timeout = 300 * 1000;
guint timeout = 300 * 1000;
__vpn_settings_init(file_path);
......@@ -123,7 +123,7 @@ void test_vpn_settings_empty_config()
gchar* test_path = setup_test_directory();
gchar* file_path = g_strdup_printf("%s%s", test_path, "/connman-vpn.conf");
mode_t dir_p = 0700, file_p = 0600, umask = 0077;
gint timeout = 300 * 1000;
guint timeout = 300 * 1000;
set_and_verify_content(file_path, NULL);
......@@ -259,7 +259,7 @@ void test_vpn_settings_min_config()
const gchar const * group_verify[] = {"inet", "net_admin", "net_raw", NULL};
mode_t dir_p = 0700, file_p = 0600, umask = 0077;
gint i = 0;
gint timeout = 200 * 1000;
guint timeout = 200 * 1000;
set_and_verify_content(file_path, content_min);
......@@ -320,7 +320,7 @@ void test_vpn_settings_full_config()
const gchar const * group_verify[] = {"inet", "net_admin", NULL};
mode_t dir_p = 0754, file_p = 0645, umask = 0067;
gint i = 0;
gint timeout = 100 * 1000;
guint timeout = 100 * 1000;
set_and_verify_content(file_path, content_full);
......
......@@ -137,15 +137,15 @@ char *__vpn_settings_get_string(GKeyFile *config, const char *group,
char **__vpn_settings_get_string_list(GKeyFile *config, const char *group,
const char *key)
{
int i = 0;
gsize len = 0;
char **str = g_key_file_get_string_list(config, group, key, &len, NULL);
if (str)
{
for (i = 0; i < len ; i++)
if (str) {
guint i = 0;
for (i = 0; i < len ; i++) {
str[i] = g_strstrip(str[i]);
}
}
return str;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment