<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 6, 2017 at 5:38 PM, D. Hugh Redelmeier <span dir="ltr"><<a href="mailto:hugh@mimosa.com" target="_blank">hugh@mimosa.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Perhaps I'm old fashioned but we have avoided putting static things in<br>
headers.<br>
<br>
- they notionally take resources in every compilation unit that includes<br>
  the header.  (But smart compilers can eliminate unused instances.)<br>
<br>
- .h files are about sharing and static things are not shared<br>
<br>
Exception: inline functions.  An inline function is useful as a cleaner<br>
replacement for macros.  If I remember correctly, making an inline<br>
function static makes the semantics simpler allowing a compiler to do<br>
a better job.<br>
<br>
Currently the only exceptions I see are:<br>
<br>
linux/include/des/podd.h:59:<wbr>static const unsigned char odd_parity[256] = {<br>
linux/include/des/sk.h:59:<wbr>static const DES_LONG des_skb[8][64] = {<br>
osxApp/MainMenuController.h:<wbr>20:static AuthorizationRef gAuth;<br>
<br>
include/ietf_constants.h:1696:<wbr>static const unsigned char sha1_rsa_oid_blob[ASN1_SHA1_<wbr>RSA_OID_SIZE] = {0x30,0x0d,0x06,0x09,0x2a,<wbr>0x86,0x48,0x86,0xf7,0x0d,0x01,<wbr>0x01,0x05,0x05,0x00};<br>
include/ietf_constants.h:1698:<wbr>static const uint8_t len_sha1_rsa_oid_blob[ASN1_<wbr>LEN_ALGO_IDENTIFIER] = {ASN1_SHA1_RSA_OID_SIZE};<br>
<br>
<br>
The first three are in imported code and should not be changed. The second<br>
two, in my opinion, ought to be eliminated (definitions moved).<br>
<br></blockquote><div><font color="#741b47">I will change this. Thank you for the comments.</font></div><div><font color="#741b47">This was implemented in a hard coded way for one value. But , in future there are many such blobs of varying lengths that would be used. So, this hardcoding shall be removed.</font></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The objects defined in last two are only actually used one place so<br>
there is probably no serious consequence to the current code.<br>
<br>
______________________________<wbr>_________________<br>
Swan-dev mailing list<br>
<a href="mailto:Swan-dev@lists.libreswan.org">Swan-dev@lists.libreswan.org</a><br>
<a href="https://lists.libreswan.org/mailman/listinfo/swan-dev" rel="noreferrer" target="_blank">https://lists.libreswan.org/<wbr>mailman/listinfo/swan-dev</a><br>
</blockquote></div><br></div></div>