<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/shared/nm-utils, branch lr/api-docs</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>shared: trigger -Wenum-conversion warning in NM_IN_SET*() macros</title>
<updated>2017-03-16T17:27:33+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-14T14:42:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=c59532ee40419e4ed7d31f1d1edbaa6bc3c2278e'/>
<id>c59532ee40419e4ed7d31f1d1edbaa6bc3c2278e</id>
<content type='text'>
and add NM_IN_SET*_TYPED() macros, which allow to explicitly select
the type of "x".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
and add NM_IN_SET*_TYPED() macros, which allow to explicitly select
the type of "x".
</pre>
</div>
</content>
</entry>
<entry>
<title>shared/trivial: minor style fixes in "nm-utils/nm-macros-internal.h"</title>
<updated>2017-03-16T11:09:22+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-16T11:09:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=c2dc1c6fa3660d2a4e2500f96ce945cd02efdcb6'/>
<id>c2dc1c6fa3660d2a4e2500f96ce945cd02efdcb6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>all: use "static inline" instead of "inline static"</title>
<updated>2017-03-14T10:23:46+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-14T10:20:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=e207e534507da134ac4a9725a0e58e87a6093835'/>
<id>e207e534507da134ac4a9725a0e58e87a6093835</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>shared: add _NM_GET_PRIVATE_VOID() macro</title>
<updated>2017-03-10T10:06:02+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-03-10T09:49:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=7d88bd24f3018d337cf9dc07f341de755a9c095e'/>
<id>7d88bd24f3018d337cf9dc07f341de755a9c095e</id>
<content type='text'>
_NM_GET_PRIVATE() macro is used to implement a standard private-getter, but it
requires that "self" is a pointer of either "const type *" or "type *". That
is great in most cases, but sometimes we have predominatly self pointers of
different type, so it would require a lot of casts.

Add a different form _NM_GET_PRIVATE_VOID() where self pointer can be any
non-const pointer and returns a non-const private pointer after casting.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
_NM_GET_PRIVATE() macro is used to implement a standard private-getter, but it
requires that "self" is a pointer of either "const type *" or "type *". That
is great in most cases, but sometimes we have predominatly self pointers of
different type, so it would require a lot of casts.

Add a different form _NM_GET_PRIVATE_VOID() where self pointer can be any
non-const pointer and returns a non-const private pointer after casting.
</pre>
</div>
</content>
</entry>
<entry>
<title>shared: add test utilities for IP routes</title>
<updated>2017-03-06T14:20:25+00:00</updated>
<author>
<name>Beniamino Galvani</name>
<email>bgalvani@redhat.com</email>
</author>
<published>2017-02-17T08:27:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=c55c6312330288c4b1b1afcbeef7ef99a7a95810'/>
<id>c55c6312330288c4b1b1afcbeef7ef99a7a95810</id>
<content type='text'>
Add utility functions to check the value of a route attribute.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add utility functions to check the value of a route attribute.
</pre>
</div>
</content>
</entry>
<entry>
<title>all: use "static inline" keywords instead of "inline static"</title>
<updated>2017-02-23T14:28:27+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-02-23T14:24:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=9a64168c871bdf00e7ff2ff67c6751aabdcc3910'/>
<id>9a64168c871bdf00e7ff2ff67c6751aabdcc3910</id>
<content type='text'>
Use a consistent order of "static inline". This seems the prefered
order in general, and we also use it more often already.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use a consistent order of "static inline". This seems the prefered
order in general, and we also use it more often already.
</pre>
</div>
</content>
</entry>
<entry>
<title>shared: cleanup nm_strquote_a() and nm_sprintf_bufa()</title>
<updated>2017-02-10T16:31:16+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-02-10T16:10:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=7e3b47deac5a637d51a768850ec4ce14d551ad3e'/>
<id>7e3b47deac5a637d51a768850ec4ce14d551ad3e</id>
<content type='text'>
- simplify nm_strquote_a().

- use '"' for quoting instad of '\''.

- have nm_sprintf_bufa() evalute @n_elements only once.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- simplify nm_strquote_a().

- use '"' for quoting instad of '\''.

- have nm_sprintf_bufa() evalute @n_elements only once.
</pre>
</div>
</content>
</entry>
<entry>
<title>all: use NM_CACHED_QUARK_FCN() instead of G_DEFINE_QUARK()</title>
<updated>2017-02-10T13:33:52+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-02-02T20:47:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=7d6b8bab70d5d347652db0a7b567b61658b1d29d'/>
<id>7d6b8bab70d5d347652db0a7b567b61658b1d29d</id>
<content type='text'>
I think NM_CACHED_QUARK_FCN() is better because:

