mem: Fix zero detect base function for mingw

Mingw does not define WORDSIZE and incorrect int width was used.

Change-Id: Idc9f560dd1c722d51f6e54ba2342feafa13f8fa5
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
This commit is contained in:
Greg Tucker
2018-09-26 10:22:44 -07:00
parent 3983fac41f
commit 8ddc8d0117

View File

@@ -33,15 +33,11 @@
int mem_zero_detect_base(void *buf, size_t n)
{
unsigned char *c;
#if __WORDSIZE == 64
unsigned long long a = 0, *p = buf;
#else
unsigned int a = 0, *p = buf;
#endif
uintmax_t a = 0, *p = buf;
// Check buffer in native machine width comparisons
while (n >= sizeof(p)) {
n -= sizeof(p);
while (n >= sizeof(*p)) {
n -= sizeof(*p);
if (*p++ != 0)
return -1;
}