Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make: clean up header for runtime type informat...



details:   https://anonhg.NetBSD.org/src/rev/3afc41e9b187
branches:  trunk
changeset: 1019606:3afc41e9b187
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Mar 15 16:00:05 2021 +0000

description:
make: clean up header for runtime type information for enums

An enum with 32 bits would lead to signed integer overflow anyway, so
that definition is not worth keeping even if it works on typical
2-complement platforms.

The definitions for 2, 4 and 8 enum have been unused for several months
now.

No functional change.

diffstat:

 usr.bin/make/enum.h |  62 +----------------------------------------------------
 1 files changed, 1 insertions(+), 61 deletions(-)

diffs (95 lines):

diff -r f2870574d793 -r 3afc41e9b187 usr.bin/make/enum.h
--- a/usr.bin/make/enum.h       Mon Mar 15 15:39:13 2021 +0000
+++ b/usr.bin/make/enum.h       Mon Mar 15 16:00:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: enum.h,v 1.18 2021/02/02 21:26:51 rillig Exp $ */
+/*     $NetBSD: enum.h,v 1.19 2021/03/15 16:00:05 rillig Exp $ */
 
 /*
  Copyright (c) 2020 Roland Illig <rillig%NetBSD.org@localhost>
@@ -114,19 +114,6 @@
 
 /*
  * Declare the necessary data structures for calling Enum_FlagsToString
- * for an enum with 2 flags.
- */
-#define ENUM_FLAGS_RTTI_2(typnam, v1, v2) \
-       ENUM__FLAGS_RTTI(typnam, \
-           ENUM__SPECS_2( \
-               ENUM__SPEC_1(v1), \
-               ENUM__SPEC_1(v2)), \
-           ENUM__JOIN_2( \
-               ENUM__JOIN_STR_1(v1), \
-               ENUM__JOIN_STR_1(v2)))
-
-/*
- * Declare the necessary data structures for calling Enum_FlagsToString
  * for an enum with 3 flags.
  */
 #define ENUM_FLAGS_RTTI_3(typnam, v1, v2, v3) \
@@ -140,19 +127,6 @@
 
 /*
  * Declare the necessary data structures for calling Enum_FlagsToString
- * for an enum with 4 flags.
- */
-#define ENUM_FLAGS_RTTI_4(typnam, v1, v2, v3, v4) \
-       ENUM__FLAGS_RTTI(typnam, \
-           ENUM__SPECS_2( \
-               ENUM__SPEC_2(v1, v2), \
-               ENUM__SPEC_2(v3, v4)), \
-           ENUM__JOIN_2( \
-               ENUM__JOIN_STR_2(v1, v2), \
-               ENUM__JOIN_STR_2(v3, v4)))
-
-/*
- * Declare the necessary data structures for calling Enum_FlagsToString
  * for an enum with 6 flags.
  */
 #define ENUM_FLAGS_RTTI_6(typnam, v1, v2, v3, v4, v5, v6) \
@@ -166,19 +140,6 @@
 
 /*
  * Declare the necessary data structures for calling Enum_FlagsToString
- * for an enum with 8 flags.
- */
-#define ENUM_FLAGS_RTTI_8(typnam, v1, v2, v3, v4, v5, v6, v7, v8) \
-       ENUM__FLAGS_RTTI(typnam, \
-           ENUM__SPECS_2( \
-               ENUM__SPEC_4(v1, v2, v3, v4), \
-               ENUM__SPEC_4(v5, v6, v7, v8)), \
-           ENUM__JOIN_2( \
-               ENUM__JOIN_STR_4(v1, v2, v3, v4), \
-               ENUM__JOIN_STR_4(v5, v6, v7, v8)))
-
-/*
- * Declare the necessary data structures for calling Enum_FlagsToString
  * for an enum with 9 flags.
  */
 #define ENUM_FLAGS_RTTI_9(typnam, v1, v2, v3, v4, v5, v6, v7, v8, v9) \
@@ -215,25 +176,4 @@
            ENUM__JOIN_STR_2(v29, v30), \
            ENUM__JOIN_STR_1(v31)))
 
-/*
- * Declare the necessary data structures for calling Enum_FlagsToString
- * for an enum with 32 flags.
- */
-#define ENUM_FLAGS_RTTI_32(typnam, \
-                    v01, v02, v03, v04, v05, v06, v07, v08, \
-                    v09, v10, v11, v12, v13, v14, v15, v16, \
-                    v17, v18, v19, v20, v21, v22, v23, v24, \
-                    v25, v26, v27, v28, v29, v30, v31, v32) \
-    ENUM__FLAGS_RTTI(typnam, \
-       ENUM__SPECS_2( \
-           ENUM__SPEC_16(v01, v02, v03, v04, v05, v06, v07, v08, \
-                         v09, v10, v11, v12, v13, v14, v15, v16), \
-           ENUM__SPEC_16(v17, v18, v19, v20, v21, v22, v23, v24, \
-                         v25, v26, v27, v28, v29, v30, v31, v32)), \
-       ENUM__JOIN_2( \
-           ENUM__JOIN_STR_16(v01, v02, v03, v04, v05, v06, v07, v08, \
-                             v09, v10, v11, v12, v13, v14, v15, v16), \
-           ENUM__JOIN_STR_16(v17, v18, v19, v20, v21, v22, v23, v24, \
-                             v25, v26, v27, v28, v29, v30, v31, v32)))
-
 #endif



Home | Main Index | Thread Index | Old Index