[net.lang.c] How does one construct a mask fo

adm@cbneb.UUCP (03/08/85)

/***** cbnap:net.lang.c / ISM780!ed /  9:14 pm  Mar  7, 1985 */

>    #define MSB (~(-1>>1))
>
>    Steve Ludlum, decvax!yale-co!ima!stevel, {cca!ihnp4!cbosgd}!ima!stevel

I think you need

#define MSB (~((unsigned)-1>>1))

Right shift is only guaranteed to fill by zeroes if the left operand is
unsigned.

Ed Lycklama
decvax!cca!ima!ism780!ed
/* ---------- */