- the implementation is in our hand, meaning it is clear that
  putting a "static" before NM_CACHED_QUARK_FCN() is guaranteed to
  work -- without relying on G_DEFINE_QUARK() to be defined in a way
  that this works (in fact, we currently never do that and instead
  make all functions non-static).
- it does not construct function names by appending "_quark".
  Thus you can grep for the entire function name and finding
  the place where it is implemented.
- same with the stings, where the new macro doesn't stringify the
  argument, which is less surpising. Again, now you can grep
  for the string including the double quoting.

(yes, I really use grep to understand the source-code)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I think NM_CACHED_QUARK_FCN() is better because:

- the implementation is in our hand, meaning it is clear that
  putting a "static" before NM_CACHED_QUARK_FCN() is guaranteed to
  work -- without relying on G_DEFINE_QUARK() to be defined in a way
  that this works (in fact, we currently never do that and instead
  make all functions non-static).
- it does not construct function names by appending "_quark".
  Thus you can grep for the entire function name and finding
  the place where it is implemented.
- same with the stings, where the new macro doesn't stringify the
  argument, which is less surpising. Again, now you can grep
  for the string including the double quoting.

(yes, I really use grep to understand the source-code)
</pre>
</div>
</content>
</entry>
<entry>
<title>shared: add NM_CACHED_QUARK() and NM_CACHED_QUARK_FCN() macros</title>
<updated>2017-02-10T13:33:52+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-02-02T18:03:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=23040d68fc02f826c13533c1cd2dcf233ca341ec'/>
<id>23040d68fc02f826c13533c1cd2dcf233ca341ec</id>
<content type='text'>
NM_CACHED_QUARK_FCN() is a replacement for G_DEFINE_QUARK().
G_DEFINE_QUARK() is mostly used to define GError quarks. As
such, it always appends _quark() to the function name, which
is unfavorable because it makes it harder to grep for the
definition of the function.

In general I think that macros that defined symbols by concatenating
something should be avoided because that makes it harder to locate
where the symbol was defined.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
NM_CACHED_QUARK_FCN() is a replacement for G_DEFINE_QUARK().
G_DEFINE_QUARK() is mostly used to define GError quarks. As
such, it always appends _quark() to the function name, which
is unfavorable because it makes it harder to grep for the
definition of the function.

In general I think that macros that defined symbols by concatenating
something should be avoided because that makes it harder to locate
where the symbol was defined.
</pre>
</div>
</content>
</entry>
<entry>
<title>shared: fix -Wtype-limits warning in nm_glib_check_version() macro</title>
<updated>2017-02-06T18:27:21+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2017-02-06T17:58:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=1a190b9038ca6d01c6e92887cfad8d3bb45f1823'/>
<id>1a190b9038ca6d01c6e92887cfad8d3bb45f1823</id>
<content type='text'>
Fix it by converting the macro to an inline function. It's anyway
nicer.

    $ make src/src_libNetworkManagerBase_la-main-utils.lo
      CC       src/src_libNetworkManagerBase_la-main-utils.lo
    In file included from ./shared/nm-utils/nm-macros-internal.h:29:0,
                     from ./shared/nm-default.h:178,
                     from src/main-utils.c:22:
    src/main-utils.c: In function ‘nm_main_utils_setup_signals’:
    ./shared/nm-utils/nm-glib.h:144:36: error: comparison of unsigned expression &gt;= 0 is always true [-Werror=type-limits]
                  &amp;&amp; glib_micro_version &gt;= (micro))))
                                        ^
    src/main-utils.c:82:6: note: in expansion of macro ‘nm_glib_check_version’
      if (nm_glib_check_version (2, 36, 0)) {
          ^~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    Makefile:12312: recipe for target 'src/src_libNetworkManagerBase_la-main-utils.lo' failed
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix it by converting the macro to an inline function. It's anyway
nicer.

    $ make src/src_libNetworkManagerBase_la-main-utils.lo
      CC       src/src_libNetworkManagerBase_la-main-utils.lo
    In file included from ./shared/nm-utils/nm-macros-internal.h:29:0,
                     from ./shared/nm-default.h:178,
                     from src/main-utils.c:22:
    src/main-utils.c: In function ‘nm_main_utils_setup_signals’:
    ./shared/nm-utils/nm-glib.h:144:36: error: comparison of unsigned expression &gt;= 0 is always true [-Werror=type-limits]
                  &amp;&amp; glib_micro_version &gt;= (micro))))
                                        ^
    src/main-utils.c:82:6: note: in expansion of macro ‘nm_glib_check_version’
      if (nm_glib_check_version (2, 36, 0)) {
          ^~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    Makefile:12312: recipe for target 'src/src_libNetworkManagerBase_la-main-utils.lo' failed
</pre>
</div>
</content>
</entry>
</feed>
