Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site decvax.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!decvax!minow From: minow@decvax.UUCP (Martin Minow) Newsgroups: net.unix-wizards Subject: Re: long vs. int vs. short guidelines (especially for wizards!!) Message-ID: <435@decvax.UUCP> Date: Fri, 13-Apr-84 19:41:03 EST Article-I.D.: decvax.435 Posted: Fri Apr 13 19:41:03 1984 Date-Received: Sat, 14-Apr-84 09:29:18 EST References: <253@unisoft.UUCP> Organization: DEC UNIX Engineering Group Lines: 26 Here are the int/short/long guidelines that we used in a fairly large product (DECtalk): Storage allocation (globals and statics) always uses the following quantities: char 8-bit maximum, contains a value. FLAG Contains only TRUE/FALSE (#defined as char) INT_16 int that can be stored in a pdp-11 short INT_32 int that reqires more than a pdp-11 short Function formal parameters and auto's may use "int" if the argument was passed as char, int, or INT_16 and the value is expressable as a pdp-11 short. This allows the compiler to generate efficient code for "normal" situations. The definition of INT_16 and INT_32 is set by architecture-specific typedef's in a header file. Martin Minow decvax!minow