Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!uunet!olivea!tymix!cirrusl!sunstorm!dhesi From: dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: Style guides and portability Keywords: style guide, Thomas Plum, portability Message-ID: <2901@cirrusl.UUCP> Date: 18 Jan 91 04:46:52 GMT References: <1163@tredysvr.Tredydev.Unisys.COM> Sender: news@cirrusl.UUCP Organization: Cirrus Logic Inc. Lines: 26 In <1163@tredysvr.Tredydev.Unisys.COM> paul@tredysvr.Tredydev.Unisys.COM (Paul Siu) writes: While looking through Thomas Plum's style guide, I notice he mentions that one should set up a separate #define file for data types. It's a good idea. In the future I am planning to use defines or typedefs similar to the following. name property ---- -------- t_int8 8 bits or more, signed t_xint8 8 bits or more, signed or unsigned t_uint8 8 bits or more, unsigned t_int16 16 bits or more, signed t_xint16 16 bits or more, signed or unsigned t_uint16 16 bits or more, unsigned The idea behind having a "signed or unsigned" data type is that when you don't care (e.g. when storing bits or smallish unsigned values), you can use whichever type (signed or unsigned) is handled more efficiently on a given machine. -- Rahul Dhesi UUCP: oliveb!cirrusl!dhesi