home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / c / 16215 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.6 KB

  1. Path: sparky!uunet!mcsun!sunic!dkuug!diku!jkut
  2. From: jkut@diku.dk (Jonatan Kutchinsky)
  3. Newsgroups: comp.lang.c
  4. Subject: Typedefing builtin... thanks.
  5. Message-ID: <1992Nov9.150414.10221@odin.diku.dk>
  6. Date: 9 Nov 92 15:04:14 GMT
  7. Sender: jkut@ask.diku.dk
  8. Organization: Department of Computer Science, U of Copenhagen
  9. Lines: 26
  10.  
  11. I posted a question at comp.std.c about the justification of typedefing built
  12. in datatypes for data abstraction reasons. I now know that a question like
  13. that belongs in this newsgroup, and not in comp.std.c.
  14.  
  15. I just want to thank for all the good replies (13) i got, and give a short
  16. summary:
  17.  
  18. People generally tended to agree with me on the use of the names BYTE, WORD,
  19. and LWORD to represent unsigned 8, 16, and 32 bit variables in my simulation
  20. of a Motorola 68000 processor. Some even proposed the use of special 
  21. functions or macros for calculations, conversions to builtin types, and for
  22. I/O. We are going to use this in our computer science project.
  23.  
  24. One stated that in his ideal program, builtin types were never used, and
  25. names like f.x. Counter, and BigCounter would represent int and perhaps long,
  26. depending on the machine used.
  27.  
  28. The major arguments used to justify these techniques were about portability.
  29. A program is easier to port, when you can change some typedefs in a header
  30. file, instead of changing a lot of ints to longs all over the code.
  31.  
  32. Once more i want to thank. The replies have been very useful.
  33.  
  34. *****************************************************************************
  35.         Jonatan Kutchinsky, Copenhagen, Denmark. E-mail: jkut@diku.dk
  36. *****************************************************************************
  37.