<div dir="ltr">Hi All,<div><br></div><div> just a simple message about 64-bit code. Don't use int. Please use long, unsigned long, sqInt or usqInt for variables that are of the machine's natural word length (sqInt is a synonym for long and usqInt is a synonym for unsigned long). On most, if not all 64-bit C compilers int is a 32-bit datatype. Therefore code that tries to pass a pointer through an int parameter will end up truncating the pointer, with potentially disastrous results. Here's an example I'm fixing now.</div><div><br></div><div>In the AsynchFilePlugin the standard header defines everything as int:</div><div><br></div><div><div>int asyncFileClose(AsyncFile *f);</div><div>int asyncFileOpen(AsyncFile *f, int fileNamePtr, int fileNameSize, int writeFlag, int semaIndex);</div><div>int asyncFileRecordSize();</div><div>int asyncFileReadResult(AsyncFile *f, int bufferPtr, int bufferSize);</div><div>int asyncFileReadStart(AsyncFile *f, int fPosition, int count);</div><div>int asyncFileWriteResult(AsyncFile *f);</div><div>int asyncFileWriteStart(AsyncFile *f, int fPosition, int bufferPtr, int bufferSize);</div><div><br></div><div>but the fileNamePtr and bufferPtr parameters are really pointers passed as integers. These should be declared as "long", "sqInt", et al. long is defines as an integral type large enough to hold a pointer.</div><div><br></div><div>If every variable had been declared as sqInt no change would be necessary. As it is I'm changing just those two parameters to long, to avoid the noise.</div><div><br></div><div>Our code base is littered with such issues. Hence before I can get a 64-bit Spur stack VM running I have to hack, hack, hack.</div>-- <br><div class="gmail_signature">cheers,<div>Eliot</div></div>
</div></div>