From 34bec0e7aae27fe52d28d879baedd052e7e437fe Mon Sep 17 00:00:00 2001
From: Uwe Schulzweida <uwe.schulzweida@mpimet.mpg.de>
Date: Mon, 3 Mar 2025 09:43:22 +0100
Subject: [PATCH] Removed unused includes

---
 src/cdf_lazy_grid.c   | 2 ++
 src/cdf_lazy_grid.h   | 2 --
 src/cdf_read.c        | 1 -
 src/cdf_util.c        | 1 -
 src/cdf_util.h        | 1 +
 src/cdf_write.c       | 1 -
 src/extra.h           | 2 ++
 src/extralib.c        | 1 -
 src/ieg.h             | 2 ++
 src/ieglib.c          | 1 -
 src/institution.c     | 1 -
 src/service.h         | 2 ++
 src/servicelib.c      | 1 -
 src/stream_cdf_time.c | 2 --
 14 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/cdf_lazy_grid.c b/src/cdf_lazy_grid.c
index 5af2914aa..65339aec2 100644
--- a/src/cdf_lazy_grid.c
+++ b/src/cdf_lazy_grid.c
@@ -3,7 +3,9 @@
 #endif
 
 #ifdef HAVE_LIBNETCDF
+#include "dmemory.h"
 #include "stream_cdf.h"
+#include "cdf_int.h"
 #include "cdf_lazy_grid.h"
 
 static struct gridVirtTable cdfLazyGridVtable;
diff --git a/src/cdf_lazy_grid.h b/src/cdf_lazy_grid.h
index ac0184ffd..3788e2622 100644
--- a/src/cdf_lazy_grid.h
+++ b/src/cdf_lazy_grid.h
@@ -19,8 +19,6 @@
 
 #include <string.h>
 
-#include "dmemory.h"
-#include "cdf_int.h"
 #include "grid.h"
 
 struct xyValGet
diff --git a/src/cdf_read.c b/src/cdf_read.c
index e78671385..487ec7fad 100644
--- a/src/cdf_read.c
+++ b/src/cdf_read.c
@@ -15,7 +15,6 @@
 #include "stream_cdf.h"
 #include "cdf_int.h"
 #include "vlist.h"
-#include "vlist_var.h"
 
 static void
 cdfReadGridTraj(stream_t *streamptr, int gridID)
diff --git a/src/cdf_util.c b/src/cdf_util.c
index 3f529d185..f4779e3f4 100644
--- a/src/cdf_util.c
+++ b/src/cdf_util.c
@@ -13,7 +13,6 @@
 #include <string.h>
 #include <ctype.h>
 
-#include "dmemory.h"
 #include "cdi.h"
 #include "cdi_int.h"
 #include "cdf_util.h"
diff --git a/src/cdf_util.h b/src/cdf_util.h
index 021f0467a..8ac9d7158 100644
--- a/src/cdf_util.h
+++ b/src/cdf_util.h
@@ -1,6 +1,7 @@
 #ifndef CDF_UTIL_H_
 #define CDF_UTIL_H_
 
+#include <stdlib.h>
 #include <stdbool.h>
 
 bool xtypeIsText(int xtype);
diff --git a/src/cdf_write.c b/src/cdf_write.c
index 84bec8bc3..4e5ece4fb 100644
--- a/src/cdf_write.c
+++ b/src/cdf_write.c
@@ -13,7 +13,6 @@
 #include "cdf.h"
 #include "cdf_int.h"
 #include "vlist.h"
-#include "vlist_var.h"
 
 void
 cdfDefVarDeflate(int ncid, int ncvarID, int shuffle, int compLevel)
diff --git a/src/extra.h b/src/extra.h
index 1c586432d..0c046b399 100644
--- a/src/extra.h
+++ b/src/extra.h
@@ -5,6 +5,8 @@
 #include "config.h"
 #endif
 
+#include <stdlib.h>
+
 enum
 {
   EXT_REAL = 1,
diff --git a/src/extralib.c b/src/extralib.c
index cf3b0a726..0bcc85454 100644
--- a/src/extralib.c
+++ b/src/extralib.c
@@ -11,7 +11,6 @@
  * next to find out what happened */
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
 
diff --git a/src/ieg.h b/src/ieg.h
index df110c2d5..cb07281d6 100644
--- a/src/ieg.h
+++ b/src/ieg.h
@@ -1,6 +1,8 @@
 #ifndef _IEG_H
 #define _IEG_H
 
+#include <stdlib.h>
+
 // clang-format off
 
 /* Level Types */
diff --git a/src/ieglib.c b/src/ieglib.c
index 067ce68ab..b5e08e2cf 100644
--- a/src/ieglib.c
+++ b/src/ieglib.c
@@ -11,7 +11,6 @@
  * next to find out what happened */
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
 
diff --git a/src/institution.c b/src/institution.c
index 0250a7dc7..6484ddb06 100644
--- a/src/institution.c
+++ b/src/institution.c
@@ -15,7 +15,6 @@
 #include <limits.h>
 
 #include "cdi.h"
-#include "cdi_int.h"
 #include "resource_handle.h"
 #include "resource_unpack.h"
 #include "namespace.h"
diff --git a/src/service.h b/src/service.h
index 9c9a5d14b..edc06842e 100644
--- a/src/service.h
+++ b/src/service.h
@@ -1,6 +1,8 @@
 #ifndef _SERVICE_H
 #define _SERVICE_H
 
+#include <stdlib.h>
+
 typedef struct
 {
   int checked;
diff --git a/src/servicelib.c b/src/servicelib.c
index 70a649f96..5c0bd113c 100644
--- a/src/servicelib.c
+++ b/src/servicelib.c
@@ -11,7 +11,6 @@
  * next to find out what happened */
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
 #include <ctype.h>
diff --git a/src/stream_cdf_time.c b/src/stream_cdf_time.c
index 8b5e662a9..1a9adac28 100644
--- a/src/stream_cdf_time.c
+++ b/src/stream_cdf_time.c
@@ -10,10 +10,8 @@
 
 #include "cdi.h"
 #include "cdi_int.h"
-#include "dmemory.h"
 #include "stream_cdf.h"
 #include "cdf_int.h"
-#include "vlist.h"
 
 static int
 cdfDefTimeBounds(int fileID, int nctimevarid, int nctimedimid, const char *taxis_name, taxis_t *taxis)
-- 
GitLab