Module Name:    src
Committed By:   rillig
Date:           Tue Aug 11 18:44:52 UTC 2020

Modified Files:
        src/usr.bin/make: make.h suff.c

Log Message:
make(1): convert Suff.flags from #define to enum

This increases debugging support since the debugger can now display
symbolic names instead of an integer bit mask.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/usr.bin/make/make.h
cvs rdiff -u -r1.95 -r1.96 src/usr.bin/make/suff.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.114 src/usr.bin/make/make.h:1.115
--- src/usr.bin/make/make.h:1.114	Mon Aug 10 19:30:30 2020
+++ src/usr.bin/make/make.h	Tue Aug 11 18:44:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.114 2020/08/10 19:30:30 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.115 2020/08/11 18:44:52 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -224,7 +224,7 @@ typedef struct GNode {
     Hash_Table      context;	/* The local variables */
     Lst             commands;  	/* Creation commands */
 
-    struct _Suff    *suffix;	/* Suffix for the node (determined by
+    struct Suff     *suffix;	/* Suffix for the node (determined by
 				 * Suff_FindDeps and opaque to everyone
 				 * but the Suff module) */
     const char	    *fname;	/* filename where the GNode got defined */

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.95 src/usr.bin/make/suff.c:1.96
--- src/usr.bin/make/suff.c:1.95	Mon Aug 10 19:53:19 2020
+++ src/usr.bin/make/suff.c	Tue Aug 11 18:44:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.95 2020/08/10 19:53:19 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.96 2020/08/11 18:44:52 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.95 2020/08/10 19:53:19 rillig Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.96 2020/08/11 18:44:52 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)suff.c	8.4 (Berkeley) 3/21/94";
 #else
-__RCSID("$NetBSD: suff.c,v 1.95 2020/08/10 19:53:19 rillig Exp $");
+__RCSID("$NetBSD: suff.c,v 1.96 2020/08/11 18:44:52 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -150,16 +150,19 @@ static Lst       transforms;	/* Lst of t
 
 static int        sNum = 0;	/* Counter for assigning suffix numbers */
 
+typedef enum {
+    SUFF_INCLUDE	= 0x01,	/* One which is #include'd */
+    SUFF_LIBRARY	= 0x02,	/* One which contains a library */
+    SUFF_NULL		= 0x04	/* The empty suffix */
+} SuffFlags;
+
 /*
  * Structure describing an individual suffix.
  */
-typedef struct _Suff {
+typedef struct Suff {
     char         *name;	    	/* The suffix itself */
     int		 nameLen;	/* Length of the suffix */
-    short	 flags;      	/* Type of suffix */
-#define SUFF_INCLUDE	  0x01	    /* One which is #include'd */
-#define SUFF_LIBRARY	  0x02	    /* One which contains a library */
-#define SUFF_NULL 	  0x04	    /* The empty suffix */
+    SuffFlags	 flags;      	/* Type of suffix */
     Lst    	 searchPath;	/* The path along which files of this suffix
 				 * may be found */
     int          sNum;	      	/* The suffix number */

Reply via email to