shithub: mc

Download patch

ref: 507c0dc4eb7b20d87dc7ac06316e4620057e47ab
parent: 889d5c6fde975ec10bb39d08de9e7d47ec68387a
author: Ori Bernstein <[email protected]>
date: Thu May 2 07:24:45 EDT 2013

Remove useless exported functions.

--- a/parse/parse.h
+++ b/parse/parse.h
@@ -435,14 +435,6 @@
 void ldel(void *l, size_t *len, size_t idx);
 void lfree(void *l, size_t *len);
 
-/* serialization/usefiles */
-void typickle(Type *t, FILE *fd);
-void sympickle(Node *s, FILE *fd);
-void pickle(Node *n, FILE *fd);
-Type *tyunpickle(FILE *fd);
-Node *symunpickle(FILE *fd);
-Node *unpickle(FILE *fd);
-
 /* serializing/unserializing */
 void be64(vlong v, byte buf[8]);
 vlong host64(byte buf[8]);
--- a/parse/use.c
+++ b/parse/use.c
@@ -17,6 +17,8 @@
 static Stab *rdstab(FILE *fd);
 static void wrsym(FILE *fd, Node *val);
 static Node *rdsym(FILE *fd);
+static void pickle(Node *n, FILE *fd);
+static Node *unpickle(FILE *fd);
 
 /* Outputs a symbol table to file in a way that can be
  * read back usefully. Only writes declarations, types
@@ -156,16 +158,6 @@
     return n;
 }
 
-Type *tyunpickle(FILE *fd)
-{
-    return rdtype(fd);
-}
-
-Node *symunpickle(FILE *fd)
-{
-    return rdsym(fd);
-}
-
 /* Writes types to a file. Errors on
  * internal only types like Tyvar that
  * will not be meaningful in another file */
@@ -273,16 +265,6 @@
     return ty;
 }
 
-void typickle(Type *t, FILE *fd)
-{
-    wrtype(fd, t);
-}
-
-void sympickle(Node *s, FILE *fd)
-{
-    wrsym(fd, s);
-}
-
 /* Pickles a node to a file.  The format
  * is more or less equivalen to to
  * simplest serialization of the
@@ -289,7 +271,7 @@
  * in-memory representation. Minimal
  * checking is done, so a bad type can
  * crash the compiler */
-void pickle(Node *n, FILE *fd)
+static void pickle(Node *n, FILE *fd)
 {
     size_t i;
 
@@ -406,7 +388,7 @@
 /* Unpickles a node from a file. Minimal checking
  * is done. Specifically, no checks are done for
  * sane arities, a bad file can crash the compiler */
-Node *unpickle(FILE *fd)
+static Node *unpickle(FILE *fd)
 {
     size_t i;
     Ntype type;
@@ -588,11 +570,11 @@
         switch(c) {
             case 'G':
             case 'D':
-                dcl = symunpickle(f);
+                dcl = rdsym(f);
                 putdcl(s, dcl);
                 break;
             case 'T':
-                t = tyunpickle(f);
+                t = rdtype(f);
                 assert(t->type == Tyname || t->type == Tygeneric);
                 puttype(s, t->name, t);
                 u = tybase(t);
@@ -666,7 +648,7 @@
         t = gettype(st, k[i]);
         assert(t->type == Tyname || t->type == Tygeneric);
         wrbyte(f, 'T');
-        typickle(t, f);
+        wrtype(f, t);
     }
     free(k);
     k = htkeys(st->dcl, &n);
@@ -676,7 +658,7 @@
             wrbyte(f, 'G');
         else
             wrbyte(f, 'D');
-        sympickle(s, f);
+        wrsym(f, s);
     }
     free(k);
     wrbyte(f, 'Z');