bbc6a8
From fa42786264cef98c56e972b3bb6b8448000e1c70 Mon Sep 17 00:00:00 2001
bbc6a8
From: Pete Batard <pete@akeo.ie>
bbc6a8
Date: Thu, 3 Aug 2017 15:46:15 +0100
31cddd
Subject: [PATCH] zfs: remove size_t typedef and use grub_size_t instead
bbc6a8
bbc6a8
* Prevents some toolchains from issuing a warning on size_t redef.
bbc6a8
---
bbc6a8
 grub-core/fs/zfs/zfs_lz4.c | 11 +++++------
bbc6a8
 1 file changed, 5 insertions(+), 6 deletions(-)
bbc6a8
bbc6a8
diff --git a/grub-core/fs/zfs/zfs_lz4.c b/grub-core/fs/zfs/zfs_lz4.c
ec4acb
index 2f73449f0d4..5453822d025 100644
bbc6a8
--- a/grub-core/fs/zfs/zfs_lz4.c
bbc6a8
+++ b/grub-core/fs/zfs/zfs_lz4.c
bbc6a8
@@ -73,7 +73,6 @@ static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest,
bbc6a8
 #define	U32	grub_uint32_t
bbc6a8
 #define	S32	grub_int32_t
bbc6a8
 #define	U64	grub_uint64_t
bbc6a8
-typedef grub_size_t size_t;
bbc6a8
 
bbc6a8
 typedef struct _U16_S {
bbc6a8
 	U16 v;
bbc6a8
@@ -133,10 +132,10 @@ typedef struct _U64_S {
bbc6a8
 
bbc6a8
 /* Decompression functions */
bbc6a8
 grub_err_t
bbc6a8
-lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len);
bbc6a8
+lz4_decompress(void *s_start, void *d_start, grub_size_t s_len, grub_size_t d_len);
bbc6a8
 
bbc6a8
 grub_err_t
bbc6a8
-lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len)
bbc6a8
+lz4_decompress(void *s_start, void *d_start, grub_size_t s_len, grub_size_t d_len)
bbc6a8
 {
bbc6a8
 	const BYTE *src = s_start;
bbc6a8
 	U32 bufsiz = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) |
bbc6a8
@@ -167,7 +166,7 @@ LZ4_uncompress_unknownOutputSize(const char *source,
bbc6a8
 	BYTE *const oend = op + maxOutputSize;
bbc6a8
 	BYTE *cpy;
bbc6a8
 
bbc6a8
-	size_t dec[] = { 0, 3, 2, 3, 0, 0, 0, 0 };
bbc6a8
+	grub_size_t dec[] = { 0, 3, 2, 3, 0, 0, 0, 0 };
bbc6a8
 
bbc6a8
 	/* Main Loop */
bbc6a8
 	while (ip < iend) {
bbc6a8
@@ -237,8 +236,8 @@ LZ4_uncompress_unknownOutputSize(const char *source,
bbc6a8
 		/* copy repeated sequence */
bbc6a8
 		if unlikely(op - ref < STEPSIZE) {
bbc6a8
 #if LZ4_ARCH64
bbc6a8
-			size_t dec2table[] = { 0, 0, 0, -1, 0, 1, 2, 3 };
bbc6a8
-			size_t dec2 = dec2table[op - ref];
bbc6a8
+			grub_size_t dec2table[] = { 0, 0, 0, -1, 0, 1, 2, 3 };
bbc6a8
+			grub_size_t dec2 = dec2table[op - ref];
bbc6a8
 #else
bbc6a8
 			const int dec2 = 0;
bbc6a8
 #endif