[git commit] Make more utility functions static

Ron ron at debian.org
Fri Jun 26 19:14:19 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=2291c660e546e1fa766ef0c0696bd7b074c3b9f3
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/nptl


This keeps gcc-4.4 from nagging that they have no prototypes.

Signed-off-by: Ron Lee <ron at debian.org>
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 utils/ldconfig.c    |   16 ++++++++--------
 utils/ldd.c         |   12 ++++++------
 utils/readsoname2.c |    2 +-
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/utils/ldconfig.c b/utils/ldconfig.c
index 2d4803b..d2f47f2 100644
--- a/utils/ldconfig.c
+++ b/utils/ldconfig.c
@@ -200,8 +200,8 @@ static char *xstrdup(const char *str)
 #define readsonameXX readsoname64
 #define __ELF_NATIVE_CLASS 64
 #include "readsoname2.c"
-char *readsoname(char *name, FILE *infile, int expected_type,
-		 int *type, int elfclass)
+static char *readsoname(char *name, FILE *infile, int expected_type,
+			int *type, int elfclass)
 {
 	char *res;
 
@@ -233,8 +233,8 @@ char *readsoname(char *name, FILE *infile, int expected_type,
  * If the expected, actual/deduced types missmatch we display a warning
  * and use the actual/deduced type.
  */
-char *is_shlib(const char *dir, const char *name, int *type,
-	       int *islink, int expected_type)
+static char *is_shlib(const char *dir, const char *name, int *type,
+		      int *islink, int expected_type)
 {
 	char *good = NULL;
 	char *cp, *cp2;
@@ -350,7 +350,7 @@ char *is_shlib(const char *dir, const char *name, int *type,
 }
 
 /* update the symlink to new library */
-void link_shlib(const char *dir, const char *file, const char *so)
+static void link_shlib(const char *dir, const char *file, const char *so)
 {
 	int change = 1;
 	char libname[BUFFER_SIZE];
@@ -407,7 +407,7 @@ void link_shlib(const char *dir, const char *file, const char *so)
 }
 
 /* figure out which library is greater */
-int libcmp(char *p1, char *p2)
+static int libcmp(char *p1, char *p2)
 {
 	while (*p1) {
 		if (isdigit(*p1) && isdigit(*p2)) {
@@ -439,7 +439,7 @@ struct lib {
 };
 
 /* update all shared library links in a directory */
-void scan_dir(const char *rawname)
+static void scan_dir(const char *rawname)
 {
 	DIR *dir;
 	const char *name;
@@ -581,7 +581,7 @@ void cache_write(void)
 }
 #else
 /* return the list of system-specific directories */
-char *get_extpath(void)
+static char *get_extpath(void)
 {
 	char *res = NULL, *cp;
 	FILE *file;
diff --git a/utils/ldd.c b/utils/ldd.c
index 289d163..9874a30 100644
--- a/utils/ldd.c
+++ b/utils/ldd.c
@@ -236,7 +236,7 @@ static char *elf_find_rpath(ElfW(Ehdr) *ehdr, ElfW(Dyn) *dynamic)
 	return NULL;
 }
 
-int check_elf_header(ElfW(Ehdr) *const ehdr)
+static int check_elf_header(ElfW(Ehdr) *const ehdr)
 {
 	if (!ehdr || *(uint32_t*)ehdr != ELFMAG_U32
 	 || ehdr->e_ident[EI_CLASS] != ELFCLASSM
@@ -273,7 +273,7 @@ int check_elf_header(ElfW(Ehdr) *const ehdr)
 static caddr_t cache_addr = NULL;
 static size_t cache_size = 0;
 
-int map_cache(void)
+static int map_cache(void)
 {
 	int fd;
 	struct stat st;
@@ -330,7 +330,7 @@ fail:
 	return -1;
 }
 
-int unmap_cache(void)
+static int unmap_cache(void)
 {
 	if (cache_addr == NULL || cache_addr == (caddr_t) - 1)
 		return -1;
@@ -396,8 +396,8 @@ static void search_for_named_library(char *name, char *result,
 	*result = '\0';
 }
 
-void locate_library_file(ElfW(Ehdr) *ehdr, ElfW(Dyn) *dynamic, int is_suid,
-			 struct library *lib)
+static void locate_library_file(ElfW(Ehdr) *ehdr, ElfW(Dyn) *dynamic,
+                                int is_suid, struct library *lib)
 {
 	char *buf;
 	char *path;
@@ -632,7 +632,7 @@ static struct library *find_elf_interpreter(ElfW(Ehdr) *ehdr)
 /*
 #warning "There may be two warnings here about vfork() clobbering, ignore them"
 */
-int find_dependancies(char *filename)
+static int find_dependancies(char *filename)
 {
 	int is_suid = 0;
 	FILE *thefile;
diff --git a/utils/readsoname2.c b/utils/readsoname2.c
index 6a9f007..6ff136b 100644
--- a/utils/readsoname2.c
+++ b/utils/readsoname2.c
@@ -1,4 +1,4 @@
-char *readsonameXX(char *name, FILE *infile, int expected_type, int *type)
+static char *readsonameXX(char *name, FILE *infile, int expected_type, int *type)
 {
 	ElfW(Ehdr) *epnt;
 	ElfW(Phdr) *ppnt;
-- 
1.6.3.3


More information about the uClibc-cvs mailing list