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: remove unused type MFStr



details:   https://anonhg.NetBSD.org/src/rev/4de1697e78a6
branches:  trunk
changeset: 1027598:4de1697e78a6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 12 23:39:34 2021 +0000

description:
make: remove unused type MFStr

The only binary change is the line number of the assertion in
Substring_Sub.

diffstat:

 usr.bin/make/str.h |  42 +-----------------------------------------
 1 files changed, 1 insertions(+), 41 deletions(-)

diffs (63 lines):

diff -r 5128a1b6bec1 -r 4de1697e78a6 usr.bin/make/str.h
--- a/usr.bin/make/str.h        Sun Dec 12 23:32:03 2021 +0000
+++ b/usr.bin/make/str.h        Sun Dec 12 23:39:34 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: str.h,v 1.12 2021/12/12 13:43:47 rillig Exp $  */
+/*     $NetBSD: str.h,v 1.13 2021/12/12 23:39:34 rillig Exp $  */
 
 /*
  Copyright (c) 2021 Roland Illig <rillig%NetBSD.org@localhost>
@@ -39,12 +39,6 @@
        void *freeIt;
 } FStr;
 
-/* A modifiable string that may need to be freed after use. */
-typedef struct MFStr {
-       char *str;
-       void *freeIt;
-} MFStr;
-
 /* A read-only range of a character array, NOT null-terminated. */
 typedef struct Substring {
        const char *start;
@@ -111,40 +105,6 @@
 }
 
 
-MAKE_INLINE MFStr
-MFStr_Init(char *str, void *freeIt)
-{
-       MFStr mfstr;
-       mfstr.str = str;
-       mfstr.freeIt = freeIt;
-       return mfstr;
-}
-
-/* Return a string that is the sole owner of str. */
-MAKE_INLINE MFStr
-MFStr_InitOwn(char *str)
-{
-       return MFStr_Init(str, str);
-}
-
-/* Return a string that refers to the shared str. */
-MAKE_INLINE MFStr
-MFStr_InitRefer(char *str)
-{
-       return MFStr_Init(str, NULL);
-}
-
-MAKE_INLINE void
-MFStr_Done(MFStr *mfstr)
-{
-       free(mfstr->freeIt);
-#ifdef CLEANUP
-       mfstr->str = NULL;
-       mfstr->freeIt = NULL;
-#endif
-}
-
-
 MAKE_STATIC Substring
 Substring_Init(const char *start, const char *end)
 {



Home | Main Index | Thread Index | Old Index