mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
sd-id128: add helpers to check fo all-0xFF ids
This commit is contained in:
parent
463adf5710
commit
670814387b
4
NEWS
4
NEWS
@ -379,6 +379,10 @@ CHANGES WITH 240 in spe:
|
||||
interface names even as systemd/udev are updated and the naming logic
|
||||
is improved.
|
||||
|
||||
* sd-id128.h learnt two new auxiliary helpers: sd_id128_is_allf() and
|
||||
SD_ID128_ALLF to test if a 128bit ID is set to all 0xFF bytes, and to
|
||||
initialize one to all 0xFF.
|
||||
|
||||
Contributions from: afg, Alan Jenkins, Aleksei Timofeyev, Alexander
|
||||
Filippov, Alexander Kurtz, Alexey Bogdanenko, Andreas Henriksson,
|
||||
Andrew Jorgensen, Anita Zhang, apnix-uk, Arkan49, Arseny Maslennikov,
|
||||
|
@ -110,7 +110,12 @@ _sd_pure_ static __inline__ int sd_id128_is_null(sd_id128_t a) {
|
||||
return a.qwords[0] == 0 && a.qwords[1] == 0;
|
||||
}
|
||||
|
||||
_sd_pure_ static __inline__ int sd_id128_is_allf(sd_id128_t a) {
|
||||
return a.qwords[0] == UINT64_C(0xFFFFFFFFFFFFFFFF) && a.qwords[1] == UINT64_C(0xFFFFFFFFFFFFFFFF);
|
||||
}
|
||||
|
||||
#define SD_ID128_NULL ((const sd_id128_t) { .qwords = { 0, 0 }})
|
||||
#define SD_ID128_ALLF ((const sd_id128_t) { .qwords = { UINT64_C(0xFFFFFFFFFFFFFFFF), UINT64_C(0xFFFFFFFFFFFFFFFF) }})
|
||||
|
||||
_SD_END_DECLARATIONS;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user