[PATCH v2] render: Silence warnings when building with clang

Jamey Sharp jamey at minilop.net
Mon Apr 25 14:12:34 PDT 2011


On Mon, Apr 25, 2011 at 11:25:04AM -0700, Jeremy Huddleston wrote:
> -#define Mask(n)	((n) == 32 ? 0xffffffff : ((1 << (n))-1))
> +/* Returns a CARD16 mask, n wide. */
> +/*@ requires 0 <= n <= 16 but does not enforce it */
> +#define Mask(n) ((1 << (n)) - 1)

Reviewed-by: Jamey Sharp <jamey at minilop.net>

Although I'd like confirmation from keithp or somebody that this makes
sense.

Also, the "/*@ requires ..." was an annotation in the ACSL specification
language used in Frama-C; but those annotations can't actually be
applied to macro definitions, so it was a silly suggestion. If it had
been valid, the "but does not enforce it" note would have broken the
annotation. :-) You might just delete the comment, or at least the
at-symbol.

Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110425/59dd96ee/attachment-0001.pgp>


More information about the xorg-devel mailing list