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:
parent
90d5708d84
commit
614dcfffd2
10 changed files with 53 additions and 15 deletions
|
|
@ -13,7 +13,7 @@ AC_PROG_CC
|
||||||
MP_WITH_CURSES
|
MP_WITH_CURSES
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_HEADER_STDC
|
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.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
||||||
|
|
|
||||||
|
|
@ -41,11 +41,16 @@
|
||||||
#undef MOUSE_MOVED
|
#undef MOUSE_MOVED
|
||||||
#elif defined(__DJGPP__)
|
#elif defined(__DJGPP__)
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
#else
|
||||||
|
#include <sys/wait.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_PWD_H
|
#ifdef HAVE_PWD_H
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_SYS_UTSNAME_H
|
#ifdef HAVE_SYS_UTSNAME_H
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -552,7 +557,7 @@ int md_endian = 0x01020304;
|
||||||
unsigned long int
|
unsigned long int
|
||||||
md_ntohl(unsigned long int x)
|
md_ntohl(unsigned long int x)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifndef HAVE_ARPA_INET_H
|
||||||
if ( *((char *)&md_endian) == 0x01 )
|
if ( *((char *)&md_endian) == 0x01 )
|
||||||
return(x);
|
return(x);
|
||||||
else
|
else
|
||||||
|
|
@ -568,7 +573,7 @@ md_ntohl(unsigned long int x)
|
||||||
unsigned long int
|
unsigned long int
|
||||||
md_htonl(unsigned long int x)
|
md_htonl(unsigned long int x)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifndef HAVE_ARPA_INET_H
|
||||||
if ( *((char *)&md_endian) == 0x01 )
|
if ( *((char *)&md_endian) == 0x01 )
|
||||||
return(x);
|
return(x);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ AC_PROG_CC
|
||||||
MP_WITH_CURSES
|
MP_WITH_CURSES
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_HEADER_STDC
|
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.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,10 @@
|
||||||
SUCH DAMAGE.
|
SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <Lmcons.h>
|
#include <Lmcons.h>
|
||||||
|
|
@ -40,6 +44,7 @@
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#else
|
#else
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -73,6 +78,10 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MOD_MOVE(c) (toupper(c) )
|
#define MOD_MOVE(c) (toupper(c) )
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -533,7 +542,7 @@ int md_endian = 0x01020304;
|
||||||
unsigned long int
|
unsigned long int
|
||||||
md_ntohl(unsigned long int x)
|
md_ntohl(unsigned long int x)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifndef HAVE_ARPA_INET_H
|
||||||
if ( *((char *)&md_endian) == 0x01 )
|
if ( *((char *)&md_endian) == 0x01 )
|
||||||
return(x);
|
return(x);
|
||||||
else
|
else
|
||||||
|
|
@ -549,7 +558,7 @@ md_ntohl(unsigned long int x)
|
||||||
unsigned long int
|
unsigned long int
|
||||||
md_htonl(unsigned long int x)
|
md_htonl(unsigned long int x)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifndef HAVE_ARPA_INET_H
|
||||||
if ( *((char *)&md_endian) == 0x01 )
|
if ( *((char *)&md_endian) == 0x01 )
|
||||||
return(x);
|
return(x);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,11 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#ifdef CHECKTIME
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "rogue.h"
|
#include "rogue.h"
|
||||||
|
|
||||||
int num_checks; /* times we've gone over in checkout() */
|
int num_checks; /* times we've gone over in checkout() */
|
||||||
|
|
@ -266,9 +271,9 @@ checkout(int s)
|
||||||
|
|
||||||
#ifdef CHECKTIME
|
#ifdef CHECKTIME
|
||||||
checktime = (CHECKTIME * 60) / num_checks;
|
checktime = (CHECKTIME * 60) / num_checks;
|
||||||
#endif
|
|
||||||
#ifdef SIGALRM
|
#ifdef SIGALRM
|
||||||
alarm(checktime);
|
alarm(checktime);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
chmsg(msgs[num_checks - 1], ((double) checktime / 60.0));
|
chmsg(msgs[num_checks - 1], ((double) checktime / 60.0));
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,8 @@
|
||||||
#undef MOUSE_MOVED
|
#undef MOUSE_MOVED
|
||||||
#elif defined(__DJGPP__)
|
#elif defined(__DJGPP__)
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
#else
|
||||||
|
#include <sys/wait.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_PWD_H
|
#ifdef HAVE_PWD_H
|
||||||
|
|
@ -54,6 +56,9 @@
|
||||||
#ifdef HAVE_UTMPX_H
|
#ifdef HAVE_UTMPX_H
|
||||||
#include <utmpx.h>
|
#include <utmpx.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __INTERIX
|
#ifdef __INTERIX
|
||||||
char *strdup(const char *s);
|
char *strdup(const char *s);
|
||||||
|
|
@ -535,7 +540,7 @@ int md_endian = 0x01020304;
|
||||||
unsigned long int
|
unsigned long int
|
||||||
md_ntohl(unsigned long int x)
|
md_ntohl(unsigned long int x)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifndef HAVE_ARPA_INET_H
|
||||||
if ( *((char *)&md_endian) == 0x01 )
|
if ( *((char *)&md_endian) == 0x01 )
|
||||||
return(x);
|
return(x);
|
||||||
else
|
else
|
||||||
|
|
@ -551,7 +556,7 @@ md_ntohl(unsigned long int x)
|
||||||
unsigned long int
|
unsigned long int
|
||||||
md_htonl(unsigned long int x)
|
md_htonl(unsigned long int x)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifndef HAVE_ARPA_INET_H
|
||||||
if ( *((char *)&md_endian) == 0x01 )
|
if ( *((char *)&md_endian) == 0x01 )
|
||||||
return(x);
|
return(x);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ AC_PROG_CC
|
||||||
MP_WITH_CURSES
|
MP_WITH_CURSES
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_HEADER_STDC
|
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.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_TYPE_UID_T
|
AC_TYPE_UID_T
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@
|
||||||
#else
|
#else
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <utmpx.h>
|
#include <utmpx.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -57,6 +58,10 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
#define PATH_MAX MAX_PATH
|
#define PATH_MAX MAX_PATH
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -544,7 +549,7 @@ int md_endian = 0x01020304;
|
||||||
unsigned long int
|
unsigned long int
|
||||||
md_ntohl(unsigned long int x)
|
md_ntohl(unsigned long int x)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifndef HAVE_ARPA_INET_H
|
||||||
if ( *((char *)&md_endian) == 0x01 )
|
if ( *((char *)&md_endian) == 0x01 )
|
||||||
return(x);
|
return(x);
|
||||||
else
|
else
|
||||||
|
|
@ -560,7 +565,7 @@ md_ntohl(unsigned long int x)
|
||||||
unsigned long int
|
unsigned long int
|
||||||
md_htonl(unsigned long int x)
|
md_htonl(unsigned long int x)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifndef HAVE_ARPA_INET_H
|
||||||
if ( *((char *)&md_endian) == 0x01 )
|
if ( *((char *)&md_endian) == 0x01 )
|
||||||
return(x);
|
return(x);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ AC_PROG_CC
|
||||||
MP_WITH_CURSES
|
MP_WITH_CURSES
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_HEADER_STDC
|
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.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,10 @@
|
||||||
#define RSXR_COORDLIST 0XABCD0016
|
#define RSXR_COORDLIST 0XABCD0016
|
||||||
#define RSXR_ROOMS 0XABCD0017
|
#define RSXR_ROOMS 0XABCD0017
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <Lmcons.h>
|
#include <Lmcons.h>
|
||||||
|
|
@ -62,6 +66,7 @@
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#else
|
#else
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -84,6 +89,10 @@
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
int md_fileno(FILE *fp);
|
int md_fileno(FILE *fp);
|
||||||
|
|
||||||
#define READSTAT ((format_error == 0) && (read_error == 0))
|
#define READSTAT ((format_error == 0) && (read_error == 0))
|
||||||
|
|
@ -3439,7 +3448,7 @@ int md_endian = 0x01020304;
|
||||||
unsigned long int
|
unsigned long int
|
||||||
md_ntohl(unsigned long int x)
|
md_ntohl(unsigned long int x)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifndef HAVE_ARPA_INET_H
|
||||||
if ( *((char *)&md_endian) == 0x01 )
|
if ( *((char *)&md_endian) == 0x01 )
|
||||||
return(x);
|
return(x);
|
||||||
else
|
else
|
||||||
|
|
@ -3455,7 +3464,7 @@ md_ntohl(unsigned long int x)
|
||||||
unsigned long int
|
unsigned long int
|
||||||
md_htonl(unsigned long int x)
|
md_htonl(unsigned long int x)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifndef HAVE_ARPA_INET_H
|
||||||
if ( *((char *)&md_endian) == 0x01 )
|
if ( *((char *)&md_endian) == 0x01 )
|
||||||
return(x);
|
return(x);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue