• Thomas Haller's avatar
    shared: don't allow aliases re-numbering in _nm_utils_enum_from_str_full() · 84a6eff1
    Thomas Haller authored
    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.
    84a6eff1
Name
Last commit
Last update
clients Loading commit data...
contrib Loading commit data...
data Loading commit data...
dispatcher Loading commit data...
docs Loading commit data...
examples Loading commit data...
introspection Loading commit data...
libnm Loading commit data...
libnm-core Loading commit data...
libnm-glib Loading commit data...
libnm-util Loading commit data...
m4 Loading commit data...
man Loading commit data...
po Loading commit data...
shared Loading commit data...
src Loading commit data...
tools Loading commit data...
vapi Loading commit data...
.dir-locals.el Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
MAINTAINERS Loading commit data...
Makefile.am Loading commit data...
Makefile.examples Loading commit data...
Makefile.glib Loading commit data...
Makefile.vapigen Loading commit data...
NEWS Loading commit data...
NetworkManager.pc.in Loading commit data...
README Loading commit data...
TODO Loading commit data...
autogen.sh Loading commit data...
config.h.meson Loading commit data...
configure.ac Loading commit data...
linker-script-binary.ver Loading commit data...
linker-script-devices.ver Loading commit data...
linker-script-settings.ver Loading commit data...
meson.build Loading commit data...
meson_options.txt Loading commit data...
meson_post_install.py Loading commit data...
valgrind.suppressions Loading commit data...
zanata.xml Loading commit data...