Fixed a number of bugs in the NCR 53C810 code;

64-bit Windows 86Box now compiles without warnings.
This commit is contained in:
OBattler
2017-12-13 22:39:41 +01:00
parent b297311ba3
commit 044559f4e9
23 changed files with 312 additions and 155 deletions

View File

@@ -72,7 +72,7 @@ int cksum(struct SLIRPmbuf *m, int len)
/*
* Force to even boundary.
*/
if ((1 & (long) w) && (mlen > 0)) {
if ((1 & (intptr_t) w) && (mlen > 0)) {
REDUCE;
sum <<= 8;
s_util.c[0] = *(u_int8_t *)w;

View File

@@ -209,6 +209,10 @@ typedef u_int32_t caddr32_t;
#endif
#endif
#ifdef __amd64__
typedef uintptr_t ipqp_32;
typedef uintptr_t ipasfragp_32;
#else
#if SIZEOF_CHAR_P == 4
typedef struct ipq *ipqp_32;
typedef struct ipasfrag *ipasfragp_32;
@@ -216,6 +220,7 @@ typedef struct ipasfrag *ipasfragp_32;
typedef caddr32_t ipqp_32;
typedef caddr32_t ipasfragp_32;
#endif
#endif
/*
* Overlay for ip header used by other protocols (tcp, udp).
@@ -225,7 +230,11 @@ typedef caddr32_t ipasfragp_32;
#endif
struct ipovly {
#ifdef __amd64__
uintptr_t ih_next, ih_prev; /* for protocol sequence q's */
#else
caddr32_t ih_next, ih_prev; /* for protocol sequence q's */
#endif
u_int8_t ih_x1; /* (unused) */
u_int8_t ih_pr; /* protocol */
u_int16_t ih_len; /* protocol length */
@@ -249,7 +258,11 @@ struct ipovly {
* size 28 bytes
*/
struct ipq {
#ifdef __amd64__
uintptr_t next,prev; /* to other reass headers */
#else
ipqp_32 next,prev; /* to other reass headers */
#endif
u_int8_t ipq_ttl; /* time for reass q to live */
u_int8_t ipq_p; /* protocol of this fragment */
u_int16_t ipq_id; /* sequence id for reassembly */

View File

@@ -129,8 +129,8 @@ getouraddr()
//what?!
struct quehead_32 {
u_int32_t qh_link;
u_int32_t qh_rlink;
uintptr_t qh_link;
uintptr_t qh_rlink;
};
inline void
@@ -141,10 +141,10 @@ insque_32(a, b)
register struct quehead_32 *element = (struct quehead_32 *) a;
register struct quehead_32 *head = (struct quehead_32 *) b;
element->qh_link = head->qh_link;
head->qh_link = (u_int32_t)element;
element->qh_rlink = (u_int32_t)head;
head->qh_link = (uintptr_t)element;
element->qh_rlink = (uintptr_t)head;
((struct quehead_32 *)(element->qh_link))->qh_rlink
= (u_int32_t)element;
= (uintptr_t)element;
}
inline void

View File

@@ -46,12 +46,24 @@ typedef unsigned long ioctlsockopt_t;
# include <iphlpapi.h>
# define USE_FIONBIO 1
#ifndef EWOULDBLOCK
# define EWOULDBLOCK WSAEWOULDBLOCK
#endif
#ifndef EINPROGRESS
# define EINPROGRESS WSAEINPROGRESS
#endif
#ifndef ENOTCONN
# define ENOTCONN WSAENOTCONN
#endif
#ifndef EHOSTUNREACH
# define EHOSTUNREACH WSAEHOSTUNREACH
#endif
#ifndef ENETUNREACH
# define ENETUNREACH WSAENETUNREACH
#endif
#ifndef ECONNREFUSED
# define ECONNREFUSED WSAECONNREFUSED
#endif
/* Basilisk II Router defines those */
# define udp_read_completion slirp_udp_read_completion

View File

@@ -33,7 +33,11 @@
#ifndef _TCP_H_
#define _TCP_H_
#ifdef __amd64__
typedef uintptr_t tcp_seq;
#else
typedef u_int32_t tcp_seq;
#endif
#define PR_SLOWHZ 2 /* 2 slow timeouts per second (approx) */
#define PR_FASTHZ 5 /* 5 fast timeouts per second (not important) */

View File

@@ -36,11 +36,15 @@
#include "tcpip.h"
#include "tcp_timer.h"
#ifdef __amd64__
typedef uintptr_t tcpiphdrp_32;
#else
#if SIZEOF_CHAR_P == 4
typedef struct tcpiphdr *tcpiphdrp_32;
#else
typedef u_int32_t tcpiphdrp_32;
#endif
#endif
/*
* Tcp control block, one per tcp; fields:
@@ -174,11 +178,15 @@ struct tcpcb {
* port numbers (which are no longer needed once we've located the
* tcpcb) are overlayed with an mbuf pointer.
*/
#ifdef __amd64__
typedef uintptr_t mbufp_32;
#else
#if SIZEOF_CHAR_P == 4
typedef struct SLIRPmbuf *mbufp_32;
#else
typedef u_int32_t mbufp_32;
#endif
#endif
#define REASS_MBUF(ti) (*(mbufp_32 *)&((ti)->ti_t))
/*