PERFORCE change 28754 for review

Peter Wemm peter at FreeBSD.org
Thu Apr 10 23:33:31 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=28754

Change 28754 by peter at 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);


More information about the p4-projects mailing list