aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2005-01-14 12:22:57 +0000
committerXin LI <delphij@FreeBSD.org>2005-01-14 12:22:57 +0000
commit06eda379d4263d63853cad084178254d15664c5f (patch)
tree434dbe83b1b4c5346fd59d5f3a689f92fe765729 /libexec
parentd0aa4b3fa05b76d2b2af014874e7f55d6434d4dd (diff)
downloadsrc-06eda379d4263d63853cad084178254d15664c5f.tar.gz
src-06eda379d4263d63853cad084178254d15664c5f.zip
64-bit clean + WARNS=6:
- Convert the (char *) cast+cast backs magic to memcpy(3). Without this, the resulting code is potentially risky with higher optimization levels. - Avoid same name when calling local variables, as well as global symbols. This reduces confusion for both human and compiler. - Add necessary casts, consts - Use new style function defination. - Minor style.Makefile(5) tweak - Bump WARNS?= from 0 to 6 ** for the aout code: changes are intentionally limited to ease maintaince.
Notes
Notes: svn path=/head/; revision=140241
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-aout/shlib.c7
-rw-r--r--libexec/rtld-aout/shlib.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/libexec/rtld-aout/shlib.c b/libexec/rtld-aout/shlib.c
index 9fd2c66d5bf8..39ec792a72c9 100644
--- a/libexec/rtld-aout/shlib.c
+++ b/libexec/rtld-aout/shlib.c
@@ -62,14 +62,13 @@
char **search_dirs;
int n_search_dirs;
-char *standard_search_dirs[] = {
+const char *standard_search_dirs[] = {
STANDARD_SEARCH_DIRS
};
void
-add_search_dir(name)
- char *name;
+add_search_dir(const char *name)
{
int n;
@@ -269,7 +268,7 @@ search_lib_dir(dir, name, majorp, minorp, do_dot_a)
int *minorp;
int do_dot_a;
{
- int namelen;
+ size_t namelen;
DIR *dd;
struct dirent *dp;
int best_dewey[MAXDEWEY];
diff --git a/libexec/rtld-aout/shlib.h b/libexec/rtld-aout/shlib.h
index d05690fe144e..4b6d753e573e 100644
--- a/libexec/rtld-aout/shlib.h
+++ b/libexec/rtld-aout/shlib.h
@@ -33,7 +33,7 @@
extern char **search_dirs;
extern int n_search_dirs;
-void add_search_dir __P((char *));
+void add_search_dir __P((const char *));
void add_search_path __P((char *));
void std_search_path __P((void));
int getdewey __P((int[], char *));