home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / hackers / 1971 < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.3 KB  |  39 lines

  1. Path: sparky!uunet!wupost!uwm.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!yale.edu!nigel.msen.com!fmsrl7!lynx.unm.edu!draco.unm.edu!schaker
  2. From: schaker@draco.unm.edu (Stefan Yen Chakerian)
  3. Newsgroups: alt.hackers
  4. Subject: Re: Stupid macro tricks...
  5. Date: 24 Jan 1993 23:28:54 GMT
  6. Organization: ...working on it
  7. Lines: 25
  8. Approved: foo@bar
  9. Distribution: alt
  10. Message-ID: <1jv8nmINN81t@lynx.unm.edu>
  11. References: <C1DnqE.L3u@mentor.cc.purdue.edu>
  12. NNTP-Posting-Host: draco.unm.edu
  13.  
  14. daffnelr@mentor.cc.purdue.edu (Throatwarbler Mangrove) writes:
  15. >I want an expression that's true
  16. >iff NONE of the flags set in y are set in x->flags, so I did:
  17. >#define notplayer(x,y)        !(~(x->flags | ~(y)) ^ (y))
  18.  
  19. >... I want it to be 0 unless both bits are 0.
  20. >And if you can think of a simpler way to do it, let me know..
  21.  
  22.     Doesn't this one do the same (except crash when called with
  23.     notplayer(p_ptr + 2,TRAD|HUSHED) )?
  24.  
  25. #define NOTPLAYER(x,y)    !((x)->flags & (y))
  26.  
  27. here's a vi macro of sorts.  It's actually a map, but that's nomenclature
  28. for ya.  I got this off the net years ago.  I mean YEARS.
  29.  
  30. map  ?^[ ]*$?+1!//-1jive
  31.  
  32.                 stef
  33.  
  34. -- 
  35.     _---_     Stefan Chakerian
  36.    / o o \    schaker@triton.unm.edu, schaker@unmb.bitnet
  37.   | \___/ |   
  38.    \_____/    Winners don't lose drugs.
  39.