mirror of
https://github.com/intel/isa-l.git
synced 2025-11-08 14:56:11 +01:00
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:
@@ -33,15 +33,11 @@
|
|||||||
int mem_zero_detect_base(void *buf, size_t n)
|
int mem_zero_detect_base(void *buf, size_t n)
|
||||||
{
|
{
|
||||||
unsigned char *c;
|
unsigned char *c;
|
||||||
#if __WORDSIZE == 64
|
uintmax_t a = 0, *p = buf;
|
||||||
unsigned long long a = 0, *p = buf;
|
|
||||||
#else
|
|
||||||
unsigned int a = 0, *p = buf;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Check buffer in native machine width comparisons
|
// Check buffer in native machine width comparisons
|
||||||
while (n >= sizeof(p)) {
|
while (n >= sizeof(*p)) {
|
||||||
n -= sizeof(p);
|
n -= sizeof(*p);
|
||||||
if (*p++ != 0)
|
if (*p++ != 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user