From b75cdfc3e346d519589c5ef56d7bb31af6663d40 Mon Sep 17 00:00:00 2001 From: Richard Cornwell Date: Sun, 16 Feb 2020 00:32:32 -0500 Subject: [PATCH] KA10: Cleanup compiler warnings. --- PDP10/kl10_nia.c | 17 +++++++++-------- PDP10/kx10_cpu.c | 10 ++++++---- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/PDP10/kl10_nia.c b/PDP10/kl10_nia.c index 6102a71..757d7e1 100644 --- a/PDP10/kl10_nia.c +++ b/PDP10/kl10_nia.c @@ -737,7 +737,6 @@ int nia_getq(t_addr head, t_addr *entry) uint64 temp; t_addr flink; t_addr nlink; - int i; *entry = 0; /* For safty */ /* Try and get lock */ @@ -958,7 +957,6 @@ void nia_packet_debug(struct nia_device *nia, const char *action, char dst_ip[20]; char src_port[8]; char dst_port[8]; - char mac_buf[20]; char flags[64]; static struct tcp_flag_bits { const char *name; @@ -1172,7 +1170,7 @@ int nia_send_pkt(uint64 cmd) return 0; } blen = (int)(tlen & 0177777); - data = nia_cpy_to(word2, data, blen); + data = nia_cpy_to((t_addr)(word2 & AMASK), data, blen); len -= blen; if (Mem_read_word((t_addr)((word1 + 1) & AMASK), &word1, 0)) { nia_error(EBSERR); @@ -1182,7 +1180,7 @@ int nia_send_pkt(uint64 cmd) } else { data = nia_cpy_to(nia_data.cmd_entry + 9, data, len); } - if ((cmd & (NIA_FLG_PAD << 8) != 0) && + if (((cmd & (NIA_FLG_PAD << 8)) != 0) && nia_data.snd_buff.len < ETH_MIN_PACKET) { while (nia_data.snd_buff.len < ETH_MIN_PACKET) { *data = 0; @@ -1352,7 +1350,11 @@ t_stat nia_cmd_srv(UNIT * uptr) if (((cmd >> 16) & 1) != 0 || (cmd & (NIA_FLG_RESP << 8)) != 0) { nia_data.cmd_rply = nia_data.resp_hdr; } else if ((cmd & 0xff) == NIA_CMD_SND) { - nia_data.cmd_rply = M[nia_data.cmd_entry + 5]; + if (Mem_read_word(nia_data.cmd_entry + 5, &word1, 0)) { + nia_error(EBSERR); + return SCPE_OK; + } + nia_data.cmd_rply = (t_addr)(word1 & AMASK); } for(i = 0; i < len; i++) sim_debug(DEBUG_DETAIL, &nia_dev, "NIA rcmd: %d %09llx %012llo\n", @@ -1461,14 +1463,14 @@ nia_rec_pkt() nia_error(EBSERR); return 0; } - data = nia_cpy_from(word, data, blen); + data = nia_cpy_from((t_addr)(word & AMASK), data, blen); len -= blen; /* Get pointer to next segment */ if (Mem_read_word(bsd+1, &word, 0)) { nia_error(EBSERR); return 0; } - bsd = word & AMASK; + bsd = (t_addr)(word & AMASK); } for(i = 0; i < 10; i++) @@ -1565,7 +1567,6 @@ t_stat nia_set_mac (UNIT* uptr, int32 val, CONST char* cptr, void* desc) t_stat nia_reset (DEVICE *dptr) { int i; - struct nia_packet *p; for (i = 0; i < 6; i++) { if (nia_data.mac[i] != 0) diff --git a/PDP10/kx10_cpu.c b/PDP10/kx10_cpu.c index b4223e1..690b70b 100644 --- a/PDP10/kx10_cpu.c +++ b/PDP10/kx10_cpu.c @@ -2462,7 +2462,8 @@ void set_reg(int reg, uint64 value) { int Mem_read(int flag, int cur_context, int fetch) { t_addr addr; - if (AB < 020 && ((QKLB && (glb_sect == 0 || sect == 0 || (glb_sect && sect == 1))) || !QKLB)) { + if (AB < 020 && ((QKLB && (glb_sect == 0 || sect == 0 || + (glb_sect && sect == 1))) || !QKLB)) { if (xct_flag != 0 && !fetch) { if (((xct_flag & 8) != 0 && cur_context && !ptr_flg) || ((xct_flag & 4) != 0 && !cur_context && !BYF5 && !ptr_flg) || @@ -2474,7 +2475,7 @@ int Mem_read(int flag, int cur_context, int fetch) { } /* Check if invalid section */ if (QKLB && t20_page && !flag && (sect & 07740) != 0) { - fault_data = (027LL << 30) | (uint64)addr | (((uint64)sect) << 18); + fault_data = (027LL << 30) | (uint64)AB | (((uint64)sect) << 18); if (USER==0) /* U */ fault_data |= SMASK; /* BIT0 */ page_fault = 1; @@ -2499,7 +2500,8 @@ int Mem_read(int flag, int cur_context, int fetch) { int Mem_write(int flag, int cur_context) { t_addr addr; - if (AB < 020 && ((QKLB && (glb_sect == 0 || sect == 0 || (glb_sect && sect == 1))) || !QKLB)) { + if (AB < 020 && ((QKLB && (glb_sect == 0 || sect == 0 || + (glb_sect && sect == 1))) || !QKLB)) { if (xct_flag != 0) { if (((xct_flag & 8) != 0 && cur_context && !ptr_flg) || ((xct_flag & 4) != 0 && !cur_context && !BYF5 && !ptr_flg) || @@ -2511,7 +2513,7 @@ int Mem_write(int flag, int cur_context) { } /* Check if invalid section */ if (QKLB && t20_page && !flag && (sect & 07740) != 0) { - fault_data = (027LL << 30) | (uint64)addr | (((uint64)sect) << 18); + fault_data = (027LL << 30) | (uint64)AB | (((uint64)sect) << 18); if (USER==0) /* U */ fault_data |= SMASK; /* BIT0 */ page_fault = 1;