whitespace style in a generated file

This commit is contained in:
nhmall
2026-01-07 11:21:46 -05:00
parent 8d87886458
commit 4a4b0e60f9

View File

@@ -971,7 +971,7 @@ static void output_types(FILE *fp1)
for (k = 0; k < SIZE(readtagstypes); ++k) { for (k = 0; k < SIZE(readtagstypes); ++k) {
if (readtagstypes[k].dtclass == NHTYPE_SIMPLE) { if (readtagstypes[k].dtclass == NHTYPE_SIMPLE) {
Fprintf(fp1,"\t{NHTYPE_SIMPLE, (char *) \"%s\", sizeof(%s)},\n", Fprintf(fp1," {NHTYPE_SIMPLE, (char *) \"%s\", sizeof(%s)},\n",
readtagstypes[k].dtype, readtagstypes[k].dtype,
(strncmpi(readtagstypes[k].dtype, "Bitfield", 8) == 0) ? (strncmpi(readtagstypes[k].dtype, "Bitfield", 8) == 0) ?
"uint8_t" : "uint8_t" :
@@ -981,10 +981,10 @@ static void output_types(FILE *fp1)
"anything" : readtagstypes[k].dtype); "anything" : readtagstypes[k].dtype);
/* dtmacro(readtagstypes[k].dtype,0)); */ /* dtmacro(readtagstypes[k].dtype,0)); */
#if 0 #if 0
Fprintf(fp2, "#define %s\t%s%d\n", dtmacro(readtagstypes[k].dtype,1), Fprintf(fp2, "#define %s %s%d\n", dtmacro(readtagstypes[k].dtype,1),
(strlen(readtagstypes[k].dtype) > 12) ? "" : (strlen(readtagstypes[k].dtype) > 12) ? "" :
(strlen(readtagstypes[k].dtype) < 5) ? "\t\t" : (strlen(readtagstypes[k].dtype) < 5) ? " " :
"\t", hcnt++); " ", hcnt++);
#endif #endif
} }
} }
@@ -997,7 +997,7 @@ static void output_types(FILE *fp1)
} }
if (cnt > 0) if (cnt > 0)
Fprintf(fp1, "%s", ",\n"); Fprintf(fp1, "%s", ",\n");
Fprintf(fp1, "\t{NHTYPE_COMPLEX, (char *) \"%s\", sizeof(%s %s)}", Fprintf(fp1, " {NHTYPE_COMPLEX, (char *) \"%s\", sizeof(%s %s)}",
t->tag, t->tag,
(t->tagtype == 's') ? "struct" : "union", t->tag); (t->tagtype == 's') ? "struct" : "union", t->tag);
cnt += 1; cnt += 1;
@@ -1005,7 +1005,7 @@ static void output_types(FILE *fp1)
t = t->next; t = t->next;
} }
Fprintf(fp1, "%s", "\n};\n\n"); Fprintf(fp1, "%s", "\n};\n\n");
Fprintf(fp1, "int nhdatatypes_size(void)\n{\n\treturn SIZE(nhdatatypes);\n}\n\n"); Fprintf(fp1, "int nhdatatypes_size(void)\n{\n return SIZE(nhdatatypes);\n}\n\n");
} }
static void generate_c_files(void) static void generate_c_files(void)
@@ -1357,7 +1357,7 @@ static void generate_c_files(void)
"d_%s->%s = bitfield;\n\n", "d_%s->%s = bitfield;\n\n",
readtagstypes[k].dtype, t->tag); readtagstypes[k].dtype, t->tag);
Fprintf(SFDATATMP, Fprintf(SFDATATMP,
"\t\"%s:%s:%s\",\n", " \"%s:%s:%s\",\n",
sfparent, t->tag, ft); sfparent, t->tag, ft);
} else { } else {
/**************** not a bitfield ****************/ /**************** not a bitfield ****************/
@@ -1571,7 +1571,7 @@ static void generate_c_files(void)
strcmp(altbuf, "char") != 0 ? "" : arrbuf); strcmp(altbuf, "char") != 0 ? "" : arrbuf);
Fprintf(SFI_DATA, "%s", lbuf); Fprintf(SFI_DATA, "%s", lbuf);
Fprintf(SFDATATMP, Fprintf(SFDATATMP,
"\t\"%s:%s:%s\",\n", " \"%s:%s:%s\",\n",
sfparent, t->tag,fieldfix(ft,ssdef)); sfparent, t->tag,fieldfix(ft,ssdef));
kludge_sbrooms = FALSE; kludge_sbrooms = FALSE;
array_of_ptrs = FALSE; array_of_ptrs = FALSE;
@@ -1604,7 +1604,7 @@ static void generate_c_files(void)
} }
Fprintf(SFDATATMP,"};\n\n"); Fprintf(SFDATATMP,"};\n\n");
Fprintf(SFDATATMP, "int critical_members_count(void)\n{\n\treturn SIZE(critical_members);\n}\n\n"); Fprintf(SFDATATMP, "int critical_members_count(void)\n{\n return SIZE(critical_members);\n}\n\n");
fclose(SFO_DATA); fclose(SFO_DATA);
fclose(SFI_DATA); fclose(SFI_DATA);
@@ -1724,7 +1724,7 @@ dtmacro(const char *str,
} else if (strncmpi(c, "const ", 6) == 0) { } else if (strncmpi(c, "const ", 6) == 0) {
c = buf + 6; c = buf + 6;
} else if ((strncmpi(c, "struct ", 7) == 0) || } else if ((strncmpi(c, "struct ", 7) == 0) ||
(strncmpi(c, "struct\t", 7) == 0)) { (strncmpi(c, "struct ", 7) == 0)) {
c = buf + 7; c = buf + 7;
} else if (strncmpi(c, "union ", 6) == 0) { } else if (strncmpi(c, "union ", 6) == 0) {
c = buf + 6; c = buf + 6;
@@ -1785,7 +1785,7 @@ dtfn(const char *str,
} else if (strncmpi(c, "const ", 6) == 0) { } else if (strncmpi(c, "const ", 6) == 0) {
c = buf + 6; c = buf + 6;
} else if ((strncmpi(c, "struct ", 7) == 0) || } else if ((strncmpi(c, "struct ", 7) == 0) ||
(strncmpi(c, "struct\t", 7) == 0)) { (strncmpi(c, "struct ", 7) == 0)) {
c = buf + 7; c = buf + 7;
} else if (strncmpi(c, "union ", 6) == 0) { } else if (strncmpi(c, "union ", 6) == 0) {
c = buf + 6; c = buf + 6;