cfe30e
From 25cebcee2ae0b92829841321220ec9837479c118 Mon Sep 17 00:00:00 2001
cfe30e
From: Peter Jones <pjones@redhat.com>
cfe30e
Date: Tue, 13 Mar 2018 15:20:24 -0400
cfe30e
Subject: [PATCH 14/25] Fix a sign error in the debughook example app
cfe30e
cfe30e
On ISO C90 on i386 4294967294 is a signed integer, and so x can't be
cfe30e
greater (or equal) to that.  Make it an unsigned and choose a better type
cfe30e
for the variable.
cfe30e
cfe30e
Signed-off-by: Peter Jones <pjones@redhat.com>
cfe30e
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
cfe30e
---
cfe30e
 apps/debughook.c | 4 ++--
cfe30e
 1 file changed, 2 insertions(+), 2 deletions(-)
cfe30e
cfe30e
diff --git a/apps/debughook.c b/apps/debughook.c
cfe30e
index 93cd0cf7eb0..78e4a767b1d 100644
cfe30e
--- a/apps/debughook.c
cfe30e
+++ b/apps/debughook.c
cfe30e
@@ -50,7 +50,7 @@ DebugHook(void)
cfe30e
 	UINT8 *data = NULL;
cfe30e
 	UINTN dataSize = 0;
cfe30e
 	EFI_STATUS efi_status;
cfe30e
-	register volatile UINTN x = 0;
cfe30e
+	register volatile unsigned long long x = 0;
cfe30e
 	extern char _text, _data;
cfe30e
 
cfe30e
 	if (x)
cfe30e
@@ -71,7 +71,7 @@ DebugHook(void)
cfe30e
 	while (x++) {
cfe30e
 		/* Make this so it can't /totally/ DoS us. */
cfe30e
 #if defined(__x86_64__) || defined(__i386__) || defined(__i686__)
cfe30e
-		if (x > 4294967294)
cfe30e
+		if (x > 4294967294ULL)
cfe30e
 			break;
cfe30e
 		__asm__ __volatile__("pause");
cfe30e
 #elif defined(__aarch64__)
cfe30e
-- 
cfe30e
2.15.0
cfe30e