소스 검색

Fix a sign error in the debughook example app

On ISO C90 on i386 4294967294 is a signed integer, and so x can't be
greater (or equal) to that.  Make it an unsigned and choose a better type
for the variable.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Peter Jones 7 년 전
부모
커밋
25cebcee2a
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      apps/debughook.c

+ 2 - 2
apps/debughook.c

@@ -50,7 +50,7 @@ DebugHook(void)
 	UINT8 *data = NULL;
 	UINTN dataSize = 0;
 	EFI_STATUS efi_status;
-	register volatile UINTN x = 0;
+	register volatile unsigned long long x = 0;
 	extern char _text, _data;
 
 	if (x)
@@ -71,7 +71,7 @@ DebugHook(void)
 	while (x++) {
 		/* Make this so it can't /totally/ DoS us. */
 #if defined(__x86_64__) || defined(__i386__) || defined(__i686__)
-		if (x > 4294967294)
+		if (x > 4294967294ULL)
 			break;
 		__asm__ __volatile__("pause");
 #elif defined(__aarch64__)