Commit graph

7 commits

Author SHA1 Message Date
Thomas Haller
6d2a1edc38 macros: use short-circuit evaluation in NM_IN_SET()
All current users of NM_IN_SET() would rather use short-circuit evalation
(or don't care). It seems that doing it by default seems favorable.

The only downside is, that this might have somewhat unexpected behavior
to a user who expects a regular function (which would evaluate always
all arguments).

Fixes: 7860ef959a
(cherry picked from commit 96cacc07e8)
2015-08-12 16:07:22 +02:00
Thomas Haller
69b276d6d1 macros: rework NM_IN_SET() macro to expand to a plain logical expression
Let the preprocessor do more work, but generate a simple expression that
the compiler can optimize (presumably) better.

(cherry picked from commit 7860ef959a)
2015-08-12 16:07:02 +02:00
Thomas Haller
fa0f53b07b macros: add nm_strstrip() util
(cherry picked from commit d6a331bd8c)
2015-07-03 09:24:02 +02:00
Thomas Haller
a51d2d6149 macros: add NM_PRINT_FMT_QUOTED() macro
(cherry picked from commit 972f61fcd7)
2015-06-22 09:56:05 +02:00
Thomas Haller
5daac57a23 utils: add nm_utils_is_power_of_two() macro
(cherry picked from commit 0a3c1f5774)
2015-06-21 15:30:47 +02:00
Thomas Haller
baf5f63374 utils: add NM_FLAGS_SET(), NM_FLAGS_UNSET() and NM_FLAGS_ASSIGN() macros
(cherry picked from commit 57958b93b6)
2015-06-19 12:26:02 +02:00
Thomas Haller
1d3c143948 build: rename file "include/nm-utils-internal.h" to "nm-macros-internal.h"
We already have "nm-utils*.h" and "NetworkManagerUtils.h" headers. Rename
"include/nm-utils-internal.h" to "nm-macros-internal.h". I think that
name is better, because this file is header-only, internal, and
repository-wide.

Also, it will never contain non-header-only declarations because
there is no backing object file under "include/".
It will only contain macros and inline functions.

(cherry picked from commit b8b1a01d96)
2015-06-19 12:21:58 +02:00
Renamed from include/nm-utils-internal.h (Browse further)