Skip to content

Commit

Permalink
Make CompareGuid more clearly defined
Browse files Browse the repository at this point in the history
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
  • Loading branch information
gmbr3 committed Dec 31, 2024
1 parent 4e230fc commit da93e09
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/runtime/efirtlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ RtCompareMem (
return 0;
}


typedef UINT32 UINT32_BY_FOUR[4];

#ifndef __GNUC__
#pragma RUNTIME_CODE(RtCompareGuid)
#endif
Expand All @@ -163,20 +166,23 @@ Routine Description:
--*/
{
UINT32 *g1, *g2, r;
CONST UINT32_BY_FOUR *g1, *g2;
UINT32 r;

//
// Compare 32 bits at a time
//

g1 = (UINT32*)Guid1;
g2 = (UINT32*)Guid2;
g1 = (CONST UINT32_BY_FOUR*)Guid1;
g2 = (CONST UINT32_BY_FOUR*)Guid2;

r = g1[0] - g2[0];
r |= g1[1] - g2[1];
r |= g1[2] - g2[2];
r |= g1[3] - g2[3];

r = g1[3]; /* die?? */

if (r==0) {
return 1;
} else {
Expand Down

0 comments on commit da93e09

Please sign in to comment.