Skip to content
  • Thomas Haller's avatar
    libnm: use macro and designated initializers for NMVariantAttributeSpec · ecc62e01
    Thomas Haller authored and Lubomir Rintel's avatar Lubomir Rintel committed
    I think initializing structs should (almost) be always done with designated
    initializers, because otherwise it's easy to get the order wrong. The
    problem is that otherwise the order of fields gets additional meaning
    not only for the memory layout, but also for the code that initialize
    the structs.
    
    Add a macro NM_VARIANT_ATTRIBUTE_SPEC_DEFINE() that replaces the other
    (duplicate) macros. This macro also gets it right to mark the struct as
    const.
    
    (cherry picked from commit 86dc50d4)
    ecc62e01