Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Apr 2003 23:33:29 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 28754 for review
Message-ID:  <200304110633.h3B6XTJw085790@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=28754

Change 28754 by peter@peter_daintree on 2003/04/10 23:32:49

	OK, I have to laugh about this one.
	keep gcc-3.3 happy where long > int (speed_t is
	unsigned int)

Affected files ...

.. //depot/projects/hammer/sys/dev/sio/sio.c#9 edit

Differences ...

==== //depot/projects/hammer/sys/dev/sio/sio.c#9 (text+ko) ====

@@ -1542,8 +1542,12 @@
 	u_int	divisor;
 	int	error;
 
-	if (speed == 0 || speed > (ULONG_MAX - 1) / 8)
+	if (speed == 0)
+		return (0);
+#if UINT_MAX > (ULONG_MAX - 1) / 8
+	if (speed > (ULONG_MAX - 1) / 8)
 		return (0);
+#endif
 	divisor = (rclk / (8UL * speed) + 1) / 2;
 	if (divisor == 0 || divisor >= 65536)
 		return (0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304110633.h3B6XTJw085790>