From da93e09806bfac7aee643b2c8bccd47894ced41e Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Mon, 30 Dec 2024 23:54:45 +0000 Subject: [PATCH] Make CompareGuid more clearly defined Signed-off-by: Callum Farmer --- lib/runtime/efirtlib.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/runtime/efirtlib.c b/lib/runtime/efirtlib.c index b574f55..bf60627 100644 --- a/lib/runtime/efirtlib.c +++ b/lib/runtime/efirtlib.c @@ -137,6 +137,9 @@ RtCompareMem ( return 0; } + +typedef UINT32 UINT32_BY_FOUR[4]; + #ifndef __GNUC__ #pragma RUNTIME_CODE(RtCompareGuid) #endif @@ -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 {