#define OR ||

Dave Jones djones at megatest.UUCP
Fri Feb 2 14:37:42 AEST 1990


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



More information about the Comp.lang.c mailing list