svn commit: r283088 - head/sys/ddb

Bruce Evans brde at optusnet.com.au
Tue May 19 02:12:18 UTC 2015


On Mon, 18 May 2015, Pedro F. Giffuni wrote:

> Log:
>  ddb: stop boolean screaming.
>
>  TRUE --> true
>  FALSE--> false
>
>  Hinted by:	NetBSD

This is not just churn to a style regression, but a type mismatch.

> Modified: head/sys/ddb/db_break.c
> ==============================================================================
> --- head/sys/ddb/db_break.c	Mon May 18 22:14:06 2015	(r283087)
> +++ head/sys/ddb/db_break.c	Mon May 18 22:27:46 2015	(r283088)
> @@ -155,12 +155,12 @@ db_find_breakpoint_here(db_addr_t addr)
> 	return db_find_breakpoint(db_map_addr(addr), addr);
> }
>
> -static boolean_t	db_breakpoints_inserted = TRUE;
> +static boolean_t	db_breakpoints_inserted = true;

This code hasn't been churned to use the boolean type.  It still uses
boolean_t, which is plain int.  TRUE and FALSE go with this type.  true
and false go with the boolean type.  This probably makes no difference,
because TRUE happens to be implemented with the same value as true and
there are lots of implicit versions between the types.

The boolean type is almost useless since C's type system is too weak to
distinguish between plain int used as a boolean and pure boolean.  If
it were stronger, then it would complain about all the implicit conversions
between int and boolean, and the boolean type would be harder to use for
other reasons.

Bruce


More information about the svn-src-all mailing list