aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2008-08-04 15:30:13 +1000
committerJon Loeliger <jdl@jdl.com>2008-08-13 13:04:39 -0500
commit01a2d8a3e9f19cb1f5ee923af23682fad783a799 (patch)
tree30c6d35e57be2f401ed48bba7dcd3d34dd4efab3
parent315c5d095ebdf29f1912186e76ab9f95e694b18a (diff)
downloaddtc-01a2d8a3e9f19cb1f5ee923af23682fad783a799.tar.gz
dtc: Make many functions 'static'
This patch marks various functions not shared between c files 'static', as they should be. There are a couple of functions in dtc, and many in the testsuite. This is *almost* enough to enable the -Wmissing-prototypes warning. It's not quite enough, because there's a mess of junk in the flex generated code which triggers that warning which I'm not yet sure how to deal with. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--data.c2
-rw-r--r--tests/dtbs_equal_ordered.c4
-rw-r--r--tests/get_name.c2
-rw-r--r--tests/get_path.c4
-rw-r--r--tests/get_phandle.c2
-rw-r--r--tests/incbin.c2
-rw-r--r--tests/mangle-layout.c6
-rw-r--r--tests/node_check_compatible.c3
-rw-r--r--tests/node_offset_by_compatible.c2
-rw-r--r--tests/node_offset_by_phandle.c2
-rw-r--r--tests/node_offset_by_prop_value.c7
-rw-r--r--tests/nopulate.c2
-rw-r--r--tests/notfound.c2
-rw-r--r--tests/parent_offset.c4
-rw-r--r--tests/path-references.c2
-rw-r--r--tests/path_offset.c2
-rw-r--r--tests/references.c2
-rw-r--r--tests/set_name.c2
-rw-r--r--tests/subnode_offset.c2
-rw-r--r--tests/supernode_atdepth_offset.c10
-rw-r--r--treesource.c2
21 files changed, 34 insertions, 32 deletions
diff --git a/data.c b/data.c
index dd2e3d3..fe555e8 100644
--- a/data.c
+++ b/data.c
@@ -217,7 +217,7 @@ struct data data_insert_at_marker(struct data d, struct marker *m,
return d;
}
-struct data data_append_markers(struct data d, struct marker *m)
+static struct data data_append_markers(struct data d, struct marker *m)
{
struct marker **mp = &d.markers;
diff --git a/tests/dtbs_equal_ordered.c b/tests/dtbs_equal_ordered.c
index a0b42ae..ed9278c 100644
--- a/tests/dtbs_equal_ordered.c
+++ b/tests/dtbs_equal_ordered.c
@@ -29,7 +29,7 @@
#include "tests.h"
#include "testdata.h"
-void compare_mem_rsv(const void *fdt1, const void *fdt2)
+static void compare_mem_rsv(const void *fdt1, const void *fdt2)
{
int i;
uint64_t addr1, size1, addr2, size2;
@@ -56,7 +56,7 @@ void compare_mem_rsv(const void *fdt1, const void *fdt2)
}
}
-void compare_structure(const void *fdt1, const void *fdt2)
+static void compare_structure(const void *fdt1, const void *fdt2)
{
int nextoffset1 = 0, nextoffset2 = 0;
int offset1, offset2;
diff --git a/tests/get_name.c b/tests/get_name.c
index 22003b4..0262a12 100644
--- a/tests/get_name.c
+++ b/tests/get_name.c
@@ -28,7 +28,7 @@
#include "tests.h"
#include "testdata.h"
-void check_name(void *fdt, const char *path)
+static void check_name(void *fdt, const char *path)
{
int offset;
const char *getname, *getname2, *checkname;
diff --git a/tests/get_path.c b/tests/get_path.c
index 0d208bb..b9c0f60 100644
--- a/tests/get_path.c
+++ b/tests/get_path.c
@@ -30,7 +30,7 @@
#define POISON ('\xff')
-void check_path_buf(void *fdt, const char *path, int pathlen, int buflen)
+static void check_path_buf(void *fdt, const char *path, int pathlen, int buflen)
{
int offset;
char buf[buflen+1];
@@ -63,7 +63,7 @@ void check_path_buf(void *fdt, const char *path, int pathlen, int buflen)
FAIL("fdt_get_path([%d bytes]) overran buffer", buflen);
}
-void check_path(void *fdt, const char *path)
+static void check_path(void *fdt, const char *path)
{
int pathlen = strlen(path);
diff --git a/tests/get_phandle.c b/tests/get_phandle.c
index f7650b8..5735733 100644
--- a/tests/get_phandle.c
+++ b/tests/get_phandle.c
@@ -28,7 +28,7 @@
#include "tests.h"
#include "testdata.h"
-void check_phandle(void *fdt, const char *path, uint32_t checkhandle)
+static void check_phandle(void *fdt, const char *path, uint32_t checkhandle)
{
int offset;
uint32_t phandle;
diff --git a/tests/incbin.c b/tests/incbin.c
index 5ab3508..76d8626 100644
--- a/tests/incbin.c
+++ b/tests/incbin.c
@@ -31,7 +31,7 @@
#define CHUNKSIZE 1024
-char *load_file(const char *name, int *len)
+static char *load_file(const char *name, int *len)
{
FILE *f;
char *buf = NULL;
diff --git a/tests/mangle-layout.c b/tests/mangle-layout.c
index bd6ac40..5be28b9 100644
--- a/tests/mangle-layout.c
+++ b/tests/mangle-layout.c
@@ -35,7 +35,7 @@ struct bufstate {
int size;
};
-void expand_buf(struct bufstate *buf, int newsize)
+static void expand_buf(struct bufstate *buf, int newsize)
{
buf->buf = realloc(buf->buf, newsize);
if (!buf->buf)
@@ -43,7 +43,7 @@ void expand_buf(struct bufstate *buf, int newsize)
buf->size = newsize;
}
-void new_header(struct bufstate *buf, int version, const void *fdt)
+static void new_header(struct bufstate *buf, int version, const void *fdt)
{
int hdrsize;
@@ -63,7 +63,7 @@ void new_header(struct bufstate *buf, int version, const void *fdt)
fdt_set_boot_cpuid_phys(buf->buf, fdt_boot_cpuid_phys(fdt));
}
-void add_block(struct bufstate *buf, int version, char block, const void *fdt)
+static void add_block(struct bufstate *buf, int version, char block, const void *fdt)
{
int align, size;
const void *src;
diff --git a/tests/node_check_compatible.c b/tests/node_check_compatible.c
index 04b6b40..23abbf5 100644
--- a/tests/node_check_compatible.c
+++ b/tests/node_check_compatible.c
@@ -29,7 +29,8 @@
#include "tests.h"
#include "testdata.h"
-void check_compatible(const void *fdt, const char *path, const char *compat)
+static void check_compatible(const void *fdt, const char *path,
+ const char *compat)
{
int offset, err;
diff --git a/tests/node_offset_by_compatible.c b/tests/node_offset_by_compatible.c
index 02e9874..2317930 100644
--- a/tests/node_offset_by_compatible.c
+++ b/tests/node_offset_by_compatible.c
@@ -29,7 +29,7 @@
#include "tests.h"
#include "testdata.h"
-void check_search(void *fdt, const char *compat, ...)
+static void check_search(void *fdt, const char *compat, ...)
{
va_list ap;
int offset = -1, target;
diff --git a/tests/node_offset_by_phandle.c b/tests/node_offset_by_phandle.c
index e9fd939..a8442f1 100644
--- a/tests/node_offset_by_phandle.c
+++ b/tests/node_offset_by_phandle.c
@@ -29,7 +29,7 @@
#include "tests.h"
#include "testdata.h"
-void check_search(void *fdt, uint32_t phandle, int target)
+static void check_search(void *fdt, uint32_t phandle, int target)
{
int offset;
diff --git a/tests/node_offset_by_prop_value.c b/tests/node_offset_by_prop_value.c
index c55110a..0f2a345 100644
--- a/tests/node_offset_by_prop_value.c
+++ b/tests/node_offset_by_prop_value.c
@@ -29,7 +29,7 @@
#include "tests.h"
#include "testdata.h"
-void vcheck_search(void *fdt, const char *propname, const void *propval,
+static void vcheck_search(void *fdt, const char *propname, const void *propval,
int proplen, va_list ap)
{
int offset = -1, target;
@@ -48,7 +48,7 @@ void vcheck_search(void *fdt, const char *propname, const void *propval,
} while (target >= 0);
}
-void check_search(void *fdt, const char *propname, const void *propval,
+static void check_search(void *fdt, const char *propname, const void *propval,
int proplen, ...)
{
va_list ap;
@@ -58,7 +58,8 @@ void check_search(void *fdt, const char *propname, const void *propval,
va_end(ap);
}
-void check_search_str(void *fdt, const char *propname, const char *propval, ...)
+static void check_search_str(void *fdt, const char *propname,
+ const char *propval, ...)
{
va_list ap;
diff --git a/tests/nopulate.c b/tests/nopulate.c
index e56839a..3cbbe21 100644
--- a/tests/nopulate.c
+++ b/tests/nopulate.c
@@ -30,7 +30,7 @@
#include "tests.h"
#include "testdata.h"
-int nopulate_struct(char *buf, const char *fdt)
+static int nopulate_struct(char *buf, const char *fdt)
{
int offset, nextoffset = 0;
uint32_t tag;
diff --git a/tests/notfound.c b/tests/notfound.c
index ae28c44..38918ad 100644
--- a/tests/notfound.c
+++ b/tests/notfound.c
@@ -28,7 +28,7 @@
#include "tests.h"
#include "testdata.h"
-void check_error(const char *s, int err)
+static void check_error(const char *s, int err)
{
if (err != -FDT_ERR_NOTFOUND)
FAIL("%s return error %s instead of -FDT_ERR_NOTFOUND", s,
diff --git a/tests/parent_offset.c b/tests/parent_offset.c
index 8336c72..e7affcc 100644
--- a/tests/parent_offset.c
+++ b/tests/parent_offset.c
@@ -28,7 +28,7 @@
#include "tests.h"
#include "testdata.h"
-int path_parent_len(const char *path)
+static int path_parent_len(const char *path)
{
const char *p = strrchr(path, '/');
@@ -40,7 +40,7 @@ int path_parent_len(const char *path)
return p - path;
}
-void check_path(struct fdt_header *fdt, const char *path)
+static void check_path(struct fdt_header *fdt, const char *path)
{
char *parentpath;
int nodeoffset, parentoffset, parentpathoffset, pathparentlen;
diff --git a/tests/path-references.c b/tests/path-references.c
index b96c5b2..9f363b3 100644
--- a/tests/path-references.c
+++ b/tests/path-references.c
@@ -28,7 +28,7 @@
#include "tests.h"
#include "testdata.h"
-void check_ref(const void *fdt, int node, const char *checkpath)
+static void check_ref(const void *fdt, int node, const char *checkpath)
{
const char *p;
int len;
diff --git a/tests/path_offset.c b/tests/path_offset.c
index 4b014ac..bb092f1 100644
--- a/tests/path_offset.c
+++ b/tests/path_offset.c
@@ -28,7 +28,7 @@
#include "tests.h"
#include "testdata.h"
-int check_subnode(void *fdt, int parent, const char *name)
+static int check_subnode(void *fdt, int parent, const char *name)
{
int offset;
const struct fdt_node_header *nh;
diff --git a/tests/references.c b/tests/references.c
index e98d450..cbc33f8 100644
--- a/tests/references.c
+++ b/tests/references.c
@@ -28,7 +28,7 @@
#include "tests.h"
#include "testdata.h"
-void check_ref(const void *fdt, int node, uint32_t checkref)
+static void check_ref(const void *fdt, int node, uint32_t checkref)
{
const uint32_t *p;
uint32_t ref;
diff --git a/tests/set_name.c b/tests/set_name.c
index 49817a9..5d1149e 100644
--- a/tests/set_name.c
+++ b/tests/set_name.c
@@ -28,7 +28,7 @@
#include "tests.h"
#include "testdata.h"
-void check_set_name(void *fdt, const char *path, const char *newname)
+static void check_set_name(void *fdt, const char *path, const char *newname)
{
int offset;
const char *getname, *oldname;
diff --git a/tests/subnode_offset.c b/tests/subnode_offset.c
index ac2f32e..17be8d8 100644
--- a/tests/subnode_offset.c
+++ b/tests/subnode_offset.c
@@ -28,7 +28,7 @@
#include "tests.h"
#include "testdata.h"
-int check_subnode(struct fdt_header *fdt, int parent, const char *name)
+static int check_subnode(struct fdt_header *fdt, int parent, const char *name)
{
int offset;
const struct fdt_node_header *nh;
diff --git a/tests/supernode_atdepth_offset.c b/tests/supernode_atdepth_offset.c
index 1245813..73f41ae 100644
--- a/tests/supernode_atdepth_offset.c
+++ b/tests/supernode_atdepth_offset.c
@@ -28,7 +28,7 @@
#include "tests.h"
#include "testdata.h"
-int path_depth(const char *path)
+static int path_depth(const char *path)
{
const char *p;
int depth = 0;
@@ -49,7 +49,7 @@ int path_depth(const char *path)
return depth;
}
-int path_prefix(const char *path, int depth)
+static int path_prefix(const char *path, int depth)
{
const char *p;
int i;
@@ -67,7 +67,7 @@ int path_prefix(const char *path, int depth)
return p - path;
}
-void check_supernode_atdepth(struct fdt_header *fdt, const char *path,
+static void check_supernode_atdepth(struct fdt_header *fdt, const char *path,
int depth)
{
int pdepth = path_depth(path);
@@ -106,7 +106,7 @@ void check_supernode_atdepth(struct fdt_header *fdt, const char *path,
"instead of %d", nodedepth, pdepth);
}
-void check_supernode_overdepth(struct fdt_header *fdt, const char *path)
+static void check_supernode_overdepth(struct fdt_header *fdt, const char *path)
{
int pdepth = path_depth(path);
int nodeoffset, err;
@@ -121,7 +121,7 @@ void check_supernode_overdepth(struct fdt_header *fdt, const char *path)
"of FDT_ERR_NOTFOUND", path, pdepth+1, err);
}
-void check_path(struct fdt_header *fdt, const char *path)
+static void check_path(struct fdt_header *fdt, const char *path)
{
int i;
diff --git a/treesource.c b/treesource.c
index ebeb6eb..1521ff1 100644
--- a/treesource.c
+++ b/treesource.c
@@ -52,7 +52,7 @@ static void write_prefix(FILE *f, int level)
fputc('\t', f);
}
-int isstring(char c)
+static int isstring(char c)
{
return (isprint(c)
|| (c == '\0')