<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><pre> > I presume you mean so it works on both 32-bit and 64-bit?</pre><br>There should be no doubt that almost everything should.<br>Yes.<br><br>> > VS_FFI_SIGNATURE    : INT32 = -17890115; (* 16_FEEF04BD *)<br>> ><br>> <br>> Works, but tedious to hand-compute and to double-check consistency with<br>> the comment.  How about 16_FEEF04BD-16FFFFFFFF-1?<br><br>I can try that.<br>I couldn't hand compute it.<br>I gave up and used a reliable calculator:<br>#include <stdio.h><br>int main() { printf("%d\n", 0xFEEF04BD); return 0; }<br><br>but yeah, something obviously correct by inspection would be nice.<br><br>Notice that I can't use Word or Long to help compute such constants.<br>I kinda think we need a Word32 interface (and Long should then have been called Word64).<br><br><br>> Does it seem odd that numbers like this in the upper-half unsigned range<br>> are being given to a signed type?<br><br><br>Sure, but, maybe I'm confused, but we don't have this upper-half in our unsigned types either.<br>I can try foo: UINT32 = 16_FFFFFFFF or 16_FEEF04BD or such.<br><br><br>We also had I think negative numbers assigned to unsigned types.<br><br><br> - Jay<br><br><br><div>> Date: Sun, 1 Sep 2013 16:54:22 -0500<br>> From: rodney_bates@lcwb.coop<br>> To: m3devel@elegosoft.com<br>> Subject: Re: [M3devel] how to write constants?<br>> <br>> <br>> <br>> On 08/31/2013 01:17 AM, Jay K wrote:<br>> > What is the right way to do this for 64bit systems?<br>> <br>> I presume you mean so it works on both 32-bit and 64-but?<br>> <br>> ><br>> >    other       : INT32 = 16_FFFFFFFF;<br>> ><br>> ><br>> > "../src/win32/WinUser.i3", line 1321: warning: value not assignable (range fault)<br>> >    WS_POPUP       : INT32 = 16_80000000;<br>> ><br>> > "../src/win32/WinVer.i3", line 37: warning: value not assignable (range fault)<br>> >    VS_FFI_SIGNATURE    : INT32 = 16_FEEF04BD;<br>> ><br>> ><br>> > I'm guessing..<br>> >   other : INT32 := -1;<br>> <br>> Yes, assuming this is the same INT32 as the other two cases (a subrange<br>> covering 32-bit signed twos-complement.  (I couldn't find this declaration,<br>> thus nor its INT32 type.)<br>> <br>> > WS_POPUP = FIRST(INT32)<br>> <br>> That will work.  Ultimately, the buck has to stop being passed, and<br>> following more levels of transitive type renaming than I want to count,<br>> I see the type defined as [-16_7fffffff-1 .. 16_7fffffff], whose lower<br>> bound is the way I would have done it as a ground constant.<br>> <br>> I see two different BasicCTypes.i3 versions, inside subdirectories<br>> 32BITS and 64BITS, but this decl is the same in both.<br>> <br>> > VS_FFI_SIGNATURE    : INT32 = -17890115; (* 16_FEEF04BD *)<br>> ><br>> <br>> Works, but tedious to hand-compute and to double-check consistency with<br>> the comment.  How about 16_FEEF04BD-16FFFFFFFF-1?<br>> <br>> Does it seem odd that numbers like this in the upper-half unsigned range<br>> are being given to a signed type?<br>> <br>> ><br>> > ?<br>> ><br>> >   - Jay<br>> <br></div>                                    </div></body>
</html>