summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-05-02 11:42:48 -0400
committerOri Bernstein <ori@eigenstate.org>2013-05-02 11:42:48 -0400
commit6ef4f09df64f4215213545cc9d1da748c830362b (patch)
tree383250868a869cd5697f4fb7b27f5a373f760c8b
parent507c0dc4eb7b20d87dc7ac06316e4620057e47ab (diff)
downloadmc-6ef4f09df64f4215213545cc9d1da748c830362b.tar.gz
Remove terminating 'Z' from usefile definition.
It's not useful. We have EOF to signal the end.
-rw-r--r--parse/use.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/parse/use.c b/parse/use.c
index 1a9d494..857f9de 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -538,6 +538,12 @@ static Stab *findstab(Stab *st, char *pkg)
return s;
}
+/* Usefile format:
+ * U<pkgname>
+ * T<pickled-type>
+ * D<picled-decl>
+ * G<pickled-decl><pickled-initializer>
+ */
int loaduse(FILE *f, Stab *st)
{
char *pkg;
@@ -566,7 +572,7 @@ int loaduse(FILE *f, Stab *st)
s = st;
}
}
- while ((c = fgetc(f)) != 'Z') {
+ while ((c = fgetc(f)) != EOF) {
switch(c) {
case 'G':
case 'D':
@@ -621,13 +627,6 @@ void readuse(Node *use, Stab *st)
die("Could not load usefile %s", use->use.name);
}
-/* Usefile format:
- * U<pkgname>
- * T<pickled-type>
- * D<picled-decl>
- * G<pickled-decl><pickled-initializer>
- * Z
- */
void writeuse(FILE *f, Node *file)
{
Stab *st;
@@ -661,5 +660,4 @@ void writeuse(FILE *f, Node *file)
wrsym(f, s);
}
free(k);
- wrbyte(f, 'Z');
}