mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	cppcheck: (error) Shifting signed 64-bit value by 63 bits
As of cppcheck 1.82 surpress the warning regarding shifting too many bits for __divdi3() implemention. The algorithm used here is correct. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #9732
This commit is contained in:
		
							parent
							
								
									363d7332f2
								
							
						
					
					
						commit
						603ae6a8c0
					
				@ -273,7 +273,9 @@ int64_t
 | 
			
		||||
__divdi3(int64_t u, int64_t v)
 | 
			
		||||
{
 | 
			
		||||
	int64_t q, t;
 | 
			
		||||
	// cppcheck-suppress shiftTooManyBitsSigned
 | 
			
		||||
	q = __udivdi3(abs64(u), abs64(v));
 | 
			
		||||
	// cppcheck-suppress shiftTooManyBitsSigned
 | 
			
		||||
	t = (u ^ v) >> 63;	// If u, v have different
 | 
			
		||||
	return ((q ^ t) - t);	// signs, negate q.
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user