From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 413 invoked from network); 23 Jun 1999 14:47:42 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 23 Jun 1999 14:47:42 -0000 Received: from voicenet.com (mail12.voicenet.com [207.103.0.6]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id JAA07992 for ; Wed, 23 Jun 1999 09:52:47 -0400 Received: (qmail 28405 invoked from network); 23 Jun 1999 13:52:45 -0000 Received: from dialpool0756-pri.voicenet.com (HELO voicenet.com) (209.71.86.184) by mail12.voicenet.com with SMTP; 23 Jun 1999 13:52:45 -0000 Sender: gat@mail.redhat.com Message-ID: <3770CB8A.F4C1AE89@voicenet.com> Date: Wed, 23 Jun 1999 07:56:58 -0400 From: Uncle George Organization: Big Endian X-Mailer: Mozilla 4.07 [en] (X11; I; Linux 2.0.36 i686) MIME-Version: 1.0 To: Jeff Galyan CC: java-linux@blackdown.org, axp-list@redhat.com Subject: Re: [off-topic] stop bashing! References: <199906171425.HAA10515@shell.accesscom.com> <376A353F.AD76951F@voicenet.com> <376C3667.4AD168F1@anamorphic.com> <376D7508.B09894F4@voicenet.com> <376EFC87.D6FB5962@anamorphic.com> <376F6CF1.685F682A@voicenet.com> <37701981.5844C5E3@anamorphic.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Please return a long/64 bits Window address. Lemme know what gets stored in in the java int valiable "lets_store_a_32_bit_address", which has the capacity to store 32 bits. I'm sorry, I thought a fairly simply program sample would demonstrate it best. While ur pondering this porting delima, may u can figure out the other points that I was attempting, but failed to make to u. Again I'm sorry for my failure. Jeff Galyan wrote: > Uncle George wrote: > > 5) In the land of alpha longs are 64bits as well as address pointers => > > > > .java > > int lets_store_a_32_bit_address; > > private native int wheres_my_window(); > > lets_store_a_32_bit_address = wheres_my_window(); > > ...... > > > > Native .c > > int wheres_my_window(blah*,blah ){ > > long addr; > > addr = (Window) w; > > return(addr); > > } > > This particular example results in the truncation of a returned 64 bit 'c' address, into a 32bit '.java' variable/storage. u can of course change the 'c' routine to return all 64bits, but that will be, eventually, truncated by the jvm to 32bits. In the Land of "OSF/true64" for the Dec Alpha, u can convince the compiler to produce 32bit pointer arithemetic, where long == 32bits. But the currently available linux/alpha compilers a long==pointer==64bits. > > Your example is flawed in that you assume you should return an int from > wheres_my_window(blah*, blah). If you return a long, everything is fine, > since in the land of Java, long is defined as a 64-bit data type. > > >