Path: utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cmcl2!husc6!yale!breissinger-marc From: breissinger-marc@CS.Yale.EDU (Marc Breissinger) Newsgroups: comp.lang.eiffel Subject: copy_structure and integers Keywords: internal, copy_structure Message-ID: <57280@yale-celray.yale.UUCP> Date: 17 Apr 89 01:48:58 GMT Sender: root@yale.UUCP Reply-To: breissinger-marc@CS.Yale.EDU (Marc Breissinger) Organization: Yale University Computer Science Dept, New Haven CT 06520-2158 Lines: 31 I am attempting to use copy_structure and the INTERNAL class to allow the passing of structures to C and back. I first have a simple question: what is the parameter n for. All the docs say is that it is an integer -- but what is it. I have been using random numbers and seeing what comes out the best. I am also having larger problem with copy_structure. The eiffel object which I am copying onto consists of two features: numb1: INTEGER and numb2: INTEGER (The class is called TEST_STRUCT). The C structure looks like this: struct test_struct { int numb1; int numb2; }; The C routine that I call sets the values in the structure and returns a pointer to the structure. When I call copy_structure with the params of: a TEST_STRUCT object (inherits from INTERNAL), the returned pointer (an INTEGER), and 2, all goes well except for one problem. If numb1 was set to an odd number in the C routine it becomes numb1 - 1 after the copy structure. numb2 is correct. It seems that Eiffel is ignoring the first (least significant) bit of numb1. Does this happen because I don't have n set correctly? Is this a problem with Eiffel that must be worked around (how I don't know)? Thanks for your help, --Marc Breissinger