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