mirror of
				https://github.com/intel/isa-l.git
				synced 2025-11-03 19:40:35 +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)
 | 
			
		||||
{
 | 
			
		||||
	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;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user