NetworkManager/shared
Thomas Haller 84a6eff106 shared: don't allow aliases re-numbering in _nm_utils_enum_from_str_full()
For _nm_utils_enum_to_str_full(), we always first look whether we have
an alias/nick for the numeric value, and preferably use that. That makes a
lot of sense, as it allows the caller to provide better names (aliases),
which are preferred over the name from the GLib type. It renames the
numeric value.

For the reverse conversion, this makes less sense. A name should have a
unique numeric value. That is, we should not use one name that maps to
a different numeric value based on value_infos and GLib type. IOW, we
should not re-number names.

Add an assertion that we don't provide such a value_infos parameter,
that conflicts with names from GLib type.

Also, although the case where GLib type and value_infos disagree is now
forbidden by an assert, reorder the statements in _nm_utils_enum_from_str_full()
too. There is no difference in practice, but it mirros what we do in the
to-str case.
2018-05-29 16:28:09 +02:00
..
c-list Merge commit 'afe2594a7799d3113470c40664c6eda88b83c7e5' as 'shared/c-list' 2018-04-18 15:20:40 +02:00
c-siphash Merge commit '1ea09eb549dbd910ea593e01fb6f746ae20b4beb' as 'shared/c-siphash' 2018-04-18 15:20:01 +02:00
n-acd n-acd: better handle interfaces going temporarily down 2018-05-29 11:18:30 +02:00
nm-utils shared: don't allow aliases re-numbering in _nm_utils_enum_from_str_full() 2018-05-29 16:28:09 +02:00
meson.build build: meson: link NM against n-acd 2018-04-18 15:22:18 +02:00
nm-common-macros.h manager: add connectivity-check-{available,enabled} properties. 2017-08-17 22:31:47 +02:00
nm-dbus-compat.h build: rename directory "include" to "shared" 2015-12-24 11:42:37 +01:00
nm-default.h shared: don't validate type-string in G_VARIANT_TYPE() cast macro in production code 2018-03-12 17:44:35 +01:00
nm-dispatcher-api.h build: cleanup src/Makefile.am 2016-08-11 11:54:18 +02:00
nm-meta-setting.c clients: add tc qdisc support 2017-12-11 10:52:23 +01:00
nm-meta-setting.h clients: add tc qdisc support 2017-12-11 10:52:23 +01:00
nm-test-libnm-utils.h tests: use libnm via pygobject in tools/test-networkmanager-service.py 2018-05-11 16:51:20 +02:00
nm-test-utils-impl.c tests: use libnm via pygobject in tools/test-networkmanager-service.py 2018-05-11 16:51:20 +02:00
nm-version-macros.h.in version: rename macro NM_VERSION_CUR_STABLE to NM_API_VERSION 2018-01-23 10:54:11 +01:00