mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-02 15:30:33 +01:00
build: merge branch 'th/build-warn-wextra'
(cherry picked from commit 029784b1cc)
This commit is contained in:
commit
64242f5e6a
9 changed files with 39 additions and 87 deletions
|
|
@ -21,10 +21,10 @@
|
|||
|
||||
#include <NetworkManager.h>
|
||||
|
||||
struct {
|
||||
typedef struct {
|
||||
const char *name;
|
||||
const char *ui_name;
|
||||
} typedef VpnPasswordName;
|
||||
} VpnPasswordName;
|
||||
|
||||
GSList *nm_vpn_get_plugin_infos (void);
|
||||
|
||||
|
|
|
|||
|
|
@ -499,7 +499,7 @@ _nm_setting_bond_mode_from_string (const char *str)
|
|||
|
||||
#define BIT(x) (1 << (x))
|
||||
|
||||
const static struct {
|
||||
static const struct {
|
||||
const char *option;
|
||||
NMBondMode unsupp_modes;
|
||||
} bond_unsupp_modes[] = {
|
||||
|
|
|
|||
|
|
@ -115,33 +115,6 @@ nm_setting_bridge_port_get_hairpin_mode (NMSettingBridgePort *setting)
|
|||
static gboolean
|
||||
verify (NMSetting *setting, NMConnection *connection, GError **error)
|
||||
{
|
||||
NMSettingBridgePortPrivate *priv = NM_SETTING_BRIDGE_PORT_GET_PRIVATE (setting);
|
||||
|
||||
if (priv->priority > BR_MAX_PORT_PRIORITY) {
|
||||
g_set_error (error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("'%d' is not a valid value for the property (should be <= %d)"),
|
||||
priv->priority, BR_MAX_PORT_PRIORITY);
|
||||
g_prefix_error (error, "%s.%s: ",
|
||||
NM_SETTING_BRIDGE_PORT_SETTING_NAME,
|
||||
NM_SETTING_BRIDGE_PORT_PRIORITY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (priv->path_cost > BR_MAX_PATH_COST) {
|
||||
g_set_error (error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("'%d' is not a valid value for the property (should be <= %d)"),
|
||||
priv->path_cost, BR_MAX_PATH_COST);
|
||||
g_prefix_error (error, "%s.%s: ",
|
||||
NM_SETTING_BRIDGE_PORT_SETTING_NAME,
|
||||
NM_SETTING_BRIDGE_PORT_PATH_COST);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (connection) {
|
||||
NMSettingConnection *s_con;
|
||||
const char *slave_type;
|
||||
|
|
@ -202,10 +175,10 @@ set_property (GObject *object, guint prop_id,
|
|||
|
||||
switch (prop_id) {
|
||||
case PROP_PRIORITY:
|
||||
priv->priority = (guint16) (g_value_get_uint (value) & 0xFFFF);
|
||||
priv->priority = g_value_get_uint (value);
|
||||
break;
|
||||
case PROP_PATH_COST:
|
||||
priv->path_cost = (guint16) (g_value_get_uint (value) & 0xFFFF);
|
||||
priv->path_cost = g_value_get_uint (value);
|
||||
break;
|
||||
case PROP_HAIRPIN_MODE:
|
||||
priv->hairpin_mode = g_value_get_boolean (value);
|
||||
|
|
|
|||
|
|
@ -145,32 +145,6 @@ nm_setting_bridge_port_get_hairpin_mode (NMSettingBridgePort *setting)
|
|||
static gboolean
|
||||
verify (NMSetting *setting, GSList *all_settings, GError **error)
|
||||
{
|
||||
NMSettingBridgePortPrivate *priv = NM_SETTING_BRIDGE_PORT_GET_PRIVATE (setting);
|
||||
|
||||
if (priv->priority > BR_MAX_PORT_PRIORITY) {
|
||||
g_set_error (error,
|
||||
NM_SETTING_BRIDGE_PORT_ERROR,
|
||||
NM_SETTING_BRIDGE_PORT_ERROR_INVALID_PROPERTY,
|
||||
_("'%d' is not a valid value for the property (should be <= %d)"),
|
||||
priv->priority, BR_MAX_PORT_PRIORITY);
|
||||
g_prefix_error (error, "%s.%s: ",
|
||||
NM_SETTING_BRIDGE_PORT_SETTING_NAME,
|
||||
NM_SETTING_BRIDGE_PORT_PRIORITY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (priv->path_cost > BR_MAX_PATH_COST) {
|
||||
g_set_error (error,
|
||||
NM_SETTING_BRIDGE_PORT_ERROR,
|
||||
NM_SETTING_BRIDGE_PORT_ERROR_INVALID_PROPERTY,
|
||||
_("'%d' is not a valid value for the property (should be <= %d)"),
|
||||
priv->path_cost, BR_MAX_PATH_COST);
|
||||
g_prefix_error (error, "%s.%s: ",
|
||||
NM_SETTING_BRIDGE_PORT_SETTING_NAME,
|
||||
NM_SETTING_BRIDGE_PORT_PATH_COST);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -204,10 +178,10 @@ set_property (GObject *object, guint prop_id,
|
|||
|
||||
switch (prop_id) {
|
||||
case PROP_PRIORITY:
|
||||
priv->priority = (guint16) (g_value_get_uint (value) & 0xFFFF);
|
||||
priv->priority = g_value_get_uint (value);
|
||||
break;
|
||||
case PROP_PATH_COST:
|
||||
priv->path_cost = (guint16) (g_value_get_uint (value) & 0xFFFF);
|
||||
priv->path_cost = g_value_get_uint (value);
|
||||
break;
|
||||
case PROP_HAIRPIN_MODE:
|
||||
priv->hairpin_mode = g_value_get_boolean (value);
|
||||
|
|
|
|||
|
|
@ -62,27 +62,29 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
|
|||
fi
|
||||
|
||||
for option in \
|
||||
-Wimplicit-fallthrough \
|
||||
-Wshadow \
|
||||
-Wmissing-declarations \
|
||||
-Wmissing-prototypes \
|
||||
-Wextra \
|
||||
-Wdeclaration-after-statement \
|
||||
-Wformat-security \
|
||||
-Wfloat-equal \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-sign-compare \
|
||||
-Wno-duplicate-decl-specifier \
|
||||
-Wstrict-prototypes \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-format-y2k \
|
||||
-Wundef \
|
||||
-Wimplicit-function-declaration \
|
||||
-Wpointer-arith \
|
||||
-Winit-self \
|
||||
-Wformat-nonliteral \
|
||||
-Wformat-security \
|
||||
-Wimplicit-fallthrough \
|
||||
-Wimplicit-function-declaration \
|
||||
-Winit-self \
|
||||
-Wmissing-declarations \
|
||||
-Wmissing-include-dirs \
|
||||
-Wno-pragmas \
|
||||
-Wmissing-prototypes \
|
||||
-Wpointer-arith \
|
||||
-Wshadow \
|
||||
-Wstrict-prototypes \
|
||||
-Wundef \
|
||||
-Wno-duplicate-decl-specifier \
|
||||
-Wno-format-truncation \
|
||||
-Wno-format-y2k \
|
||||
-Wno-missing-field-initializers \
|
||||
-Wno-pragmas \
|
||||
-Wno-sign-compare \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-unused-parameter \
|
||||
; do
|
||||
dnl GCC 4.4 does not warn when checking for -Wno-* flags (https://gcc.gnu.org/wiki/FAQ#wnowarning)
|
||||
_NM_COMPILER_FLAG([$(printf '%s' "$option" | sed 's/^-Wno-/-W/')], [],
|
||||
|
|
|
|||
|
|
@ -134,14 +134,17 @@ __g_type_ensure (GType type)
|
|||
|
||||
/* Rumtime check for glib version. First do a compile time check which
|
||||
* (if satisfied) shortcuts the runtime check. */
|
||||
#define nm_glib_check_version(major, minor, micro) \
|
||||
( GLIB_CHECK_VERSION ((major), (minor), (micro)) \
|
||||
|| ( ( glib_major_version > (major)) \
|
||||
|| ( glib_major_version == (major) \
|
||||
&& glib_minor_version > (minor)) \
|
||||
|| ( glib_major_version == (major) \
|
||||
&& glib_minor_version == (minor) \
|
||||
&& glib_micro_version >= (micro))))
|
||||
inline static gboolean
|
||||
nm_glib_check_version (guint major, guint minor, guint micro)
|
||||
{
|
||||
return GLIB_CHECK_VERSION (major, minor, micro)
|
||||
|| ( ( glib_major_version > major)
|
||||
|| ( glib_major_version == major
|
||||
&& glib_minor_version > minor)
|
||||
|| ( glib_major_version == major
|
||||
&& glib_minor_version == minor
|
||||
&& glib_micro_version < micro));
|
||||
}
|
||||
|
||||
/* g_test_skip() is only available since glib 2.38. Add a compatibility wrapper. */
|
||||
inline static void
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ nm_config_data_get_connectivity_uri (const NMConfigData *self)
|
|||
return NM_CONFIG_DATA_GET_PRIVATE (self)->connectivity.uri;
|
||||
}
|
||||
|
||||
const guint
|
||||
guint
|
||||
nm_config_data_get_connectivity_interval (const NMConfigData *self)
|
||||
{
|
||||
g_return_val_if_fail (self, 0);
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ gint nm_config_data_get_value_boolean (const NMConfigData *self, const char *gro
|
|||
|
||||
char **nm_config_data_get_plugins (const NMConfigData *config_data, gboolean allow_default);
|
||||
const char *nm_config_data_get_connectivity_uri (const NMConfigData *config_data);
|
||||
const guint nm_config_data_get_connectivity_interval (const NMConfigData *config_data);
|
||||
guint nm_config_data_get_connectivity_interval (const NMConfigData *config_data);
|
||||
const char *nm_config_data_get_connectivity_response (const NMConfigData *config_data);
|
||||
|
||||
const char *const*nm_config_data_get_no_auto_default (const NMConfigData *config_data);
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ killswitch_find_by_name (NMRfkillManager *self, const char *name)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static const RfKillType
|
||||
static RfKillType
|
||||
rfkill_type_to_enum (const char *str)
|
||||
{
|
||||
g_return_val_if_fail (str != NULL, RFKILL_TYPE_UNKNOWN);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue