shithub: mc

Download patch

ref: 6a1b574d52f8c9dd3795acfdcf0f46152e942530
parent: effd3256cb0eff6a7c440548f446dc12132632b1
author: Ori Bernstein <[email protected]>
date: Mon Jun 18 17:54:34 EDT 2012

Static things up.

--- a/8/asm.h
+++ b/8/asm.h
@@ -187,6 +187,7 @@
 
 
 /* useful functions */
+size_t tysize(Type *t);
 size_t size(Node *n);
 void breakhere();
 void dumpasm(Isel *s, FILE *fd);
--- a/8/isel.c
+++ b/8/isel.c
@@ -727,7 +727,7 @@
     return as;
 }
 
-void writeblob(FILE *fd, char *p, size_t sz)
+static void writeblob(FILE *fd, char *p, size_t sz)
 {
     size_t i;
 
@@ -743,7 +743,7 @@
     }
 }
 
-void writelit(FILE *fd, Node *v)
+static void writelit(FILE *fd, Node *v)
 {
     char lbl[128];
     switch (v->lit.littype) {
--- a/8/reduce.c
+++ b/8/reduce.c
@@ -57,13 +57,13 @@
 static Node *ptrsz;
 static Type *tyword;
 
-Type *base(Type *t)
+static Type *base(Type *t)
 {
     assert(t->nsub == 1);
     return t->sub[0];
 }
 
-Node *add(Node *a, Node *b)
+static Node *add(Node *a, Node *b)
 {
     Node *n;
 
@@ -72,7 +72,7 @@
     return n;
 }
 
-Node *sub(Node *a, Node *b)
+static Node *sub(Node *a, Node *b)
 {
     Node *n;
 
@@ -81,7 +81,7 @@
     return n;
 }
 
-Node *mul(Node *a, Node *b)
+static Node *mul(Node *a, Node *b)
 {
     Node *n;
 
@@ -90,7 +90,7 @@
     return n;
 }
 
-Node *addr(Node *a, Type *bt)
+static Node *addr(Node *a, Type *bt)
 {
     Node *n;
 
@@ -102,7 +102,7 @@
     return n;
 }
 
-Node *load(Node *a)
+static Node *load(Node *a)
 {
     Node *n;
 
@@ -112,7 +112,7 @@
     return n;
 }
 
-Node *store(Node *a, Node *b)
+static Node *store(Node *a, Node *b)
 {
     Node *n;
 
@@ -121,7 +121,7 @@
     return n;
 }
 
-Node *word(int line, uint v)
+static Node *word(int line, uint v)
 {
     Node *n;
     n = mkintlit(line, v);
@@ -815,7 +815,7 @@
     return fn;
 }
 
-void fillglobls(Stab *st, Htab *globls)
+static void fillglobls(Stab *st, Htab *globls)
 {
     void **k;
     size_t i, nk;
@@ -837,7 +837,7 @@
     free(k);
 }
 
-void lowerdcl(Node *dcl, Htab *globls, Func ***fn, size_t *nfn, Node ***blob, size_t *nblob)
+static void lowerdcl(Node *dcl, Htab *globls, Func ***fn, size_t *nfn, Node ***blob, size_t *nblob)
 {
     Simp s = {0,};
     char *name;
--- a/opt/fold.c
+++ b/opt/fold.c
@@ -13,7 +13,7 @@
 #include "parse.h"
 #include "opt.h"
 
-int islit(Node *n, vlong *v)
+static int islit(Node *n, vlong *v)
 {
     Node *l;
 
@@ -26,7 +26,7 @@
     return 1;
 }
 
-int isval(Node *n, vlong val)
+static int isval(Node *n, vlong val)
 {
     vlong v;
 
@@ -35,7 +35,7 @@
     return v == val;
 }
 
-Node *val(int line, vlong val)
+static Node *val(int line, vlong val)
 {
     Node *n;
 
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -254,7 +254,7 @@
     settype(n, ft->sub[0]);
 }
 
-void checkns(Node *n, Node **ret)
+static void checkns(Node *n, Node **ret)
 {
     Node *var, *name, *nsname;
     Node **args;
--- a/parse/parse.h
+++ b/parse/parse.h
@@ -381,6 +381,9 @@
 void be32(long v, byte buf[4]);
 long host32(byte buf[4]);
 
+void wrbuf(FILE *fd, void *buf, size_t sz);
+void rdbuf(FILE *fd, void *buf, size_t sz);
+char rdbyte(FILE *fd);
 void wrbyte(FILE *fd, char val);
 char rdbyte(FILE *fd);
 void wrint(FILE *fd, long val);
--- a/parse/use.c
+++ b/parse/use.c
@@ -11,7 +11,7 @@
 
 #include "parse.h"
 
-int loaduse(FILE *f, Stab *st)
+static int loaduse(FILE *f, Stab *st)
 {
     char *pkg;
     Stab *s;