Fix more header-related warnings.

This fixes all current default warnings with GCC7 on Linux.  That does
not mean the code is anywhere close to clean.
This commit is contained in:
John "Elwin" Edwards 2017-09-22 16:24:40 -04:00
parent 90d5708d84
commit 614dcfffd2
10 changed files with 53 additions and 15 deletions

View file

@ -12,7 +12,7 @@ AC_PROG_CC
MP_WITH_CURSES
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h term.h ncurses/term.h process.h])
AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h term.h ncurses/term.h process.h arpa/inet.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

View file

@ -52,6 +52,10 @@
#define RSXR_COORDLIST 0XABCD0016
#define RSXR_ROOMS 0XABCD0017
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if defined(_WIN32)
#include <Windows.h>
#include <Lmcons.h>
@ -62,6 +66,7 @@
#include <process.h>
#else
#include <pwd.h>
#include <sys/wait.h>
#include <sys/utsname.h>
#include <unistd.h>
#endif
@ -84,6 +89,10 @@
#include <process.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
int md_fileno(FILE *fp);
#define READSTAT ((format_error == 0) && (read_error == 0))
@ -3439,7 +3448,7 @@ int md_endian = 0x01020304;
unsigned long int
md_ntohl(unsigned long int x)
{
#ifdef _WIN32
#ifndef HAVE_ARPA_INET_H
if ( *((char *)&md_endian) == 0x01 )
return(x);
else
@ -3455,7 +3464,7 @@ md_ntohl(unsigned long int x)
unsigned long int
md_htonl(unsigned long int x)
{
#ifdef _WIN32
#ifndef HAVE_ARPA_INET_H
if ( *((char *)&md_endian) == 0x01 )
return(x);
else