Quoting Peter Memishian, who wrote the following on Sun, 29 Jun 2008: > > > > > http://cr.opensolaris.org/~gdamore/mblkl/ once I get confirmation, > > > > especially from meem, then I'll go ahead and submit the RTI. > > > > > > I'm confused -- the definition for MBLKL() in the webrev appears to still > > > be: > > > > > > #define MBLKL(mp) ((uintptr_t)(mp)->b_wptr - > > > (uintptr_t)(mp)->b_rptr) > > > > > > > > Have another look. It looks like I forgot to push the updated webrev to > > cr.opensolaris.org. Sorry about that. > > I just looked at <sys/strsun.h>. Looks fine, though those defintions sure > are ugly. I'd be tempted to do something like: > > #define _PTRDIFF(p1, p2) ((intptr_t)((uintptr_t)(p1) - (uintptr_t)(p2))) > #define MBLKL(mp) _PTRDIFF((mp)->b_wptr, (mp)->b_rptr) > #define MBLKSIZE(mp) _PTRDIFF(DB_LIM(mp), DB_BASE(mp)) > #define MBLKHEAD(mp) _PTRDIFF((mp)->b_rptr, DB_BASE(mp)) > #define MBLKTAIL(mp) _PTRDIFF(DB_LIM(mp), (mp)->b_wptr)
I agree -- that's much nicer. --S _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code