Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Jul 1999 00:25:05 +0200 (CEST)
From:      Nick Hibma <hibma@skylink.it>
To:        Matt Jacob <mjacob@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/cam/scsi scsi_da.c
Message-ID:  <Pine.BSF.3.96.990704002051.8935C-100000@heidi.plazza.it>
In-Reply-To: <199907032114.OAA69073@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

The compiler was not _that_ stupid. It just did not rewrite 

	a/(b/c)

into 

	a*c/b

which is kind of fair, if you don't want to have problems with
difference in precision (int() calculations):

	4/(3/2) = 4/1 = 4 != 4*2/3 = 2

Nick

On Sat, 3 Jul 1999, Matt Jacob wrote:

> mjacob      1999/07/03 14:14:47 PDT
> 
>   Modified files:
>     sys/cam/scsi         scsi_da.c 
>   Log:
>   Make the change similar to that suggested by Nick Hibma to avoid divide by
>   zero traps. I actually can't believe that this compiler is *sooooo* stupid
>   that it did a divide when there was 1024L*1024L instead of a right shift by
>   20. When we get quad type modifiers in kernel printf we can change to this
>   too (to avoid overflow on > terabyte disk sizes).
>   
>   Revision  Changes    Path
>   1.28      +4 -3      src/sys/cam/scsi/scsi_da.c
> 
> 
> 

-- 
e-Mail: hibma@skylink.it



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990704002051.8935C-100000>