<div dir="ltr">Vendors frequently ask us to use magic numbers, and have even requested at times that we remove explanatory text. <div><br></div><div>We'll never get rid of magic numbers in this world :-(</div><div><br></div><div>ron</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Feb 4, 2016 at 1:25 PM Patrick Georgi <<a href="mailto:pgeorgi@google.com">pgeorgi@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2016-02-04 22:22 GMT+01:00 Martin Roth <<a href="mailto:gaumless@gmail.com" target="_blank">gaumless@gmail.com</a>>:<br>
> I don't think we need redefinitions of TRUE/FALSE<br>
We have no canonical definitions for TRUE/FALSE right now.<br>
Contributions that use them (for whatever reason) tend to bring local<br>
copies, and that's what I'd like to avoid.<br>
<br>
> How would people feel about adding something to the coding guide to<br>
> avoid magic numbers?<br>
Make that a separate thread please :-)<br>
<br>
<br>
Patrick<br>
<br>
> On Thu, Feb 4, 2016 at 6:05 AM, ron minnich <<a href="mailto:rminnich@gmail.com" target="_blank">rminnich@gmail.com</a>> wrote:<br>
>><br>
>><br>
>> On Thu, Feb 4, 2016 at 2:29 AM Patrick Georgi via coreboot<br>
>> <<a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a>> wrote:<br>
>>><br>
>>><br>
>>><br>
>>> 1. TRUE/FALSE<br>
>>> Do we want such defines? If so, TRUE/FALSE, or true/false, or<br>
>>> True/False, or ...?<br>
>><br>
>><br>
>> should we start using bool ...?<br>
>>><br>
>>><br>
>>> 2. BIT16 vs BIT(16) vs (1 << 16) vs 0x10000<br>
>>> I don't think it makes sense to go for a single one of these (0x3ff is<br>
>>> certainly more readable than BIT11 | BIT10 | BIT9 | BIT8 | BIT7 | BIT8<br>
>>> | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT 0), but I doubt we need both<br>
>>> BIT16 and BIT(16).<br>
>>><br>
>><br>
>> BIT16 is a constant. BIT(16) is a chance for things to go badly wrong, e.g.<br>
>> BIT(x-y) might produce some very strange problems. I kind of prefer the<br>
>> constant.<br>
>><br>
>> ron<br>
>><br>
>> --<br>
>> coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
>> <a href="http://www.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">http://www.coreboot.org/mailman/listinfo/coreboot</a><br>
<br>
<br>
<br>
--<br>
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg<br>
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: Hamburg<br>
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle<br>
</blockquote></div>