home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16696 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.1 KB  |  33 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!nntp1.radiomail.net!fernwood!pure!rpeck
  3. From: rpeck@pure.com (Ray Peck)
  4. Subject: Re: Typedefing builtin... thanks.
  5. Message-ID: <1992Nov17.235519.24646@pure.com>
  6. Organization: Pure Software, Los Altos, CA
  7. References: <1992Nov9.150414.10221@odin.diku.dk>
  8. Date: Tue, 17 Nov 1992 23:55:19 GMT
  9. Lines: 22
  10.  
  11.  
  12. In article <1992Nov9.150414.10221@odin.diku.dk> . . .:
  13.  
  14. >People generally tended to agree with me on the use of the names BYTE, WORD,
  15. >and LWORD to represent unsigned 8, 16, and 32 bit variables in my simulation
  16.  
  17. >The major arguments used to justify these techniques were about portability.
  18. >A program is easier to port, when you can change some typedefs in a header
  19. >file, instead of changing a lot of ints to longs all over the code.
  20.  
  21. The only problem with this is a WORD is not a portable concept (i.e.,
  22. people in 68k's call 16 bits a word, while people on Real Machines ;-)
  23. call 32 bits a word.  All modern machines use 32b and up.
  24.  
  25.  
  26. For this reason, I prefer types int8, int16, int32, or (better) u1b,
  27. u2b, u4b, (unsigned) and s1b, s2b, s4b (signed).
  28.  
  29. -- 
  30. Ray Peck                        rpeck@pure.com
  31. Pure Software                        415-903-5100
  32.  
  33.