~vcs-imports/pmake/main

« back to all changes in this revision

Viewing changes to suff.c

  • Committer: rillig
  • Date: 2020-10-19 21:17:35 UTC
  • Revision ID: rillig-20201019211735-krzbx33gs8ybwiz5
make(1): remove void pointers from suffix debug printing

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*      $NetBSD: suff.c,v 1.190 2020/10/18 17:41:06 rillig Exp $        */
 
1
/*      $NetBSD: suff.c,v 1.191 2020/10/19 21:17:35 rillig Exp $        */
2
2
 
3
3
/*
4
4
 * Copyright (c) 1988, 1989, 1990, 1993
129
129
#include "dir.h"
130
130
 
131
131
/*      "@(#)suff.c     8.4 (Berkeley) 3/21/94" */
132
 
MAKE_RCSID("$NetBSD: suff.c,v 1.190 2020/10/18 17:41:06 rillig Exp $");
 
132
MAKE_RCSID("$NetBSD: suff.c,v 1.191 2020/10/19 21:17:35 rillig Exp $");
133
133
 
134
134
#define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
135
135
#define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
2110
2110
/********************* DEBUGGING FUNCTIONS **********************/
2111
2111
 
2112
2112
static void
2113
 
SuffPrintName(void *s, void *dummy MAKE_ATTR_UNUSED)
 
2113
PrintSuffNames(const char *prefix, SuffList *suffs)
2114
2114
{
2115
 
    debug_printf("%s ", ((Suff *)s)->name);
 
2115
    SuffListNode *ln;
 
2116
 
 
2117
    debug_printf("#\t%s: ", prefix);
 
2118
    for (ln = suffs->first; ln != NULL; ln = ln->next) {
 
2119
        Suff *suff = ln->datum;
 
2120
        debug_printf("%s ", suff->name);
 
2121
    }
 
2122
    debug_printf("\n");
2116
2123
}
2117
2124
 
2118
2125
static void
2119
 
SuffPrintSuff(void *sp, void *dummy MAKE_ATTR_UNUSED)
 
2126
PrintSuff(Suff *s)
2120
2127
{
2121
 
    Suff    *s = (Suff *)sp;
2122
 
 
2123
2128
    debug_printf("# `%s' [%d] ", s->name, s->refCount);
2124
 
 
2125
2129
    if (s->flags != 0) {
2126
2130
        char flags_buf[SuffFlags_ToStringSize];
2127
2131
 
2129
2133
                     Enum_FlagsToString(flags_buf, sizeof flags_buf,
2130
2134
                                        s->flags, SuffFlags_ToStringSpecs));
2131
2135
    }
2132
 
    fputc('\n', debug_file);
2133
 
    debug_printf("#\tTo: ");
2134
 
    Lst_ForEach(s->parents, SuffPrintName, NULL);
2135
 
    fputc('\n', debug_file);
2136
 
    debug_printf("#\tFrom: ");
2137
 
    Lst_ForEach(s->children, SuffPrintName, NULL);
2138
 
    fputc('\n', debug_file);
 
2136
    debug_printf("\n");
 
2137
 
 
2138
    PrintSuffNames("To", s->parents);
 
2139
    PrintSuffNames("From", s->children);
 
2140
 
2139
2141
    debug_printf("#\tSearch Path: ");
2140
2142
    Dir_PrintPath(s->searchPath);
2141
 
    fputc('\n', debug_file);
 
2143
    debug_printf("\n");
2142
2144
}
2143
2145
 
2144
2146
static void
2145
 
SuffPrintTrans(void *tp, void *dummy MAKE_ATTR_UNUSED)
 
2147
PrintTransformation(GNode *t)
2146
2148
{
2147
 
    GNode   *t = (GNode *)tp;
2148
 
 
2149
2149
    debug_printf("%-16s:", t->name);
2150
2150
    Targ_PrintType(t->type);
2151
 
    fputc('\n', debug_file);
 
2151
    debug_printf("\n");
2152
2152
    Targ_PrintCmds(t);
2153
 
    fputc('\n', debug_file);
 
2153
    debug_printf("\n");
2154
2154
}
2155
2155
 
2156
2156
void
2157
2157
Suff_PrintAll(void)
2158
2158
{
2159
2159
    debug_printf("#*** Suffixes:\n");
2160
 
    Lst_ForEach(sufflist, SuffPrintSuff, NULL);
 
2160
    {
 
2161
        SuffListNode *ln;
 
2162
        for (ln = sufflist->first; ln != NULL; ln = ln->next)
 
2163
            PrintSuff(ln->datum);
 
2164
    }
2161
2165
 
2162
2166
    debug_printf("#*** Transformations:\n");
2163
 
    Lst_ForEach(transforms, SuffPrintTrans, NULL);
 
2167
    {
 
2168
        GNodeListNode *ln;
 
2169
        for (ln = transforms->first; ln != NULL; ln = ln->next)
 
2170
            PrintTransformation(ln->datum);
 
2171
    }
2164
2172
}