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]
Other format: [Raw text]

[gfortran,commited] Library trivial cleanup


While preparing a non-trivial patch to cleanup the library headers and add dependency in the Makefile of libgfortran, I came across a number of files in intrinsic/ that do include "../io/io.h" while they don't use anything from this header. I suspect abusive copy-pasting (and I remember I wrote some of these files when I began contributing to gfortran).

I commited the attached patch to remove all such inclusions. In intrinsic/random.c and intrinsic/rand.c, I added an #include <gthr.h> which is needed and was previously done inside io.h.

FX
Index: intrinsics/ierrno.c
===================================================================
--- intrinsics/ierrno.c	(revision 114961)
+++ intrinsics/ierrno.c	(working copy)
@@ -33,9 +33,7 @@
 
 #include <errno.h>
 
-#include "../io/io.h"
 
-
 /* INTEGER FUNCTION IERRNO()  */
 
 extern GFC_INTEGER_4 ierrno_i4 (void);
Index: intrinsics/sleep.c
===================================================================
--- intrinsics/sleep.c	(revision 114961)
+++ intrinsics/sleep.c	(working copy)
@@ -33,8 +33,6 @@
 
 #include <errno.h>
 
-#include "../io/io.h"
-
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
Index: intrinsics/perror.c
===================================================================
--- intrinsics/perror.c	(revision 114961)
+++ intrinsics/perror.c	(working copy)
@@ -34,8 +34,6 @@
 #include <stdio.h>
 #include <errno.h>
 
-#include "../io/io.h"
-
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
Index: intrinsics/stat.c
===================================================================
--- intrinsics/stat.c	(revision 114961)
+++ intrinsics/stat.c	(working copy)
@@ -49,8 +49,6 @@
 
 #include <errno.h>
 
-#include "../io/io.h"
-
 /* SUBROUTINE STAT(FILE, SARRAY, STATUS)
    CHARACTER(len=*), INTENT(IN) :: FILE
    INTEGER, INTENT(OUT), :: SARRAY(13)
Index: intrinsics/kill.c
===================================================================
--- intrinsics/kill.c	(revision 114961)
+++ intrinsics/kill.c	(working copy)
@@ -41,8 +41,6 @@
 
 #include <errno.h>
 
-#include "../io/io.h"
-
 /* SUBROUTINE KILL(PID, SIGNAL, STATUS)
    INTEGER, INTENT(IN) :: PID, SIGNAL
    INTEGER(KIND=1), INTENT(OUT), OPTIONAL :: STATUS
Index: intrinsics/time.c
===================================================================
--- intrinsics/time.c	(revision 114961)
+++ intrinsics/time.c	(working copy)
@@ -44,9 +44,7 @@
 #  endif
 #endif
 
-#include "../io/io.h"
 
-
 /* INTEGER(KIND=4) FUNCTION TIME()  */
 
 #ifdef HAVE_TIME
Index: intrinsics/fnum.c
===================================================================
--- intrinsics/fnum.c	(revision 114961)
+++ intrinsics/fnum.c	(working copy)
@@ -31,8 +31,6 @@
 #include "config.h"
 #include "libgfortran.h"
 
-#include "../io/io.h"
-
 /* FUNCTION FNUM(UNIT)
    INTEGER FNUM
    INTEGER, INTENT(IN), :: UNIT  */
Index: intrinsics/rename.c
===================================================================
--- intrinsics/rename.c	(revision 114961)
+++ intrinsics/rename.c	(working copy)
@@ -35,8 +35,6 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "../io/io.h"
-
 /* SUBROUTINE RENAME(PATH1, PATH2, STATUS)
    CHARACTER(len=*), INTENT(IN) :: PATH1, PATH2
    INTEGER, INTENT(OUT), OPTIONAL :: STATUS  */
Index: intrinsics/symlnk.c
===================================================================
--- intrinsics/symlnk.c	(revision 114961)
+++ intrinsics/symlnk.c	(working copy)
@@ -33,8 +33,6 @@
 
 #include <errno.h>
 
-#include "../io/io.h"
-
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
Index: intrinsics/chdir.c
===================================================================
--- intrinsics/chdir.c	(revision 114961)
+++ intrinsics/chdir.c	(working copy)
@@ -33,8 +33,6 @@
 
 #include <errno.h>
 
-#include "../io/io.h"
-
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
Index: intrinsics/link.c
===================================================================
--- intrinsics/link.c	(revision 114961)
+++ intrinsics/link.c	(working copy)
@@ -33,8 +33,6 @@
 
 #include <errno.h>
 
-#include "../io/io.h"
-
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
Index: intrinsics/random.c
===================================================================
--- intrinsics/random.c	(revision 114961)
+++ intrinsics/random.c	(working copy)
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #include "libgfortran.h"
-#include "../io/io.h"
+#include <gthr.h>
 
 extern void random_r4 (GFC_REAL_4 *);
 iexport_proto(random_r4);
Index: intrinsics/rand.c
===================================================================
--- intrinsics/rand.c	(revision 114961)
+++ intrinsics/rand.c	(working copy)
@@ -37,7 +37,7 @@
 
 #include "config.h"
 #include "libgfortran.h"
-#include "../io/io.h"
+#include <gthr.h>
 
 #define GFC_RAND_A	16807
 #define GFC_RAND_M	2147483647
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 114961)
+++ ChangeLog	(working copy)
@@ -1,5 +1,21 @@
 2006-06-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
+	* intrinsics/ierrno.c: Don't include "io/io.h".
+	* intrinsics/sleep.c: Likewise.
+	* intrinsics/perror.c: Likewise.
+	* intrinsics/stat.c: Likewise.
+	* intrinsics/kill.c: Likewise.
+	* intrinsics/time.c: Likewise.
+	* intrinsics/fnum.c: Likewise.
+	* intrinsics/rename.c: Likewise.
+	* intrinsics/symlnk.c: Likewise.
+	* intrinsics/chdir.c: Likewise.
+	* intrinsics/link.c: Likewise.
+	* intrinsics/random.c: Don't include "io/io.h". Include	<gthr.h>.
+	* intrinsics/rand.c: Likewise.
+
+2006-06-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
 	PR fortran/28094
 	* Makefile.am: Add _mod_r10.F90 and _mod_r16.F90.
 	* Makefile.in: Regenerate.

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