Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ucbcad.UUCP Path: utzoo!linus!decvax!microsoft!uw-beaver!tektronix!ucbcad!ucbesvax.turner From: ucbesvax.turner@ucbcad.UUCP Newsgroups: net.unix Subject: Re: typedefs, etc. - (nf) Message-ID: <1200@ucbcad.UUCP> Date: Fri, 30-Dec-83 10:33:32 EST Article-I.D.: ucbcad.1200 Posted: Fri Dec 30 10:33:32 1983 Date-Received: Sun, 1-Jan-84 02:14:26 EST Sender: notes@ucbcad.UUCP Organization: UC Berkeley CAD Group Lines: 33 #R:cincy:-116500:ucbesvax:23100004:000:646 ucbesvax!turner Dec 30 03:26:00 1983 Re: returning crafty boolean expressions typedef int BOOL; /* ?! */ That's not what I do! I have (in ~turner/include/macros.h): typedef enum { FALSE, TRUE } bool; With this bool-type, the following causes a type-clash on return value warning: bool yes( ) { return getchar( ) == 'y'; } I would have to (and am willing to) say, instead: bool yes( ) { if (getchar( ) == 'y') return TRUE; else return FALSE; } If this grosses you out, you probably wouldn't want to look at any of the rest of my code. I like weak languages to be strongly typed. --- Michael Turner (ucbvax!ucbesvax.turner)