<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 10, 2014 at 5:48 PM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><br>
On Wed, Dec 10, 2014 at 03:13:13PM -0800, Eliot Miranda wrote:<br>
&gt;<br>
&gt; Hi All,<br>
&gt;<br>
&gt;     just a simple message about 64-bit code.  Don&#39;t use int.  Please use<br>
&gt; long, unsigned long, sqInt or usqInt for variables that are of the<br>
&gt; machine&#39;s natural word length (sqInt is a synonym for long and usqInt is a<br>
&gt; synonym for unsigned long).<br>
<br>
</span>No, sqInit is *NOT* a synonym for long.<br></blockquote><div><br></div><div>Apart from on the weird &quot;64-bit image on 32-bit platform&quot; oddity that I see no value in maintaining, sqInt == long.</div><div><br></div><div>On 32-bit C compilers</div><div><br></div><div>        sizeof(int) == 4</div>        sizeof(long) == 4<br class="">        sizeof(sqInt) == 4</div><div class="gmail_quote"><br></div><div class="gmail_quote">On 64-bit C compilers with a 64-bit image<div><br></div><div>        sizeof(int) == 4</div>        sizeof(long) == 8<br class="">        sizeof(sqInt) == 8<br><div><br></div><div>There&#39;s an oddity of a 32-bit VM compiled in 64-bit mode on a 64-bit machine.  I don&#39;t know of anyone using it.  But on that config</div><div><div><br></div><div>        sizeof(int) == 4</div>        sizeof(long) == 8<br class="">        sizeof(sqInt) == 4<br></div><div><br></div><div>I&#39;m in the process of providing a real 64-bit system with 61-bit SmallIntegers, immediate floating point, a segmented memory, etc, etc.  I am /not/ going to be held up trying to maintain the old 64-bit VM oddities.  A 32-bit VM on a 32-bit platform and a 64-bit VM on a 64-bit platform are enough, and expensive enough to maintain.</div><div><br></div><div>So yes, use sqInt, usqInt, long and unsigned long.  Do not use int.  Preferably declare pointer parameters as pointer rather than sqInt/long.  But in fixing existing code the easiest thing is to change int to either sqInt or long, depending on whether that parameter receives an oop or not.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
In particular, it is a 64-bit data type in some circumstances, and a 32-bit<br>
data type in others. Ditto for usqInt.<br>
<br>
If you are working with something where word size matters, declare it as<br>
such, and do not rely on sqInt and usqInt to do what you expect. They are<br>
not 32 bit data types.<br>
<br>
Some but not all of the plugins are 32/64 bit clean in trunk. But many,<br>
including FFI, SSL, and plugins that rely on the SurfacePlugin stub, remain<br>
to be sorted out. By far the worst problem is the assumption that C pointers<br>
fit into 32-bit int data types, but there are various other issues remaining<br>
to be addressed. At the risk of a broad generalization, they all relate to<br>
missing type declarations and invalid assumptions about word size, such as<br>
assuming that sqInt is 32-bits in size.<br>
<br>
Dave<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div></div>