[m-rev.] trivial diff: fix gcc -Wshadow warning in mkinit.c

Fergus Henderson fjh at cs.mu.OZ.AU
Tue May 8 15:54:31 AEST 2001


Estimated hours taken: 0.1
Branches: main, release

util/mkinit.c:
	Rename `basename' as `base_name', to avoid a gcc compiler warning
	with `-Wshadow'.

Workspace: /home/venus/fjh/ws-venus/mercury
Index: util/mkinit.c
===================================================================
RCS file: /home/mercury1/repository/mercury/util/mkinit.c,v
retrieving revision 1.72.6.2
diff -u -d -r1.72.6.2 mkinit.c
--- util/mkinit.c	2001/04/09 16:39:01	1.72.6.2
+++ util/mkinit.c	2001/05/08 05:52:53
@@ -261,7 +261,7 @@
 static	void	parse_options(int argc, char *argv[]);
 static	void	usage(void);
 static	void	do_path_search(void);
-static	char	*find_init_file(const char *basename);
+static	char	*find_init_file(const char *base_name);
 static	bool	file_exists(const char *filename);
 static	void	output_headers(void);
 static	int	output_sub_init_functions(const char *suffix,
@@ -460,7 +460,7 @@
 	** holding the full path name when it is no longer needed.
 	*/
 static char *
-find_init_file(const char *basename)
+find_init_file(const char *base_name)
 {
 	char *filename;
 	char *dirname;
@@ -469,12 +469,12 @@
 	int baselen;
 	int len;
 
-	if (file_exists(basename)) {
+	if (file_exists(base_name)) {
 		/* File is in current directory, so no search required */
 		return NULL;
 	}
 
-	baselen = strlen(basename);
+	baselen = strlen(base_name);
 
 	for (dir_ptr = init_file_dirs; dir_ptr != NULL;
 			dir_ptr = dir_ptr->next)
@@ -486,7 +486,7 @@
 		filename = (char *) checked_malloc(len + 1);
 		strcpy(filename, dirname);
 		filename[dirlen] = '/';
-		strcpy(filename + dirlen + 1, basename);
+		strcpy(filename + dirlen + 1, base_name);
 
 		if (file_exists(filename))
 			return filename;

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list