Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c Subject: Re: #define OR || Message-ID: <11908@goofy.megatest.UUCP> Date: 2 Feb 90 03:37:42 GMT References: <15146@bfmny0.UU.NET> Organization: Megatest Corporation, San Jose, Ca Lines: 45 My news-system has been broken, first here then there, for a week or more. It looks as though I may have missed some SLM's (silly little macros) -- those infuriating little hacks that send you grepping around in .h files. A while back, I decided to keep a file of the most disgusting of the lot, all taken from actual practice. It has not grown very long, because I have not been reading much code lately, having been in high hack mode for months. The list follows. Should I add '#define OR ||' and '#define AND &&'? In other words, is this from real code, or was somebody just thinking out loud? Notice that the most serious offender in the SLM category has a place of dishonor at the very top. SLM's are presented with their original comments. #define NULL 0 #define NULL ((char*)0) #define MAGIC '\0' /* silly terminating character value */ #define forward /*empty*/ #define const /*empty*/ #define public /*empty*/ #define PUBLIC #define forever for(;;) #define PRIVATE static #define TINY short #define HUGE long #define RECORD struct #define TRUE (1==1) #define FALSE (0==1) #define TRUE (0==0) #define FALSE (0!=0) typedef enum { FALSE, TRUE } Bool; #define TRUE (1) #define FALSE (0) #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define OK 1 #define OK 0