Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!hsdndev!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: <63961@bbn.BBN.COM> Date: 30 Apr 91 21:58:55 GMT References: <63903@bbn.BBN.COM> <3417@charon.cwi.nl> Sender: news@bbn.com Lines: 34 guido@cwi.nl (Guido van Rossum) writes: >rmitchel@bbn.com (Rob Mitchell) writes: >>[correct diagnosis of earlier problem omitted] >> 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. >I take exception with this advice. Portable programs should use 'int' >for most common cases, especially function parameters, except: > - always use long if values > 32767 are possible > - use short for space conservation in structs and arrays, > when values are guaranteed to be <= 32767. >The reason is that 'int' is likely to generate the most efficient >code, because it represents the natural word size (register size) for >the architecture. Then just use "register" wherever possible. Global variable "ints" are, IMHO, next to useless. This is not place for further programming-style-bashing. 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.