Changeset 3887aab2 in mainline for uspace/lib/c/test/uuid.c


Ignore:
Timestamp:
2024-06-13T16:03:39Z (3 weeks ago)
Author:
jxsvoboda <5887334+jxsvoboda@…>
Branches:
master
Children:
c15296b
Parents:
0b1f01c
git-author:
Miroslav Cimerman <mc@…> (2024-06-12 21:08:14)
git-committer:
jxsvoboda <5887334+jxsvoboda@…> (2024-06-13 16:03:39)
Message:

Change internal UUID representation to named fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/test/uuid.c

    r0b1f01c r3887aab2  
    5050static bool uuid_valid(uuid_t uuid)
    5151{
    52         if (!(uuid.b[6] & 0x40)) {
     52        if (!((uuid.time_hi_and_version & 0xf000) & 0x4000)) {
    5353                return false;
    5454        }
    5555
    56         int f = (uuid.b[8] & 0x80) || (uuid.b[8] & 0x90);
    57         f = f || (uuid.b[8] & 0xA0) || (uuid.b[8] & 0xB0);
     56        int f = (uuid.clock_seq_hi_and_reserved & 0x80) || (uuid.clock_seq_hi_and_reserved & 0x90);
     57        f = f || (uuid.clock_seq_hi_and_reserved & 0xA0) || (uuid.clock_seq_hi_and_reserved & 0xB0);
    5858        if (!f) {
    5959                return false;
Note: See TracChangeset for help on using the changeset viewer.