diff options
author | Thomas Haller <thaller@redhat.com> | 2020-03-23 08:04:33 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2020-03-26 21:28:56 +0100 |
commit | 6f9a478b7ded9f767e6f421d582f189c08c33103 (patch) | |
tree | fcef2adc42641e66fea7d4b034ac283d05d7b674 /src/platform | |
parent | cec06138f173d0dd969dba5acdb3cde4a92884a4 (diff) | |
download | NetworkManager-6f9a478b7ded9f767e6f421d582f189c08c33103.tar.gz |
tests: replace NMTST_SWAP() by new NM_SWAP() macro
NMTST_SWAP() used memcpy() for copying the value, while NM_SWAP() uses
a temporary variable with typeof(). I think the latter is preferable.
Also, the macro is essentially doing the same thing.
Diffstat (limited to 'src/platform')
-rw-r--r-- | src/platform/tests/test-route.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/platform/tests/test-route.c b/src/platform/tests/test-route.c index 707313b4ca..f074ca69cf 100644 --- a/src/platform/tests/test-route.c +++ b/src/platform/tests/test-route.c @@ -1239,7 +1239,7 @@ again_uid_range: rr->uid_range.end = nmtst_rand_select (0u, uids.uid, uids.euid); if (rr->uid_range_has) { if (rr->uid_range.end < rr->uid_range.start) - NMTST_SWAP (rr->uid_range.start, rr->uid_range.end); + NM_SWAP (rr->uid_range.start, rr->uid_range.end); if ( rr->uid_range.start == ((guint32) -1) || rr->uid_range.end == ((guint32) -1)) goto again_uid_range; @@ -1259,7 +1259,7 @@ again_uid_range: range->start = nmtst_rand_select (1u, 0xFFFEu, ((p ) % 0xFFFEu) + 1); range->end = nmtst_rand_select (1u, 0xFFFEu, ((p >> 16) % 0xFFFEu) + 1, range->start); if (range->end < range->start) - NMTST_SWAP (range->start, range->end); + NM_SWAP (range->start, range->end); } } } |