<div>I didnt think about the port aspect(not much experience).</div>
<div>Definately not the way to maintain a build of somethign that would work across all OS&#39;s</div>
<div>And in most cases there probably be a difference in bytes (4 vs 8) on most OS&#39;s anyways.</div>
<div>&nbsp;</div>
<div>An #ifdef would be the way to go, but my said typecasting would not be good for a port. </div>
<div>Looks like there are different functions for calculating absolute zero on different OS&#39;s. </div>
<div>&nbsp;</div>
<div>Check your headers for llabs.</div>
<div>&nbsp;</div>
<div>This might be the way to go for portability</div>
<div>&nbsp;</div>
<div>try swapping:</div>
<div>&nbsp;&nbsp; return new Val(abs(val.int_val), TYPE_COUNT);</div>
<div>&nbsp;</div>
<div>for:<br>#ifdef USE_INT64</div>
<div>&nbsp;&nbsp;&nbsp; return new Val(llabs(val.int_val), TYPE_COUNT);</div>
<div>#else</div>
<div>&nbsp;&nbsp;&nbsp; return new Val(abs(val.int_val), TYPE_COUNT);</div>
<div>#endif</div>
<div>&nbsp;</div>
<div>It may be better to define this function in a header but you can see if this works.<br></div>
<div>// Joel <br></div>
<div class="gmail_quote">On Tue, Apr 15, 2008 at 8:42 PM, Paul Schmehl &lt;<a href="mailto:pauls@utdallas.edu">pauls@utdallas.edu</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">--On April 15, 2008 9:07:28 PM -0500 Paul Schmehl &lt;<a href="mailto:pauls@utdallas.edu">pauls@utdallas.edu</a>&gt;<br>
wrote:<br>
<div class="Ih2E3d">&gt;<br>&gt; I don&#39;t know the size of a long int on my system, but I&#39;m almost certain<br>&gt; that it won&#39;t be the same on *every* system.<br>&gt;<br><br></div>Here&#39;s what I have in my includes:<br>
<br>/usr/src/sys/i386/include/_types.h:typedef &nbsp; &nbsp; &nbsp;long long<br>__int64_t;<br>/usr/src/sys/i386/include/_types.h:typedef &nbsp; &nbsp; &nbsp;unsigned long long<br>__uint64_t;<br>/usr/src/sys/i386/include/_types.h:typedef &nbsp; &nbsp; &nbsp;long long<br>
__int64_t;<br>/usr/src/sys/i386/include/_types.h:typedef &nbsp; &nbsp; &nbsp;unsigned long long<br>__uint64_t;<br><br>Fixing the function per your instructions allows the software to make<br>successfully. &nbsp;I&#39;m concerned, however, about your second point. &nbsp;If I<br>
change the define in util.h, will it break on some FreeBSD systems? &nbsp;I<br>don&#39;t know.<br><br>According to the cvs repository, _inttypes.h hasn&#39;t been changed in almost<br>six years on i386.<br>&lt;<a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/include/_inttypes.h" target="_blank">http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/i386/include/_inttypes.h</a>&gt;<br>
It&#39;s been almost 5 years on amd64 and 5 years on ia64.<br><br>I guess I&#39;m alright to redefine in util.h.<br>
<div>
<div></div>
<div class="Wj3C7c"><br>Paul Schmehl (<a href="mailto:pauls@utdallas.edu">pauls@utdallas.edu</a>)<br>Senior Information Security Analyst<br>The University of Texas at Dallas<br><a href="http://www.utdallas.edu/ir/security/" target="_blank">http://www.utdallas.edu/ir/security/</a><br>
<br>_______________________________________________<br>Bro mailing list<br><a href="mailto:bro@bro-ids.org">bro@bro-ids.org</a><br><a href="http://mailman.icsi.berkeley.edu/mailman/listinfo/bro" target="_blank">http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/bro</a><br>
</div></div></blockquote></div><br>