Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!bbn.com!rmitchel From: rmitchel@bbn.com (Rob Mitchell) Newsgroups: comp.sys.mac.programmer Subject: Re: Huh? What's wrong here... (A Simple Think C question) Message-ID: <63903@bbn.BBN.COM> Date: 26 Apr 91 20:03:34 GMT References: <1991Apr14.021934.8840@watdragon.waterloo.edu> <1991Apr14.104649.20585@ida.liu.se> Sender: news@bbn.com Lines: 33 >jpmah@dahlia.uwaterloo.ca (John Mah) writes: >long _get_new_hash_val(some parameters) >{ > long value; > ...some statements... > return value; >} >*my_pointer_to_a_long = _get_new_hash_val(some parameters); Use prototyping and declare the function in the file/module that its being called from. Problem is the 68000 masks off hiword (look at some disassembled code) upon return from function calls defaulting to "int" (which is only 16-bits on Mac, not 32-bits like many Unix machines). IMHO, never use "int" when programming Mac. Use either "short" or "long" (or better, declare typedefs for Int8, UInt8, etc.) which helps when porting to other computer systems. Good luck!! Rob Mitchell Advanced Simulation Division Unix & Macintosh Engineer BBN Systems & Technologies Internet: rmitchel@vax.bbn.com 33 Moulton Street MS: 8/C Primary Dwelling: 617-873-4041 Cambridge, MA 02138 Secondary Dwelling: 617-873-4071 FAX: 617-873-4315 These opinions are mine and mine only. They do not represent BBNs' opinions.