From 2c16110d942d39983c27d6437ca2b9ccdb2bcde4 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 18 May 2016 14:43:49 -0700 Subject: [PATCH] ETHER: Properly describe const MAC address parameter in eth_mac_fmt Fix problem reported in #316 --- sim_ether.c | 6 +++--- sim_ether.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sim_ether.c b/sim_ether.c index 1fe49ee5..087e1315 100644 --- a/sim_ether.c +++ b/sim_ether.c @@ -406,7 +406,7 @@ t_stat eth_mac_scan (ETH_MAC* mac, const char* strmac) return SCPE_OK; } -void eth_mac_fmt(const ETH_MAC* mac, char* buff) +void eth_mac_fmt(ETH_MAC* const mac, char* buff) { const uint8* m = (const uint8*) mac; sprintf(buff, "%02X:%02X:%02X:%02X:%02X:%02X", m[0], m[1], m[2], m[3], m[4], m[5]); @@ -521,8 +521,8 @@ void eth_packet_trace_ex(ETH_DEV* dev, const uint8 *msg, int len, const char* tx char dst[20]; const unsigned short* proto = (const unsigned short*) &msg[12]; uint32 crc = eth_crc32(0, msg, len); - eth_mac_fmt((const ETH_MAC*)msg, dst); - eth_mac_fmt((const ETH_MAC*)(msg+6), src); + eth_mac_fmt((ETH_MAC*)msg, dst); + eth_mac_fmt((ETH_MAC*)(msg+6), src); sim_debug(reason, dev->dptr, "%s dst: %s src: %s proto: 0x%04X len: %d crc: %X\n", txt, dst, src, ntohs(*proto), len, crc); if (detail) { diff --git a/sim_ether.h b/sim_ether.h index 75b70d11..6670b52a 100644 --- a/sim_ether.h +++ b/sim_ether.h @@ -357,7 +357,7 @@ t_stat eth_show_devices (FILE* st, DEVICE *dptr, /* show ethernet devices UNIT* uptr, int32 val, CONST char* desc); void eth_show_dev (FILE*st, ETH_DEV* dev); /* show ethernet device state */ -void eth_mac_fmt (const ETH_MAC* add, char* buffer); /* format ethernet mac address */ +void eth_mac_fmt (ETH_MAC* const add, char* buffer); /* format ethernet mac address */ t_stat eth_mac_scan (ETH_MAC* mac, const char* strmac); /* scan string for mac, put in mac */ t_stat ethq_init (ETH_QUE* que, int max); /* initialize FIFO queue */