]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Always include libgfortran.h first; sanitize header dependencies.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 27 Oct 2020 17:20:57 +0000 (18:20 +0100)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 27 Oct 2020 17:20:57 +0000 (18:20 +0100)
libgfortran/ChangeLog:

* nca/coarraynative.c: Do not include util.h. Remove commented
include for stdlib.h..
* nca/collective_subroutine.c: Move #include <string.h> after
other #include statement.
* nca/hashmap.c: Include shared_memory.h and allocator.h
* nca/hashmap.h: Remove includess.
* nca/libcoarraynative.h: Include only those headers which
are needed.
* nca/shared_memory.c: Do not include util.h
* nca/shared_memory.h: Do not include other headers.
* nca/sync.c: Move include of string.h after other headers.
* nca/sync.h: Remove include of shared_memory.h and alloc.h.
* nca/util.h: Do not include stdint.h and stddef.h; include
limits.h and assert.h.
* nca/wrapper.c: Remove include for sync.h, util.h and
collective_subroutine.h. Move include of string.h after other
headers.

libgfortran/nca/coarraynative.c
libgfortran/nca/collective_subroutine.c
libgfortran/nca/hashmap.c
libgfortran/nca/hashmap.h
libgfortran/nca/libcoarraynative.h
libgfortran/nca/shared_memory.c
libgfortran/nca/shared_memory.h
libgfortran/nca/sync.c
libgfortran/nca/sync.h
libgfortran/nca/util.h
libgfortran/nca/wrapper.c

index 109bf88b30fbb49fb8dc133f1af8be493e99087e..251e7c9dd571910e29508ec828f6dc8d973c27c6 100644 (file)
@@ -27,13 +27,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "libcoarraynative.h"
 #include "allocator.h"
 #include "hashmap.h"
-#include "util.h"
 #include "lock.h"
 #include "collective_subroutine.h"
 
 #include <unistd.h>
 #include <sys/mman.h>
-// #include <stdlib.h>
 #include <sys/wait.h>
 
 #define GFORTRAN_ENV_NUM_IMAGES "GFORTRAN_NUM_IMAGES"
index cc7cbb7fbaf1db05beeed3637dd997897d801485..14bd517d5767f9416409a51099142c95980eb166 100644 (file)
@@ -22,12 +22,13 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
-#include <string.h>
 #include "libgfortran.h"
 #include "libcoarraynative.h"
 #include "collective_subroutine.h"
 #include "allocator.h"
 
+#include <string.h>
+
 void *
 get_collsub_buf (collsub_iface *ci, size_t size)
 {
index 865ec6a1488075b5f1b421dc8ca43fd0fefd1e6f..61fe966a3f02890b030b5f396b95d7a8a9530eef 100644 (file)
@@ -23,6 +23,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
 #include "libgfortran.h"
+#include "shared_memory.h"
+#include "allocator.h"
 #include "hashmap.h"
 #include <string.h>
 
index 294909515751612b51f89afdcdc5e8a991b69084..10a43d0be919635491c3ada69a5391e0d189d825 100644 (file)
@@ -24,13 +24,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #ifndef HASHMAP_H
 
-#include "shared_memory.h"
-#include "allocator.h"
-
-#include <stdint.h>
-#include <stddef.h>
-
-
 /* Data structures and variables:
 
    memid is a unique identifier for the coarray, the address of its
index 85746f3189c34da9ddceb96687d285cad0174c55..4bd7e3ca7401d403f33f9fd8cb75547e5a3ed822 100644 (file)
@@ -25,12 +25,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #ifndef COARRAY_NATIVE_HDR
 #define COARRAY_NATIVE_HDR
 
-#include "libgfortran.h"
-
-#include <sys/types.h>
-#include <stdint.h>
-#include <stdio.h>
-
 #define DEBUG_NATIVE_COARRAY 0
 
 #if defined(DEBUG_NATIVE_COARRAY) && DEBUG_NATIVE_COARRAY
@@ -39,10 +33,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #define DEBUG_PRINTF(...) do {} while(0)
 #endif
 
-#include "allocator.h"
-#include "hashmap.h"
+#include "shared_memory.h"
+#include "alloc.h"
 #include "sync.h"
-#include "lock.h"
+#include "util.h"
 #include "collective_subroutine.h"
 
 typedef struct {
index 7d68126f40fb27a3a921748e162e2c9de2b15b62..0d80b79a6b3d4abb03e9734a29c7c5e5034baaac 100644 (file)
@@ -24,13 +24,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "libgfortran.h"
 #include "libcoarraynative.h"
-#include "util.h"
+
 #include <sys/mman.h>
 #include <unistd.h>
 #include <string.h>
 
-#include "shared_memory.h"
-
 /* This implements shared memory based on POSIX mmap.  We start with
    memory block of the size of the global shared memory data, rounded
    up to one pagesize, and enlarge as needed.
index 59123688de5e78459f7036fa45810e8106edf850..09692fce601466d76200df9d48ae559007942dad 100644 (file)
@@ -25,16 +25,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #ifndef SHARED_MEMORY_H
 #define SHARED_MEMORY_H
 
-#include <stdbool.h>
-#include <stdint.h>
-#include <stddef.h>
-#include <sys/types.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <limits.h>
-
 /* A struct to serve as an opaque shared memory object.  */
 
 struct shared_memory_act;
index cd30f2f863bc26541990b26fcf411d9b51d36655..7cf5ee28d9b8bd021fda17ef4b027ffbb3665bf9 100644 (file)
@@ -23,12 +23,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
 
-#include <string.h>
-
 #include "libgfortran.h"
 #include "libcoarraynative.h"
-#include "sync.h"
-#include "util.h"
+
+#include <string.h>
 
 static void
 sync_all_init (pthread_barrier_t *b)
index 6eec14e3864fdbf9b8dec0b635d3eff81d0911a3..53aa3dcb15f4bc187a86b6229d9ae47d1d7e502f 100644 (file)
@@ -25,8 +25,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #ifndef IPSYNC_HDR
 #define IPSYNC_HDR
 
-#include "shared_memory.h"
-#include "alloc.h"
 #include <pthread.h>
 
 typedef struct {
index 9abd7adf70870ffb38271aa318fe9af200181c3c..1d3351295200eaae71f572d782a281d8df0d74af 100644 (file)
@@ -25,9 +25,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #ifndef UTIL_HDR
 #define UTIL_HDR
 
-#include <stdint.h>
-#include <stddef.h>
 #include <pthread.h>
+#include <limits.h>
+#include <assert.h>
 
 #define PTR_BITS (CHAR_BIT*sizeof(void *))
 
index b31e750ead36c4cd435ef5d61eb24f38f7e600e2..d3d50f5d2112b5ac39d22f7c8c7ffab2b3bd5053 100644 (file)
@@ -22,13 +22,11 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
-#include <string.h>
 #include "libgfortran.h"
 #include "libcoarraynative.h"
-#include "sync.h"
 #include "lock.h"
-#include "util.h"
-#include "collective_subroutine.h"
+
+#include <string.h>
 
 static inline int
 div_ru (int divident, int divisor)