home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / programm / misc / 5236 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  1.5 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Style wars with NULL (was Re: How to remove kbd message from system queue?)
  5. Message-ID: <752@lax.lax.pe-nelson.com>
  6. Date: 21 Jan 93 18:37:34 GMT
  7. References: <1ja2l6INNla3@msuinfo.cl.msu.edu> <1993Jan19.135956.22950@ugle.unit.no> <1993Jan20.211104.8721@emr1.emr.ca>
  8. Sender: news@lax.pe-nelson.com
  9. Organization: PE-Nelson
  10. Lines: 22
  11.  
  12. In article <1993Jan20.211104.8721@emr1.emr.ca>, jagrant@emr1.emr.ca (John Grant) writes:
  13. |>     Technically speaking, NULL is used for a pointer, whereas
  14. |>     0 or 0L are int values.  The CALLBACK function requires an
  15. |>     LRESULT (long int), which is a 0 or 0L, but not a NULL.
  16.  
  17. Well, technically speaking NULL is defined as 0 (or should be) so there is
  18. nothing wrong with using it (no matter whether the function returns an int,
  19. a long, or a pointer).
  20.  
  21. However stylistically I agree with John.  I use NULL for pointers and
  22. handles and an explicit zero for explicit numeric types.  Likewise I try
  23. to use TRUE and FALSE only for BOOL return types.
  24.  
  25. Let the style war begin! :-0
  26.  
  27.  
  28. ----------------------------------------------------------------------------
  29. Tom Brown               |  "She turned me into a newt...
  30. PE Nelson Systems       |                                  ... I got better"
  31. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  32. ----------------------------------------------------------------------------
  33.  
  34.