all: use NM_MIN_CONST()/NM_MAX_CONST() instead of MIN()/MAX()

glib's MIN()/MAX() will be replaced by NM_MIN()/NM_MAX().
There are however a few places where NM_MIN()/NM_MAX() cannot
be used.

Adjust those places to use NM_MIN_CONST()/NM_MAX_CONST() instead.
This commit is contained in:
Thomas Haller 2023-10-27 14:33:13 +02:00
parent fa500e5540
commit 5acd30ca44
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
4 changed files with 5 additions and 4 deletions

View file

@ -48,7 +48,8 @@ typedef enum {
NM_TEAM_ATTRIBUTE_PORT_LACP_KEY,
_NM_TEAM_ATTRIBUTE_PORT_NUM,
_NM_TEAM_ATTRIBUTE_NUM = MAX(_NM_TEAM_ATTRIBUTE_MASTER_NUM, _NM_TEAM_ATTRIBUTE_PORT_NUM),
_NM_TEAM_ATTRIBUTE_NUM =
NM_MAX_CONST(_NM_TEAM_ATTRIBUTE_MASTER_NUM, _NM_TEAM_ATTRIBUTE_PORT_NUM),
} NMTeamAttribute;

View file

@ -37,7 +37,7 @@ typedef enum _NMDedupMultiIdxMode {
/*****************************************************************************/
#define _NMDedupMultiObj_Align (MAX(_nm_alignof(void *), _nm_alignof(gint64)))
#define _NMDedupMultiObj_Align (NM_MAX_CONST(_nm_alignof(void *), _nm_alignof(gint64)))
struct _NMDedupMultiObj {
union {

View file

@ -163,7 +163,7 @@ typedef enum _nm_packed {
G_STATIC_ASSERT(RTA_MAX == (__RTA_MAX - 1));
#define RTA_PREF 20
#undef RTA_MAX
#define RTA_MAX (MAX((__RTA_MAX - 1), RTA_PREF))
#define RTA_MAX (NM_MAX_CONST((__RTA_MAX - 1), RTA_PREF))
#ifndef MACVLAN_FLAG_NOPROMISC
#define MACVLAN_FLAG_NOPROMISC 1

View file

@ -17,7 +17,7 @@
* also "packed" is specified. That's what we want.
* https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#Common-Type-Attributes.
*/
#define _NMPlatformObject_Align (MAX(_nm_alignof(void *), _nm_alignof(gint64)))
#define _NMPlatformObject_Align (NM_MAX_CONST(_nm_alignof(void *), _nm_alignof(gint64)))
struct _NMPlatformObject {
/* the object type has no fields of its own, it is only used to having