git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Drop system includes from inet_pton/inet_ntop compatibility wrappers

From
Ben Walton <bwalton@artsci.utoronto.ca>
Date
Feb 5, 2012, 22:32 UTC
Message-ID
<1328481141-21037-2-git-send-email-bwalton@artsci.utoronto.ca>
In-Reply-To
<1328481141-21037-1-git-send-email-bwalton@artsci.utoronto.ca>

As both of these compatibility wrappers include git-compat-utils.h, all of the system includes were redundant.

Dropping these system includes also makes git-compat-utils.h the first include which avoids a compiler warning on Solaris due to the redefinition of _FILE_OFFSET_BITS.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 compat/inet_ntop.c |    6 ------
 compat/inet_pton.c |    6 ------
 2 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/compat/inet_ntop.c b/compat/inet_ntop.c
index 60b5a1d..90b7cc4 100644
--- a/compat/inet_ntop.c
+++ b/compat/inet_ntop.c
@@ -15,14 +15,8 @@
  * SOFTWARE.
  */
 
-#include <errno.h>
-#include <sys/types.h>
-
 #include "../git-compat-util.h"
 
-#include <stdio.h>
-#include <string.h>
-
 #ifndef NS_INADDRSZ
 #define NS_INADDRSZ	4
 #endif
diff --git a/compat/inet_pton.c b/compat/inet_pton.c
index 2ec995e..2b9a0a4 100644
--- a/compat/inet_pton.c
+++ b/compat/inet_pton.c
@@ -15,14 +15,8 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#include <errno.h>
-#include <sys/types.h>
-
 #include "../git-compat-util.h"
 
-#include <stdio.h>
-#include <string.h>
-
 #ifndef NS_INT16SZ
 #define NS_INT16SZ       2
 #endif
-- 
1.7.5.4
Previous: Ben Walton
Message 4 of 4 in “Change include order in two compat/ files to avoid compiler warning”
  1. Change include order in two compat/ files to avoid compiler warningBen Walton, Feb 5, 2012
  2. Junio C HamanoFeb 5, 2012
  3. (unknown)Ben Walton, Feb 5, 2012
  4. Drop system includes from inet_pton/inet_ntop compatibility wrappersBen Walton, Feb 5, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.