aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acidtypes/type.c
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2020-01-14 11:41:08 +0100
committerPetter Rodhelind <petter.rodhelind@gmail.com>2020-01-14 11:41:08 +0100
commit02d7aa8915f9c3a3288dab01f321eb94ba219e3b (patch)
treef053238978479e408a2b83571443e132f30586ab /src/cmd/acidtypes/type.c
parentc0c9d8f883dfd3a7f5a74499d91bb95884b15873 (diff)
parent3d1382b98a502d0c34d5ba2c462396acc515016e (diff)
downloadplan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.gz
plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.bz2
plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/acidtypes/type.c')
-rw-r--r--src/cmd/acidtypes/type.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/cmd/acidtypes/type.c b/src/cmd/acidtypes/type.c
index 00897e34..0f1c2f30 100644
--- a/src/cmd/acidtypes/type.c
+++ b/src/cmd/acidtypes/type.c
@@ -95,7 +95,7 @@ typebynum(uint n1, uint n2)
t->n2 = n2;
addhash(t);
return t;
-}
+}
Type*
newtype(void)
@@ -251,10 +251,10 @@ cleanstl(char *name)
{
char *b, *p;
static char buf[65536]; /* These can be huge. */
-
+
if(strchr(name, '<') == nil)
return nonempty(name);
-
+
b = buf;
for(p = name; *p != 0; p++){
switch(*p){
@@ -443,7 +443,7 @@ char*
mkname(char *prefix, char *name)
{
static char buf[65536];
-
+
snprint(buf, sizeof buf, "%s%s", prefix, name);
return buf;
}
@@ -630,7 +630,7 @@ ttt=ttt->sub;
if(nprint == 0)
Bprint(b, "\t'X' 0 __dummy;\n");
Bprint(b, "};\n\n");
-
+
name = nameof(t, 1); /* might have smashed it */
Bprint(b, "defn %B(addr) { %B(addr, \"\"); }\n", name, mkname("indent_", name));
Bprint(b, "defn %B(addr, indent) {\n", mkname("indent_", name));
@@ -675,13 +675,13 @@ ttt=ttt->sub;
}
Bprint(b, "};\n\n");
break;
-
+
case Enum:
name = nameof(t, 1);
Bprint(b, "// enum %s\n", name);
for(j=0; j<t->n; j++)
Bprint(b, "%B = %ld;\n", fixname(t->tname[j]), t->val[j]);
-
+
Bprint(b, "%B = {\n", mkname("vals_", name));
for(j=0; j<t->n; j++)
Bprint(b, "\t%lud,\n", t->val[j]);
@@ -738,7 +738,7 @@ printtypes(Biobuf *b)
* only take one type of a given name; acid is going to do this anyway,
* and this will reduce the amount of code we output considerably.
* we could run a DFA equivalence relaxation sort of algorithm
- * to find the actual equivalence classes, and then rename types
+ * to find the actual equivalence classes, and then rename types
* appropriately, but this will do for now.
*/
all = emalloc(n*sizeof(all[0]));