From 7eadb3c197d6469d2496b5eedf94d4555ba912ab Mon Sep 17 00:00:00 2001 From: Richard Cornwell Date: Sun, 12 Jul 2020 21:50:25 -0400 Subject: [PATCH] ICL1900: Cleanup windows compile warnings. --- ICL1900/icl1900_cp.c | 6 +++--- ICL1900/icl1900_cpu.c | 5 +---- ICL1900/icl1900_cr.c | 6 +++--- ICL1900/icl1900_eds8.c | 5 ++--- ICL1900/icl1900_lp.c | 9 +++------ ICL1900/icl1900_mt.c | 11 +++++------ ICL1900/icl1900_mta.c | 18 +++++++++--------- ICL1900/icl1900_stdio.c | 17 ++++++++--------- ICL1900/icl1900_sys.c | 2 +- ICL1900/icl1900_tp.c | 6 +++--- ICL1900/icl1900_tr.c | 6 +++--- 11 files changed, 41 insertions(+), 50 deletions(-) diff --git a/ICL1900/icl1900_cp.c b/ICL1900/icl1900_cp.c index 9f486ba..4648b75 100644 --- a/ICL1900/icl1900_cp.c +++ b/ICL1900/icl1900_cp.c @@ -103,7 +103,7 @@ DEVICE cdp_dev = { void cdp_cmd(int dev, uint32 cmd, uint32 *resp) { - int i; + uint32 i; UNIT *uptr = NULL; *resp = 0; @@ -165,7 +165,7 @@ void cdp_cmd(int dev, uint32 cmd, uint32 *resp) { * xxxx10 Stop punch. */ void cdp_nsi_cmd(int dev, uint32 cmd) { - int i; + uint32 i; UNIT *uptr = NULL; /* Find the unit from dev */ @@ -215,7 +215,7 @@ void cdp_nsi_cmd(int dev, uint32 cmd) { * 040 BUSY */ void cdp_nsi_status(int dev, uint32 *resp) { - int i; + uint32 i; UNIT *uptr = NULL; *resp = 0; diff --git a/ICL1900/icl1900_cpu.c b/ICL1900/icl1900_cpu.c index eb0293a..c10fc8b 100644 --- a/ICL1900/icl1900_cpu.c +++ b/ICL1900/icl1900_cpu.c @@ -1840,7 +1840,6 @@ fn: } faccl &= FMASK; facch &= MMASK; -fexp: /* Check if exponent in range */ if (e1 < -256) { facch = faccl = 0; @@ -2459,7 +2458,6 @@ time_read(uint32 *word) { time_t curtim; struct tm *tptr; - int ms; curtim = time(NULL); /* get time */ tptr = localtime(&curtim); /* decompose */ @@ -2611,7 +2609,7 @@ cpu_show_mult(FILE *st, UNIT *uptr, int32 val, CONST void *desc) t_stat cpu_set_hist(UNIT * uptr, int32 val, CONST char *cptr, void *desc) { - int32 i, lnt; + int32 lnt; t_stat r; if (cptr == NULL) { @@ -2664,7 +2662,6 @@ cpu_show_hist(FILE * st, UNIT * uptr, int32 val, CONST void *desc) h = &hst[(++di) % hst_lnt]; /* entry pointer */ if (h->rc & HIST_PC) { /* instruction? */ - int i; fprintf(st, " %07o %08o %08o %08o %08o %08o %o %o %o %02o ", h->rc & M22 , h->ea, h->xr, h->ra, h->rb, h->rr, h->c, h->v, h->e, h->mode); diff --git a/ICL1900/icl1900_cr.c b/ICL1900/icl1900_cr.c index 012f581..5f522fc 100644 --- a/ICL1900/icl1900_cr.c +++ b/ICL1900/icl1900_cr.c @@ -114,7 +114,7 @@ DEVICE cdr_dev = { void cdr_cmd(int dev, uint32 cmd, uint32 *resp) { - int i; + uint32 i; UNIT *uptr = NULL; *resp = 0; @@ -179,7 +179,7 @@ void cdr_cmd(int dev, uint32 cmd, uint32 *resp) { * xxxx10 Stop reader. */ void cdr_nsi_cmd(int dev, uint32 cmd) { - int i; + uint32 i; UNIT *uptr = NULL; /* Find the unit from dev */ @@ -229,7 +229,7 @@ void cdr_nsi_cmd(int dev, uint32 cmd) { * 040 BUSY */ void cdr_nsi_status(int dev, uint32 *resp) { - int i; + uint32 i; UNIT *uptr = NULL; *resp = 0; diff --git a/ICL1900/icl1900_eds8.c b/ICL1900/icl1900_eds8.c index 015b1be..01297ff 100644 --- a/ICL1900/icl1900_eds8.c +++ b/ICL1900/icl1900_eds8.c @@ -239,7 +239,6 @@ t_stat eds8_svc (UNIT *uptr) DEVICE *dptr = &eds8_dev; int unit = (uptr - dptr->units); int dev = GET_UADDR(dptr->flags); - t_stat r; uint32 word; int i; int wc; @@ -593,8 +592,8 @@ t_stat eds8_svc (UNIT *uptr) t_stat eds8_reset (DEVICE *dptr) { - UNIT *uptr = dptr->units; - int unit; + UNIT *uptr = dptr->units; + uint32 unit; for (unit = 0; unit < dptr->numunits; unit++, uptr++) { uptr->CMD = 0; diff --git a/ICL1900/icl1900_lp.c b/ICL1900/icl1900_lp.c index a793166..5986caa 100644 --- a/ICL1900/icl1900_lp.c +++ b/ICL1900/icl1900_lp.c @@ -123,7 +123,7 @@ DEVICE lpr_dev = { void lpr_cmd(int dev, uint32 cmd, uint32 *resp) { - int i; + uint32 i; UNIT *uptr = NULL; *resp = 0; @@ -186,7 +186,7 @@ void lpr_cmd(int dev, uint32 cmd, uint32 *resp) { * xxxx10 Stop print. */ void lpr_nsi_cmd(int dev, uint32 cmd) { - int i; + uint32 i; UNIT *uptr = NULL; /* Find the unit from dev */ @@ -236,7 +236,7 @@ void lpr_nsi_cmd(int dev, uint32 cmd) { * 040 BUSY */ void lpr_nsi_status(int dev, uint32 *resp) { - int i; + uint32 i; UNIT *uptr = NULL; *resp = 0; @@ -266,9 +266,7 @@ void lpr_nsi_status(int dev, uint32 *resp) { t_stat lpr_svc (UNIT *uptr) { - t_stat r; uint8 ch; - int data; char buffer[200]; int i; int len; @@ -317,7 +315,6 @@ t_stat lpr_svc (UNIT *uptr) buffer[i++] = '\n'; buffer[i] = '\0'; -fprintf(stderr, "Buffer: %s", buffer); sim_fwrite(&buffer, 1, i, uptr->fileref); uptr->pos += i; /* Check if Done */ diff --git a/ICL1900/icl1900_mt.c b/ICL1900/icl1900_mt.c index a42fd9a..666681e 100644 --- a/ICL1900/icl1900_mt.c +++ b/ICL1900/icl1900_mt.c @@ -238,7 +238,6 @@ t_stat mt_svc (UNIT *uptr) int dev = GET_UADDR(dptr->flags); t_mtrlnt reclen; t_stat r; - uint8 ch; uint32 word; int i; int stop; @@ -278,7 +277,7 @@ t_stat mt_svc (UNIT *uptr) /* Grab three chars off buffer */ word = 0; for(i = 16; i >= 0; i-=8) { - if (uptr->POS >= uptr->hwmark) { + if ((uint32)uptr->POS >= uptr->hwmark) { /* Add in fill characters */ if (i == 8) { stop = 2; @@ -291,9 +290,9 @@ t_stat mt_svc (UNIT *uptr) } sim_debug(DEBUG_DATA, dptr, "unit=%d read %08o\n", unit, word); eor = chan_input_word(dev, &word, 0); - if (eor || uptr->POS >= uptr->hwmark) { + if (eor || (uint32)uptr->POS >= uptr->hwmark) { uptr->STATUS = (stop << 12) | STQ_TERM; - if (uptr->POS < uptr->hwmark) + if ((uint32)uptr->POS < uptr->hwmark) uptr->STATUS |= ST1_LONG; sim_debug(DEBUG_DATA, dptr, "unit=%d read done %08o %d\n", unit, uptr->STATUS, uptr->POS); uptr->CMD = 0; @@ -548,8 +547,8 @@ t_stat mt_svc (UNIT *uptr) t_stat mt_reset (DEVICE *dptr) { - UNIT *uptr = dptr->units; - int unit; + UNIT *uptr = dptr->units; + uint32 unit; for (unit = 0; unit < dptr->numunits; unit++, uptr++) { uptr->CMD = 0; diff --git a/ICL1900/icl1900_mta.c b/ICL1900/icl1900_mta.c index 53b74e9..48fbfc7 100644 --- a/ICL1900/icl1900_mta.c +++ b/ICL1900/icl1900_mta.c @@ -149,7 +149,7 @@ DEVICE mta_dev = { }; void mta_nsi_cmd(int dev, uint32 cmd) { - int d; + uint32 d; UNIT *uptr; d = dev - GET_UADDR(mta_dev.flags); @@ -186,7 +186,7 @@ void mta_nsi_cmd(int dev, uint32 cmd) { } void mta_nsi_status(int dev, uint32 *resp) { - int d; + uint32 d; UNIT *uptr; *resp = 0; @@ -268,7 +268,7 @@ t_stat mta_svc (UNIT *uptr) word = 0; uptr->STATUS &= ~CMASK; for(i = 16; i >= 0; i-=8) { - if (uptr->POS >= uptr->hwmark) { + if ((uint32)uptr->POS >= uptr->hwmark) { /* Add in fill characters */ stop = 1; if (i == 8) { @@ -289,7 +289,7 @@ t_stat mta_svc (UNIT *uptr) mode = (uptr->CMD & BCD) ? 0 : 0100; uptr->STATUS &= ~CMASK; for(i = 18; i >= 0; i-=6) { - if (stop || uptr->POS >= uptr->hwmark) { + if (stop || (uint32)uptr->POS >= uptr->hwmark) { stop = 1; ch = 074; } else { @@ -312,14 +312,14 @@ t_stat mta_svc (UNIT *uptr) M[uptr->ADDR++] = word; uptr->ADDR &= M15; uptr->CMD -= 1 << 16; - if (stop || (uptr->CMD & (M15 << 16)) == 0 || uptr->POS >= uptr->hwmark) { + if (stop || (uptr->CMD & (M15 << 16)) == 0 || (uint32)uptr->POS >= uptr->hwmark) { /* Done with transfer */ sim_debug(DEBUG_DETAIL, dptr, "unit=%d %08o left %08o\n", unit, uptr->ADDR, uptr->CMD >> 16); - if ((uptr->CMD & (M15 << 16)) == 0 && uptr->POS < uptr->hwmark) + if ((uptr->CMD & (M15 << 16)) == 0 && (uint32)uptr->POS < uptr->hwmark) uptr->STATUS |= LONGBLK; if ((uptr->CMD & BCD) != 0 && (uptr->CMD & (M15 << 16)) != 0 - && uptr->POS >= uptr->hwmark) { + && (uint32)uptr->POS >= uptr->hwmark) { uptr->STATUS |= FILLWRD; M[uptr->ADDR++] = 074747474; uptr->ADDR &= M15; @@ -623,8 +623,8 @@ t_stat mta_svc (UNIT *uptr) t_stat mta_reset (DEVICE *dptr) { - UNIT *uptr = dptr->units; - int unit; + UNIT *uptr = dptr->units; + uint32 unit; for (unit = 0; unit < dptr->numunits; unit++, uptr++) { uptr->CMD = 0; diff --git a/ICL1900/icl1900_stdio.c b/ICL1900/icl1900_stdio.c index 2f42541..b76e966 100644 --- a/ICL1900/icl1900_stdio.c +++ b/ICL1900/icl1900_stdio.c @@ -41,9 +41,9 @@ DIB nul_dib = { 0, NULL, NULL, NULL}; t_stat chan_set_devs() { - int i; - int j; - int chan; + int i; + uint32 j; + int chan; /* Clear device table */ for (i = 0; i < sizeof(devs)/sizeof(DIB *); i++) @@ -73,7 +73,7 @@ chan_set_devs() if (sim_devices[i]->units[j].flags & UNIT_DIS) continue; if (devs[chan+j] != NULL) { - fprintf(stderr, "Conflict between devices %d %s\n", chan+j, sim_devices[i]->name); + sim_printf("Conflict between devices %d %s\n", chan+j, sim_devices[i]->name); f = 0; } } @@ -90,7 +90,7 @@ chan_set_devs() if (chan < 2 || chan > 36) continue; if (devs[chan] != NULL) { - fprintf(stderr, "Conflict between devices %d %s\n", chan, sim_devices[i]->name); + sim_printf("Conflict between devices %d %s\n", chan, sim_devices[i]->name); } else { devs[chan] = dibp; } @@ -106,7 +106,7 @@ chan_set_devs() if (chan < 2 || chan > 36) continue; if (devs[chan] != NULL) { - fprintf(stderr, "Conflict between devices %d %s%d\n", chan, sim_devices[i]->name, unit); + sim_printf("Conflict between devices %d %s%d\n", chan, sim_devices[i]->name, unit); } else { devs[chan] = dibp; } @@ -126,7 +126,7 @@ set_chan(UNIT *uptr, int32 val, CONST char *cptr, void *desc) int new_chan; int cur_chan; t_stat r; - int i; + uint32 i; if (cptr == NULL) return SCPE_ARG; @@ -203,7 +203,7 @@ set_chan(UNIT *uptr, int32 val, CONST char *cptr, void *desc) devs[new_chan] = dibp; return SCPE_OK; } else { - fprintf(stderr, "Device already on channel %d\n", new_chan); + sim_printf("Device already on channel %d\n", new_chan); } return SCPE_ARG; } @@ -215,7 +215,6 @@ get_chan(FILE *st, UNIT *uptr, int32 v, CONST void *desc) DEVICE *dptr; DIB *dibp; int chan; - int i; if (uptr == NULL) return SCPE_IERR; diff --git a/ICL1900/icl1900_sys.c b/ICL1900/icl1900_sys.c index f4d80c3..1ce9e00 100755 --- a/ICL1900/icl1900_sys.c +++ b/ICL1900/icl1900_sys.c @@ -621,7 +621,7 @@ find_opcode(char *op, int *val) { int i; int v; - t_opcode *tab; + *val = -1; if (*op >= '0' && *op <= '7') { for (v = i = 0; op[i] != '\0'; i++) { diff --git a/ICL1900/icl1900_tp.c b/ICL1900/icl1900_tp.c index 1d53ba9..a44e90f 100644 --- a/ICL1900/icl1900_tp.c +++ b/ICL1900/icl1900_tp.c @@ -160,7 +160,7 @@ DEVICE ptp_dev = { void ptp_cmd(int dev, uint32 cmd, uint32 *resp) { - int i; + uint32 i; UNIT *uptr = NULL; *resp = 0; @@ -242,7 +242,7 @@ void ptp_cmd(int dev, uint32 cmd, uint32 *resp) { * 1xxxxx Punch blanks. */ void ptp_nsi_cmd(int dev, uint32 cmd) { - int i; + uint32 i; UNIT *uptr = NULL; /* Find the unit from dev */ @@ -299,7 +299,7 @@ void ptp_nsi_cmd(int dev, uint32 cmd) { * 040 BUSY */ void ptp_nsi_status(int dev, uint32 *resp) { - int i; + uint32 i; UNIT *uptr = NULL; *resp = 0; diff --git a/ICL1900/icl1900_tr.c b/ICL1900/icl1900_tr.c index 15dec6f..04b46bb 100644 --- a/ICL1900/icl1900_tr.c +++ b/ICL1900/icl1900_tr.c @@ -164,7 +164,7 @@ DEVICE ptr_dev = { void ptr_cmd(int dev, uint32 cmd, uint32 *resp) { - int i; + uint32 i; UNIT *uptr = NULL; *resp = 0; @@ -248,7 +248,7 @@ void ptr_cmd(int dev, uint32 cmd, uint32 *resp) { * 1xxxxx All characters. */ void ptr_nsi_cmd(int dev, uint32 cmd) { - int i; + uint32 i; UNIT *uptr = NULL; /* Find the unit from dev */ @@ -309,7 +309,7 @@ void ptr_nsi_cmd(int dev, uint32 cmd) { * 040 BUSY */ void ptr_nsi_status(int dev, uint32 *resp) { - int i; + uint32 i; UNIT *uptr = NULL; *resp = 0;