File:  [CSRG BSD Unix] / 43BSDReno / libexec / pcc / ccom.tahoe / tests / xns_seq.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

#define	SEQ_LT(a,b)	(((short)((a)-(b))) < 0)
#define	SSEQ_LT(a,b)	((util = (short)((a)-(b))), util < 0)
short util;

main() {
	unsigned short a , b;
	short c , d;
	char buf[512], s1[512], s2[512];

	for (;;) {
		scanf("%s %s", s1, s2);
		a = c = atoi(s1);
		b = d = atoi(s2);

		printf("unsigned: %x %c %x\n",
			a, a < b ? '<' : '>',  b);
		printf("signed: %x %c %x\n",
			c, c < d ? '<' : '>',  d);
		printf("SEQ_LT: %x %c %x\n",
			a, SEQ_LT(a, b) ? '<' : '>',  b);
		printf("SSEQ_LT: %x %c %x",
			a, SSEQ_LT(a, b) ? '<' : '>',  b);
		printf(", util %x\n", util);
	}
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.