summaryrefslogtreecommitdiff
path: root/src/platform
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-03-23 08:04:33 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2020-03-26 21:28:56 +0100
commit6f9a478b7ded9f767e6f421d582f189c08c33103 (patch)
treefcef2adc42641e66fea7d4b034ac283d05d7b674 /src/platform
parentcec06138f173d0dd969dba5acdb3cde4a92884a4 (diff)
downloadNetworkManager-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.c4
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);
}
}
}