> So, doing the math in unsigned integers, and then casting back to a > signed type would be OK, right? E.g. > > #define MBLKL(mp) (intptr_t)((uintptr_t)(mp)->b_wptr - > (uintptr_t)(mp)->b_rptr)) > > Despite what the man page says, I don't want to cast to an (int), > because that would represent loss of data, where the old code didn't > lose it.
There's only data loss in the case of the mythical 2^31+ mblk. But as long as the result is still signed and accurate, I'm OK with it. -- meem _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code