From 557347fba65295c030ee7847cb36815b6a53ccc6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 15 Sep 2015 19:02:39 +0200 Subject: [PATCH] Revert rewind.c --- rewind.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/rewind.c b/rewind.c index 8d26730cd6..6cc28bd5b7 100644 --- a/rewind.c +++ b/rewind.c @@ -16,7 +16,6 @@ */ #define __STDC_LIMIT_MACROS -#include #include #include @@ -27,12 +26,12 @@ #include "rewind.h" #include "performance.h" -#ifndef UINT_FAST16_MAX -#define UINT_FAST16_MAX 0xffff +#ifndef UINT16_MAX +#define UINT16_MAX 0xffff #endif -#ifndef UINT_LEAST32_MAX -#define UINT_LEAST32_MAX 0xffffffffu +#ifndef UINT32_MAX +#define UINT32_MAX 0xffffffffu #endif #undef CPU_X86 @@ -68,7 +67,7 @@ size thisstart; size_t state_manager_raw_maxsize(size_t uncomp) { /* bytes covered by a compressed block */ - const int maxcblkcover = UINT_FAST16_MAX * sizeof(uint16_t); + const int maxcblkcover = UINT16_MAX * sizeof(uint16_t); /* uncompressed size, rounded to 16 bits */ size_t uncomp16 = (uncomp + sizeof(uint16_t) - 1) & ~sizeof(uint16_t); /* number of blocks */ @@ -246,13 +245,15 @@ size_t state_manager_raw_compress(const void *src, new16 += skip; num16s -= skip; - if (skip > UINT_FAST16_MAX) + if (skip > UINT16_MAX) { - /* This will make it scan the entire thing again, - * but it only hits on 8GB unchanged data anyways, - * and if you're doing that, you've got bigger problems. */ - if (skip > UINT_LEAST32_MAX) - skip = UINT_LEAST32_MAX; + if (skip > UINT32_MAX) + { + /* This will make it scan the entire thing again, + * but it only hits on 8GB unchanged data anyways, + * and if you're doing that, you've got bigger problems. */ + skip = UINT32_MAX; + } *compressed16++ = 0; *compressed16++ = skip; *compressed16++ = skip >> 16; @@ -261,8 +262,8 @@ size_t state_manager_raw_compress(const void *src, } changed = find_same(old16, new16); - if (changed > UINT_FAST16_MAX) - changed = UINT_FAST16_MAX; + if (changed > UINT16_MAX) + changed = UINT16_MAX; *compressed16++ = changed; *compressed16++ = skip;