Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site psuvax1.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!houxm!whuxl!whuxlm!akgua!psuvax1!dae
From: dae@psuvax1.UUCP (Daemon)
Newsgroups: net.lang.c
Subject: Re: How does one construct a mask for the MS bit?
Message-ID: <1627@psuvax1.UUCP>
Date: Sun, 10-Mar-85 20:46:21 EST
Article-I.D.: psuvax1.1627
Posted: Sun Mar 10 20:46:21 1985
Date-Received: Tue, 12-Mar-85 22:13:38 EST
References: <8849@brl-tgr.ARPA> <169@dmsd.UUCP>
Reply-To: dae@psuvax1.UUCP (Dave Eckhardt)
Distribution: net
Organization: The Furnace
Lines: 23
Summary: Another attempt: #define msb(x) (1 << (8 * sizeof(x)) - 1)


The below is at least a stab in the right direction;
our cpp is the "old" 4.2 one--the one without the -M
option.
-----------------------cut here for msb.c------------------------------
#define msb(x) (1 << (8 * sizeof(x)) - 1)

main()
{
	int i = msb(int);
	short s = msb(short);
	char c = msb(char);

	printf("Int:  %d\n", i);
	printf("Short:  %d\n", s);
	printf("Char:  %d\n", c);
}
--------------------------end msb.c-----------------------------------
-- 
 \ / \/ From the furnace of Daemon ( ...{psuvax1,gondor,shire}!dae )
  \  / +1 814 237 1901 "I will have no covenants but proximities"  [Emerson]
   \/
                         Don't get mad.  Get even.