Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!lll-winken!ubvax!mitsumi!jimm From: jimm@mitsumi.UUCP (Jim Mackraz) Newsgroups: comp.lang.c,comp.sys.atari.st,comp.sys.amiga Subject: Re: 32bit = 16bit x 16bit Message-ID: <563@mitsumi.UUCP> Date: Tue, 20-Oct-87 15:22:47 EDT Article-I.D.: mitsumi.563 Posted: Tue Oct 20 15:22:47 1987 Date-Received: Fri, 23-Oct-87 06:14:00 EDT References: <1912@gryphon.CTS.COM> <3294@sol.ARPA> <2545@cbmvax.UUCP> Reply-To: jimm@mitsumi.UUCP (James Mackraz) Organization: Mitsumi Technology Inc Lines: 37 Xref: mnetor comp.lang.c:5060 comp.sys.atari.st:5820 comp.sys.amiga:9704 In article <2545@cbmvax.UUCP> andy@cbmvax.UUCP (Andy Finkel) writes: )In article <3294@sol.ARPA> crowl@cs.rochester.edu (Lawrence Crowl) writes: )>In article <1912@gryphon.CTS.COM> mhatter@pnet02.CTS.COM )>(Patrick E. Hughes) writes: )>>I might suggest one thing if you plan on porting many C programs: Don't Use )>NO! Char, short, and long do change size. The only thing you can rely on is )>that sizeof char <= sizeof short <= sizeof int <= sizeof long. If you want )>portable programs, DO NOT USE BASIC TYPES. At the top of the program, define a ) )We at the Banzai Institute always use typedefs :-) )Ours are stored in the include file exec/types.h )To maintain readability, however, the names were a bit a bit boring, ie )LONG, ULONG, WORD, UWORD, BYTE, UBYTE, and VOID. )andy finkel {ihnp4|seismo|allegra}!cbmvax!andy Well, one qualification on this business is that sometimes you want Mr. Compiler to choose its most efficient type. For example, in Intuition, there was a large number of cases where SHORT was used in loop counters, and other places where a small counting number was needed. There appeared to be explicit sign extension operation frequently applied to these SHORTs. When many SHORTS were converted to 'ints', the resulting code was significantly smaller (note: significant to people who changed the name "rawinput" to "ri" because we needed the 6 bytes. Yea, significant to people who waited from Jul 31 to Aug 1 for the big build because that second digit in the date string, multiplied by the number of libraries, ...). It also broke where a pointer to an 'int' was passed to a program expecting a pointer to a SHORT. But *sometimes*, there are *some* reasons for saying 'int' instead of either LONG or SHORT. jimm -- Jim Mackraz Mitsumi Technology, Inc. 408/980-5422 {amiga,pyramid}!mitsumi!jimm