# HG changeset patch # User John "Elwin" Edwards # Date 1506111880 14400 # Node ID 6376b514a30bf9cf0bcf1d93489dfe3bc78d19ff # Parent d71e5e1f49cf980a59ca79fe463398a75bb374a9 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. diff -r d71e5e1f49cf -r 6376b514a30b arogue5/configure.ac --- a/arogue5/configure.ac Mon Sep 18 19:36:14 2017 -0400 +++ b/arogue5/configure.ac Fri Sep 22 16:24:40 2017 -0400 @@ -13,7 +13,7 @@ MP_WITH_CURSES # Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h]) +AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h arpa/inet.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T diff -r d71e5e1f49cf -r 6376b514a30b arogue5/mdport.c --- a/arogue5/mdport.c Mon Sep 18 19:36:14 2017 -0400 +++ b/arogue5/mdport.c Fri Sep 22 16:24:40 2017 -0400 @@ -41,11 +41,16 @@ #undef MOUSE_MOVED #elif defined(__DJGPP__) #include +#else +#include #endif #ifdef HAVE_PWD_H #include #endif +#ifdef HAVE_ARPA_INET_H +#include +#endif #ifdef HAVE_SYS_UTSNAME_H #include #endif @@ -552,7 +557,7 @@ unsigned long int md_ntohl(unsigned long int x) { -#ifdef _WIN32 +#ifndef HAVE_ARPA_INET_H if ( *((char *)&md_endian) == 0x01 ) return(x); else @@ -568,7 +573,7 @@ unsigned long int md_htonl(unsigned long int x) { -#ifdef _WIN32 +#ifndef HAVE_ARPA_INET_H if ( *((char *)&md_endian) == 0x01 ) return(x); else diff -r d71e5e1f49cf -r 6376b514a30b arogue7/configure.ac --- a/arogue7/configure.ac Mon Sep 18 19:36:14 2017 -0400 +++ b/arogue7/configure.ac Fri Sep 22 16:24:40 2017 -0400 @@ -12,7 +12,7 @@ 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 utmp.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 utmp.h term.h ncurses/term.h process.h arpa/inet.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T diff -r d71e5e1f49cf -r 6376b514a30b arogue7/mdport.c --- a/arogue7/mdport.c Mon Sep 18 19:36:14 2017 -0400 +++ b/arogue7/mdport.c Fri Sep 22 16:24:40 2017 -0400 @@ -29,6 +29,10 @@ SUCH DAMAGE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #if defined(_WIN32) #include #include @@ -40,6 +44,7 @@ #include #else #include +#include #include #include #endif @@ -73,6 +78,10 @@ #include #include +#ifdef HAVE_ARPA_INET_H +#include +#endif + #define MOD_MOVE(c) (toupper(c) ) void @@ -533,7 +542,7 @@ unsigned long int md_ntohl(unsigned long int x) { -#ifdef _WIN32 +#ifndef HAVE_ARPA_INET_H if ( *((char *)&md_endian) == 0x01 ) return(x); else @@ -549,7 +558,7 @@ unsigned long int md_htonl(unsigned long int x) { -#ifdef _WIN32 +#ifndef HAVE_ARPA_INET_H if ( *((char *)&md_endian) == 0x01 ) return(x); else diff -r d71e5e1f49cf -r 6376b514a30b rogue4/mach_dep.c --- a/rogue4/mach_dep.c Mon Sep 18 19:36:14 2017 -0400 +++ b/rogue4/mach_dep.c Fri Sep 22 16:24:40 2017 -0400 @@ -38,6 +38,11 @@ #include #include #include + +#ifdef CHECKTIME +#include +#endif + #include "rogue.h" int num_checks; /* times we've gone over in checkout() */ @@ -266,10 +271,10 @@ #ifdef CHECKTIME checktime = (CHECKTIME * 60) / num_checks; -#endif #ifdef SIGALRM alarm(checktime); #endif +#endif chmsg(msgs[num_checks - 1], ((double) checktime / 60.0)); } diff -r d71e5e1f49cf -r 6376b514a30b rogue4/mdport.c --- a/rogue4/mdport.c Mon Sep 18 19:36:14 2017 -0400 +++ b/rogue4/mdport.c Fri Sep 22 16:24:40 2017 -0400 @@ -43,6 +43,8 @@ #undef MOUSE_MOVED #elif defined(__DJGPP__) #include +#else +#include #endif #ifdef HAVE_PWD_H @@ -54,6 +56,9 @@ #ifdef HAVE_UTMPX_H #include #endif +#ifdef HAVE_ARPA_INET_H +#include +#endif #ifdef __INTERIX char *strdup(const char *s); @@ -535,7 +540,7 @@ unsigned long int md_ntohl(unsigned long int x) { -#ifdef _WIN32 +#ifndef HAVE_ARPA_INET_H if ( *((char *)&md_endian) == 0x01 ) return(x); else @@ -551,7 +556,7 @@ unsigned long int md_htonl(unsigned long int x) { -#ifdef _WIN32 +#ifndef HAVE_ARPA_INET_H if ( *((char *)&md_endian) == 0x01 ) return(x); else diff -r d71e5e1f49cf -r 6376b514a30b urogue/configure.ac --- a/urogue/configure.ac Mon Sep 18 19:36:14 2017 -0400 +++ b/urogue/configure.ac Fri Sep 22 16:24:40 2017 -0400 @@ -12,7 +12,7 @@ MP_WITH_CURSES # Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h utmpx.h term.h ncurses/term.h process.h]) +AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h utmpx.h term.h ncurses/term.h process.h arpa/inet.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_UID_T diff -r d71e5e1f49cf -r 6376b514a30b urogue/mdport.c --- a/urogue/mdport.c Mon Sep 18 19:36:14 2017 -0400 +++ b/urogue/mdport.c Fri Sep 22 16:24:40 2017 -0400 @@ -49,6 +49,7 @@ #else #include #include +#include #include #include #endif @@ -57,6 +58,10 @@ #include #include +#ifdef HAVE_ARPA_INET_H +#include +#endif + #if defined(_WIN32) && !defined(__MINGW32__) #define PATH_MAX MAX_PATH #endif @@ -544,7 +549,7 @@ unsigned long int md_ntohl(unsigned long int x) { -#ifdef _WIN32 +#ifndef HAVE_ARPA_INET_H if ( *((char *)&md_endian) == 0x01 ) return(x); else @@ -560,7 +565,7 @@ unsigned long int md_htonl(unsigned long int x) { -#ifdef _WIN32 +#ifndef HAVE_ARPA_INET_H if ( *((char *)&md_endian) == 0x01 ) return(x); else diff -r d71e5e1f49cf -r 6376b514a30b xrogue/configure.ac --- a/xrogue/configure.ac Mon Sep 18 19:36:14 2017 -0400 +++ b/xrogue/configure.ac Fri Sep 22 16:24:40 2017 -0400 @@ -12,7 +12,7 @@ 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 diff -r d71e5e1f49cf -r 6376b514a30b xrogue/state.c --- a/xrogue/state.c Mon Sep 18 19:36:14 2017 -0400 +++ b/xrogue/state.c Fri Sep 22 16:24:40 2017 -0400 @@ -52,6 +52,10 @@ #define RSXR_COORDLIST 0XABCD0016 #define RSXR_ROOMS 0XABCD0017 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #if defined(_WIN32) #include #include @@ -62,6 +66,7 @@ #include #else #include +#include #include #include #endif @@ -84,6 +89,10 @@ #include #endif +#ifdef HAVE_ARPA_INET_H +#include +#endif + int md_fileno(FILE *fp); #define READSTAT ((format_error == 0) && (read_error == 0)) @@ -3439,7 +3448,7 @@ 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 @@ unsigned long int md_htonl(unsigned long int x) { -#ifdef _WIN32 +#ifndef HAVE_ARPA_INET_H if ( *((char *)&md_endian) == 0x01 ) return(x); else