This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cppfiles.c: Small cleanup


Fixes an uninitialised variable warning (which was actually a bug), and
small cleanup.  INCLUDE_LEN_FUDGE is for VMS; and probably should have
gone at the same time as VMS support.

Neil.

	* cppfiles.c (INCLUDE_LEN_FUDGE, ENOMEM): Delete.
	(cpp_included, find_include_file): Update.
	(_cpp_compare_file_date): Make else unconditional.

Index: gcc/cppfiles.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppfiles.c,v
retrieving revision 1.108
diff -u -p -r1.108 cppfiles.c
--- cppfiles.c	2001/03/10 10:43:52	1.108
+++ cppfiles.c	2001/03/11 12:36:10
@@ -43,10 +43,6 @@ Foundation, 59 Temple Place - Suite 330,
 # define O_BINARY 0
 #endif
 
-#ifndef INCLUDE_LEN_FUDGE
-# define INCLUDE_LEN_FUDGE 0
-#endif
-
 /* If errno is inspected immediately after a system call fails, it will be
    nonzero, and no error number will ever be zero.  */
 #ifndef ENOENT
@@ -55,9 +51,6 @@ Foundation, 59 Temple Place - Suite 330,
 #ifndef ENOTDIR
 # define ENOTDIR 0
 #endif
-#ifndef ENOMEM
-# define ENOMEM 0
-#endif
 
 /* Suppress warning about function macros used w/o arguments in traditional
    C.  It is unlikely that glibc's strcmp macro helps this file at all.  */
@@ -469,8 +462,7 @@ cpp_included (pfile, fname)
     }
       
   /* Search directory path for the file.  */
-  name = (char *) alloca (strlen (fname) + pfile->max_include_len
-			  + 2 + INCLUDE_LEN_FUDGE);
+  name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
   for (path = CPP_OPTION (pfile, quote_include); path; path = path->next)
     {
       memcpy (name, path->name, path->len);
@@ -505,8 +497,7 @@ find_include_file (pfile, fname, search_
     return open_file (pfile, fname);
       
   /* Search directory path for the file.  */
-  name = (char *) alloca (strlen (fname) + pfile->max_include_len
-			  + 2 + INCLUDE_LEN_FUDGE);
+  name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
   for (path = search_start; path; path = path->next)
     {
       memcpy (name, path->name, path->len);
@@ -723,7 +714,7 @@ _cpp_compare_file_date (pfile, f)
 
   if (f->type == CPP_HEADER_NAME)
     search_start = CPP_OPTION (pfile, bracket_include);
-  else if (CPP_OPTION (pfile, ignore_srcdir))
+  else
     search_start = pfile->buffer->search_from;
 
   inc = find_include_file (pfile, fname, search_start);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]