home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lclint.zip / lclint-2_3h-os2-bin.zip / test / null5.c < prev    next >
C/C++ Source or Header  |  1997-09-03  |  533b  |  37 lines

  1. extern /*@truenull@*/ bool isnull(/*@null@*/ int *x);
  2. extern /*@falsenull@*/ bool notnull(/*@null@*/ int *x);
  3. extern /*@falsenull@*/ char badnull (/*@null@*/ int *x);
  4. extern /*@falsenull@*/ bool worsenull (/*@null@*/ int *x, int t);
  5.  
  6. int g1 (/*@null@*/ int *y)
  7. {
  8.   if (isnull (y))
  9.     {
  10.       return 0;
  11.     }
  12.  
  13.   return *y;
  14. }
  15.  
  16. int g2 (/*@null@*/ int *y)
  17. {
  18.   if (notnull (y))
  19.     {
  20.       return 0;
  21.     }
  22.   else
  23.     {
  24.       return *y;
  25.     }
  26. }
  27.  
  28. int g3 (/*@null@*/ int *y)
  29. {
  30.   if (notnull (y))
  31.     {
  32.       return 0;
  33.     }
  34.  
  35.   return *y;
  36. }
  37.