home *** CD-ROM | disk | FTP | other *** search
- 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
- From: schaker@draco.unm.edu (Stefan Yen Chakerian)
- Newsgroups: alt.hackers
- Subject: Re: Stupid macro tricks...
- Date: 24 Jan 1993 23:28:54 GMT
- Organization: ...working on it
- Lines: 25
- Approved: foo@bar
- Distribution: alt
- Message-ID: <1jv8nmINN81t@lynx.unm.edu>
- References: <C1DnqE.L3u@mentor.cc.purdue.edu>
- NNTP-Posting-Host: draco.unm.edu
-
- daffnelr@mentor.cc.purdue.edu (Throatwarbler Mangrove) writes:
- >I want an expression that's true
- >iff NONE of the flags set in y are set in x->flags, so I did:
- >#define notplayer(x,y) !(~(x->flags | ~(y)) ^ (y))
-
- >... I want it to be 0 unless both bits are 0.
- >And if you can think of a simpler way to do it, let me know..
-
- Doesn't this one do the same (except crash when called with
- notplayer(p_ptr + 2,TRAD|HUSHED) )?
-
- #define NOTPLAYER(x,y) !((x)->flags & (y))
-
- here's a vi macro of sorts. It's actually a map, but that's nomenclature
- for ya. I got this off the net years ago. I mean YEARS.
-
- map ?^[ ]*$?+1!//-1jive
-
- stef
-
- --
- _---_ Stefan Chakerian
- / o o \ schaker@triton.unm.edu, schaker@unmb.bitnet
- | \___/ |
- \_____/ Winners don't lose drugs.
-