diff --git a/PDP10/ka10_auxcpu.c b/PDP10/ka10_auxcpu.c index 01f200ea..74dc64e2 100644 --- a/PDP10/ka10_auxcpu.c +++ b/PDP10/ka10_auxcpu.c @@ -345,7 +345,6 @@ static int auxcpu_interrupt (void) t_stat auxcpu_devio(uint32 dev, uint64 *data) { - DEVICE *dptr = &auxcpu_dev; UNIT *uptr = &auxcpu_unit[0]; switch(dev & 07) { diff --git a/PDP10/ka10_dpk.c b/PDP10/ka10_dpk.c index d83994d9..7eb0464e 100644 --- a/PDP10/ka10_dpk.c +++ b/PDP10/ka10_dpk.c @@ -130,7 +130,6 @@ static void dpk_set_ospeed (int port, uint64 data) static t_stat dpk_devio(uint32 dev, uint64 *data) { static int scan = 0; - DEVICE *dptr = &dpk_dev; int port; switch(dev & 07) { diff --git a/PDP10/ka10_imx.c b/PDP10/ka10_imx.c index b4623b12..5774d3f8 100644 --- a/PDP10/ka10_imx.c +++ b/PDP10/ka10_imx.c @@ -171,8 +171,6 @@ t_stat imx_reset (DEVICE *dptr) t_stat imx_devio(uint32 dev, uint64 *data) { - DEVICE *dptr = &imx_dev; - switch(dev & 07) { case CONO|4: sim_debug(DEBUG_CONO, &imx_dev, "%06llo\n", *data); @@ -209,12 +207,12 @@ t_stat imx_devio(uint32 dev, uint64 *data) t_stat imx_svc (UNIT *uptr) { - int max_samples; + uint64 max_samples; if (status & IMX_PACK) { - max_samples = 3; + max_samples = 3LL; } else { - max_samples = 1; + max_samples = 1LL; } if (imx_samples < max_samples) { diff --git a/PDP10/ka10_mty.c b/PDP10/ka10_mty.c index dce73314..e5c8b4f7 100644 --- a/PDP10/ka10_mty.c +++ b/PDP10/ka10_mty.c @@ -100,8 +100,6 @@ DEVICE mty_dev = { static t_stat mty_devio(uint32 dev, uint64 *data) { - DEVICE *dptr = &mty_dev; - TMLN *lp; int line; uint64 word; @@ -134,7 +132,6 @@ static t_stat mty_devio(uint32 dev, uint64 *data) word = *data; sim_debug(DEBUG_DATAIO, &mty_dev, "DATAO line %d -> %012llo\n", line, word); - lp = &mty_ldsc[line]; mty_output_word[line] = word | MTY_FIRST; mty_active_bitmask |= 1 << line; sim_activate_abs (&mty_unit[1], 0); @@ -142,7 +139,6 @@ static t_stat mty_devio(uint32 dev, uint64 *data) break; case DATAI: line = (status & MTY_LINE) >> 12; - lp = &mty_ldsc[line]; *data = mty_input_character; sim_debug(DEBUG_DATAIO, &mty_dev, "DATAI line %d -> %012llo\n", line, *data); diff --git a/PDP10/ka10_pclk.c b/PDP10/ka10_pclk.c index 4a9b602d..bcd56a31 100644 --- a/PDP10/ka10_pclk.c +++ b/PDP10/ka10_pclk.c @@ -70,7 +70,6 @@ DEVICE pclk_dev = { */ t_stat pclk_devio(uint32 dev, uint64 *data) { - DEVICE *dptr = &pclk_dev; time_t t=time(NULL); struct tm *dt; uint64 hour=12, minute=1, seconds=2, milliseconds=3; diff --git a/PDP10/ka10_pmp.c b/PDP10/ka10_pmp.c index 95311c38..96891b38 100644 --- a/PDP10/ka10_pmp.c +++ b/PDP10/ka10_pmp.c @@ -311,7 +311,7 @@ struct disk_t { const char *name; /* Type Name */ int cyl; /* Number of cylinders */ - int heads; /* Number of heads/cylinder */ + uint32 heads; /* Number of heads/cylinder */ int bpt; /* Max bytes per track */ uint8 sen_cnt; /* Number of sense bytes */ uint8 dev_type; /* Device type code */ @@ -335,7 +335,7 @@ disk_type[] = struct pmp_header { uint8 devid[8]; /* device header. */ - int heads; /* number of heads per cylinder */ + uint32 heads; /* number of heads per cylinder */ uint32 tracksize; /* size of track */ uint8 devtype; /* Hex code of last two digits of device type. */ uint8 fileseq; /* always 0. */ @@ -968,7 +968,6 @@ pmp_startcmd() { void pmp_adjpos(UNIT * uptr) { - uint16 addr = GET_UADDR(uptr->flags); struct pmp_t *data = (struct pmp_t *)(uptr->DATAPTR); uint8 *rec; int pos; @@ -1097,7 +1096,7 @@ t_stat pmp_srv(UNIT * uptr) goto index; } uptr->POS ++; - if ((uptr->POS & 0xff) >= disk_type[type].heads) { + if ((uint32)(uptr->POS & 0xff) >= disk_type[type].heads) { sim_debug(DEBUG_DETAIL, dptr, "end cyl unit=%d %02x %d\n", unit, state, data->tpos); uptr->SENSE = (SNS_ENDCYL << 8); @@ -2138,13 +2137,12 @@ int pmp_format(UNIT * uptr, int flag) { struct pmp_header hdr; struct pmp_t *data; - uint16 addr = GET_UADDR(uptr->flags); int type = GET_TYPE(uptr->flags); int tsize; int cyl; int sector; int rec; - int hd; + uint32 hd; uint32 pos; if (flag || get_yn("Initialize dasd? [Y] ", TRUE)) { @@ -2227,10 +2225,10 @@ pmp_attach(UNIT * uptr, CONST char *file) uint16 addr = GET_UADDR(uptr->flags); int flag = (sim_switches & SWMASK ('I')) != 0; t_stat r; - int i; - struct pmp_header hdr; + unsigned int i; + struct pmp_header hdr; struct pmp_t *data; - int tsize; + uint32 tsize; if ((r = attach_unit(uptr, file)) != SCPE_OK) return r; @@ -2248,7 +2246,7 @@ pmp_attach(UNIT * uptr, CONST char *file) sim_messagef(SCPE_OK, "Drive %03x=%d %d %02x %d\n\r", addr, hdr.heads, hdr.tracksize, hdr.devtype, hdr.highcyl); for (i = 0; disk_type[i].name != 0; i++) { - tsize = (disk_type[i].bpt | 0x1ff) + 1; + tsize = (uint32)((disk_type[i].bpt | 0x1ff) + 1); if (hdr.devtype == disk_type[i].dev_type && hdr.tracksize == tsize && hdr.heads == disk_type[i].heads && hdr.highcyl == disk_type[i].cyl) { if (GET_TYPE(uptr->flags) != i) { @@ -2295,7 +2293,6 @@ pmp_detach(UNIT * uptr) { struct pmp_t *data = (struct pmp_t *)uptr->DATAPTR; int type = GET_TYPE(uptr->flags); - uint16 addr = GET_UADDR(uptr->flags); int cmd = uptr->CMD & 0x7f; if (uptr->CMD & DK_CYL_DIRTY) { @@ -2403,7 +2400,6 @@ pmp_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, fprintf (st, ".\nEach drive has the following storage capacity:\n\n"); for (i = 0; disk_type[i].name != 0; i++) { int32 size = disk_type[i].bpt * disk_type[i].heads * disk_type[i].cyl; - char sm = 'K'; size /= 1024; size = (10 * size) / 1024; fprintf(st, " %-8s %4d.%1dMB\n", disk_type[i].name, size/10, size%10); diff --git a/PDP10/ka10_stk.c b/PDP10/ka10_stk.c index 1297777c..ae653400 100644 --- a/PDP10/ka10_stk.c +++ b/PDP10/ka10_stk.c @@ -359,8 +359,6 @@ static t_stat stk_svc (UNIT *uptr) t_stat stk_devio(uint32 dev, uint64 *data) { - DEVICE *dptr = &stk_dev; - switch(dev & 07) { case CONO: status &= ~STK_PIA; diff --git a/PDP10/ka10_tk10.c b/PDP10/ka10_tk10.c index 9815c29a..a9442f53 100644 --- a/PDP10/ka10_tk10.c +++ b/PDP10/ka10_tk10.c @@ -98,7 +98,6 @@ DEVICE tk10_dev = { static t_stat tk10_devio(uint32 dev, uint64 *data) { - DEVICE *dptr = &tk10_dev; TMLN *lp; int port; int ch; diff --git a/PDP10/kl10_fe.c b/PDP10/kl10_fe.c index ad97ccbb..142ad235 100644 --- a/PDP10/kl10_fe.c +++ b/PDP10/kl10_fe.c @@ -835,7 +835,7 @@ void dte_its(UNIT *uptr) { if (word == 0) cty_done++; #if (NUM_DEVS_TTY > 0) - else if (word > 0 && word < tty_desc.lines) { + else if (word > 0 && word < (uint64)tty_desc.lines) { tty_done[word-1] = 1; } #endif @@ -1793,15 +1793,6 @@ t_stat dtei_svc (UNIT *uptr) /* Handle output of characters to CTY. Started whenever there is output pending */ t_stat dteo_svc (UNIT *uptr) { - uint32 base = 0; - UNIT *optr = &dte_unit[0]; - -#if KI_22BIT -#if KL_ITS - if (!QITS) -#endif - base = eb_ptr; -#endif /* Flush out any pending CTY output */ while(not_empty(&cty_out)) { char ch = cty_out.buff[cty_out.out_ptr]; @@ -1972,7 +1963,7 @@ const char *dte_description (DEVICE *dptr) void lp20_printline(UNIT *uptr, int nl) { int trim = 0; - uint16 data1 = 1; + /* Trim off trailing blanks */ while (uptr->COL >= 0 && lp20_buffer[uptr->COL - 1] == ' ') { uptr->COL--; @@ -2027,7 +2018,6 @@ t_stat lp20_svc (UNIT *uptr) char ch; uint16 ram_ch; uint16 data1[5]; - int l = uptr->LINE; if ((uptr->flags & UNIT_ATT) == 0) return SCPE_OK; @@ -2055,7 +2045,7 @@ t_stat lp20_svc (UNIT *uptr) while (not_empty(&lp20_queue)) { ch = lp20_queue.buff[lp20_queue.out_ptr]; inco(&lp20_queue); - ram_ch = lp20_ram[ch]; + ram_ch = lp20_ram[(int)ch]; /* If previous was delimiter or translation do it */ if (uptr->LPST & DELFLG || (ram_ch &(LP20_RAM_DEL|LP20_RAM_TRN)) != 0) { @@ -2283,7 +2273,6 @@ t_stat ttyo_svc (UNIT *uptr) { t_stat r; int32 ln; - int n = 0; TMLN *lp; if ((tty_unit[0].flags & UNIT_ATT) == 0) /* attached? */ diff --git a/PDP10/kl10_nia.c b/PDP10/kl10_nia.c index 734649a6..2b778f04 100644 --- a/PDP10/kl10_nia.c +++ b/PDP10/kl10_nia.c @@ -713,9 +713,12 @@ uint8 *nia_cpy_from(t_addr addr, uint8 *data, int len) case 1: word = (uint64)(*data++) << 28; break; + default: + word = 0; + break; } + M[addr++] = word; } - M[addr++] = word; return data; } @@ -1200,7 +1203,6 @@ int nia_send_pkt(uint64 cmd) */ t_stat nia_cmd_srv(UNIT * uptr) { - t_addr free_q = nia_data.unk_hdr; uint64 word1, word2; uint32 cmd; int len, i; diff --git a/PDP10/kx10_cpu.c b/PDP10/kx10_cpu.c index 59b88816..63251934 100644 --- a/PDP10/kx10_cpu.c +++ b/PDP10/kx10_cpu.c @@ -1275,8 +1275,6 @@ t_stat null_dev(uint32 dev, uint64 *data) { } #if KL -static int timer_irq, timer_flg; - void update_times(int tim) { @@ -2303,7 +2301,6 @@ pg_loop: */ int page_lookup(t_addr addr, int flag, t_addr *loc, int wr, int cur_context, int fetch) { int data; - int base = 0; int page = (RMASK & addr) >> 9; int uf = (FLAGS & USER) != 0; int pub = (FLAGS & PUBLIC) != 0; @@ -2524,7 +2521,7 @@ int Mem_read(int flag, int cur_context, int fetch) { } else { if (!page_lookup(AB, flag, &addr, 0, cur_context, fetch)) return 1; - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { irq_flags |= 02000; return 1; } @@ -2562,7 +2559,7 @@ int Mem_write(int flag, int cur_context) { } else { if (!page_lookup(AB, flag, &addr, 1, cur_context, 0)) return 1; - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { irq_flags |= 02000; return 1; } @@ -2617,11 +2614,10 @@ int exec_page_lookup(t_addr addr, int wr, t_addr *loc) int Mem_examine_word(int n, int wrd, uint64 *data) { t_addr addr = 0144 + (8 * n) + eb_ptr; - int base = 0; if (addr >= MEMSIZE) return 1; - if (M[addr] == 0 || wrd > M[addr]) + if (M[addr] == 0 || (uint64)wrd > M[addr]) return 1; addr = (M[addr+1] + wrd) & RMASK; if (exec_page_lookup(addr, 0, &addr)) @@ -2632,11 +2628,10 @@ int Mem_examine_word(int n, int wrd, uint64 *data) { int Mem_deposit_word(int n, int wrd, uint64 *data) { t_addr addr = 0146 + (8 * n) + eb_ptr; - int base = 0; if (addr >= MEMSIZE) return 1; - if (M[addr] == 0 || wrd > M[addr]) + if (M[addr] == 0 || (uint64)wrd > M[addr]) return 1; addr = (M[addr+1] + wrd) & RMASK; if (exec_page_lookup(addr, 1, &addr)) @@ -2802,7 +2797,6 @@ load_tlb(int uf, int page) */ int page_lookup(t_addr addr, int flag, t_addr *loc, int wr, int cur_context, int fetch) { int data; - int base = 0; int page = (RMASK & addr) >> 9; int uf = (FLAGS & USER) != 0; int pub = (FLAGS & PUBLIC) != 0; @@ -2928,7 +2922,7 @@ int Mem_read(int flag, int cur_context, int fetch) { read: if (!page_lookup(AB, flag, &addr, 0, cur_context, fetch)) return 1; - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -2967,7 +2961,7 @@ int Mem_write(int flag, int cur_context) { write: if (!page_lookup(AB, flag, &addr, 1, cur_context, 0)) return 1; - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -2993,12 +2987,12 @@ write: int its_load_tlb(uint32 reg, int page, uint32 *tlb) { uint64 data; int len = (reg >> 19) & 0177; - int entry = (reg & 01777777) + ((page & 0377) >> 1); + unsigned int entry = (reg & 01777777) + ((page & 0377) >> 1); if ((page >> 1) > len) { fault_data |= 0200; return 1; } - if (entry >= (int)MEMSIZE) { + if (entry >= MEMSIZE) { nxm_flag = 1; fault_data |= 0400; return 1; @@ -3027,7 +3021,6 @@ int its_load_tlb(uint32 reg, int page, uint32 *tlb) { int page_lookup_its(t_addr addr, int flag, t_addr *loc, int wr, int cur_context, int fetch) { uint64 data; - int base = 0; int page = (RMASK & addr) >> 10; int acc; int uf = (FLAGS & USER) != 0; @@ -3185,7 +3178,7 @@ int Mem_read_its(int flag, int cur_context, int fetch) { } } #endif - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -3231,7 +3224,7 @@ int Mem_write_its(int flag, int cur_context) { } } #endif - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -3281,7 +3274,6 @@ int page_lookup_bbn(t_addr addr, int flag, t_addr *loc, int wr, int cur_context, uint32 tlb_data; uint64 traps; int base = 0; - int trap = 0; int lvl = 0; int page = (RMASK & addr) >> 9; int uf = (FLAGS & USER) != 0; @@ -3520,7 +3512,7 @@ int Mem_read_bbn(int flag, int cur_context, int fetch) { MB = get_reg(AB); return 0; } - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -3550,7 +3542,7 @@ int Mem_write_bbn(int flag, int cur_context) { set_reg(AB, MB); return 0; } - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -3609,7 +3601,7 @@ int Mem_read_waits(int flag, int cur_context, int fetch) { } if (!page_lookup_waits(AB, flag, &addr, 0, cur_context, fetch)) return 1; - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -3636,7 +3628,7 @@ int Mem_write_waits(int flag, int cur_context) { } if (!page_lookup_waits(AB, flag, &addr, 1, cur_context, 0)) return 1; - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -3677,7 +3669,7 @@ int Mem_read_ka(int flag, int cur_context, int fetch) { } else { if (!page_lookup_ka(AB, flag, &addr, 0, cur_context, fetch)) return 1; - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -3703,7 +3695,7 @@ int Mem_write_ka(int flag, int cur_context) { } else { if (!page_lookup_ka(AB, flag, &addr, 1, cur_context, 0)) return 1; - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -3842,7 +3834,7 @@ int Mem_read(int flag, int cur_context, int fetch) { } else { if (!page_lookup(AB, flag, &addr, 0, cur_context, fetch)) return 1; - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -3868,7 +3860,7 @@ int Mem_write(int flag, int cur_context) { } else { if (!page_lookup(AB, flag, &addr, 1, cur_context, 0)) return 1; - if (addr >= (int)MEMSIZE) { + if (addr >= MEMSIZE) { nxm_flag = 1; return 1; } @@ -3889,7 +3881,7 @@ int Mem_read_nopage() { if (AB < 020) { MB = get_reg(AB); } else { - if (AB >= (int)MEMSIZE) { + if (AB >= MEMSIZE) { #if KL irq_flags |= 02000; #else @@ -3912,7 +3904,7 @@ int Mem_write_nopage() { if (AB < 020) { set_reg(AB, MB); } else { - if (AB >= (int)MEMSIZE) { + if (AB >= MEMSIZE) { #if KL irq_flags |= 02000; #else @@ -5385,6 +5377,7 @@ dpnorm: MQ = CCM(MB) + 1; /* Low */ /* High */ #if KL + flag1 = flag3 = 0; if ((CCM(AR) + ((MQ & SMASK) != 0)) & SMASK) { FLAGS |= CRY1; flag1 = 1; @@ -5458,6 +5451,7 @@ dpnorm: MQ = CCM(MQ) + 1; if (MQ & SMASK) { #if KL + flag1 = flag3 = 0; if ((CCM(get_reg(AC)) + 1) & SMASK) { FLAGS |= CRY1; flag1 = 1; @@ -6464,7 +6458,7 @@ fnormx: SC--; } AR &= FMASK; - if ((SC & 01600) != 1600) + if ((SC & 01600) != 01600) fxu_hold_set = 1; if (AR == (SMASK|EXPO)) { AR = (AR >> 1) | (AR & SMASK); @@ -6833,7 +6827,7 @@ left: AR = (AR << 1) + (MQ >> 35); MQ &= CMASK; /* low order only has 35 bits */ if ((IR & 4) == 0) { /* IMUL */ - if (AR > flag3 && !pi_cycle) { + if (AR > (uint64)flag3 && !pi_cycle) { FLAGS |= OVR|TRP1; check_apr_irq(); } @@ -8994,7 +8988,7 @@ do_byte_setup(int n, int wr, int *pos, int *sz) if (MB & SMASK) { /* Instruction format IFIW */ if (MB & BIT1) { /* Illegal index word */ fault_data = 024LL << 30 | (((FLAGS & USER) != 0)?SMASK:0) | - (temp & RMASK) | ((uint64)sect << 18); + AB | ((uint64)sect << 18); page_fault = 1; return 1; } @@ -9020,6 +9014,7 @@ do_byte_setup(int n, int wr, int *pos, int *sz) ind = (MB & BIT1) != 0; ix = (MB >> 30) & 017; AB = MB & (SECTM|RMASK); + temp = MB; if (ix) { temp = get_reg(ix); if ((temp & SMASK) != 0 || (temp & SECTM) == 0) { /* Local index word */ @@ -9028,8 +9023,7 @@ do_byte_setup(int n, int wr, int *pos, int *sz) temp = temp + AB; temp &= FMASK; MB = temp; - } else - temp = MB; + } sect = cur_sect = (temp >> 18) & 07777; AB = temp & RMASK; glb_sect = 1; @@ -9372,28 +9366,28 @@ do_xlate(uint32 tbl, uint64 val, int mask) /* Table of powers of 10 for CVTBD opcodes */ uint64 pow10_tab[22][2] = { - /* 0: */ 0000000000000LL, 0000000000001LL, - /* 1: */ 0000000000000LL, 0000000000012LL, - /* 2: */ 0000000000000LL, 0000000000144LL, - /* 3: */ 0000000000000LL, 0000000001750LL, - /* 4: */ 0000000000000LL, 0000000023420LL, - /* 5: */ 0000000000000LL, 0000000303240LL, - /* 6: */ 0000000000000LL, 0000003641100LL, - /* 7: */ 0000000000000LL, 0000046113200LL, - /* 8: */ 0000000000000LL, 0000575360400LL, - /* 9: */ 0000000000000LL, 0007346545000LL, - /* 10: */ 0000000000000LL, 0112402762000LL, - /* 11: */ 0000000000002LL, 0351035564000LL, - /* 12: */ 0000000000035LL, 0032451210000LL, - /* 13: */ 0000000000443LL, 0011634520000LL, - /* 14: */ 0000000005536LL, 0142036440000LL, - /* 15: */ 0000000070657LL, 0324461500000LL, - /* 16: */ 0000001070336LL, 0115760200000LL, - /* 17: */ 0000013064257LL, 0013542400000LL, - /* 18: */ 0000157013326LL, 0164731000000LL, - /* 19: */ 0002126162140LL, 0221172000000LL, - /* 20: */ 0025536165705LL, 0254304000000LL, - /* 21: */ 0330656232670LL, 0273650000000LL + /* 0: */ { 0000000000000LL, 0000000000001LL }, + /* 1: */ { 0000000000000LL, 0000000000012LL }, + /* 2: */ { 0000000000000LL, 0000000000144LL }, + /* 3: */ { 0000000000000LL, 0000000001750LL }, + /* 4: */ { 0000000000000LL, 0000000023420LL }, + /* 5: */ { 0000000000000LL, 0000000303240LL }, + /* 6: */ { 0000000000000LL, 0000003641100LL }, + /* 7: */ { 0000000000000LL, 0000046113200LL }, + /* 8: */ { 0000000000000LL, 0000575360400LL }, + /* 9: */ { 0000000000000LL, 0007346545000LL }, + /* 10: */ { 0000000000000LL, 0112402762000LL }, + /* 11: */ { 0000000000002LL, 0351035564000LL }, + /* 12: */ { 0000000000035LL, 0032451210000LL }, + /* 13: */ { 0000000000443LL, 0011634520000LL }, + /* 14: */ { 0000000005536LL, 0142036440000LL }, + /* 15: */ { 0000000070657LL, 0324461500000LL }, + /* 16: */ { 0000001070336LL, 0115760200000LL }, + /* 17: */ { 0000013064257LL, 0013542400000LL }, + /* 18: */ { 0000157013326LL, 0164731000000LL }, + /* 19: */ { 0002126162140LL, 0221172000000LL }, + /* 20: */ { 0025536165705LL, 0254304000000LL }, + /* 21: */ { 0330656232670LL, 0273650000000LL } }; /* @@ -9784,9 +9778,10 @@ do_extend(uint32 ia) case 012: /* CVTBDO */ case 013: /* CVTBDT */ /* Save E1 */ - if (IR == 012) + if (IR == 012) { val2 = ((AR & RSIGN) ? LMASK : 0) | (AR & RMASK); - else { + xlat_sect = cur_sect; + } else { val2 = AB; if (QKLB && pc_sect != 0 && glb_sect) xlat_sect = (AR >> 18) & 07777; @@ -9822,11 +9817,11 @@ do_extend(uint32 ia) if (f == 0) f = 1; /* Check if room to save it */ - if (f > (reg & MANT)) + if (f > (int)(reg & MANT)) return 0; /* Fill out left justify */ /* If L, fill leading zeros with fill char */ - while ((reg & SMASK) != 0 && (reg & MANT) > f) { + while ((reg & SMASK) != 0 && (int)(reg & MANT) > f) { if (!store_byte(ext_ac + 3, fill1, 1)) return 0; reg = get_reg(ext_ac + 3); @@ -9875,6 +9870,7 @@ do_extend(uint32 ia) case 015: /* MOVST */ case 016: /* MOVSLJ */ get_mask(ext_ac+3, &msk); + xlat_sect = cur_sect; if ((((get_reg(ext_ac) & (077LL << 26))| get_reg(ext_ac+3)) & EMASK) != 0) return 1; if (IR == 014) { @@ -10259,7 +10255,9 @@ t_bool build_dev_tab (void) DEVICE *dptr; DIB *dibp; uint32 i, j, d; -int rh20; +#if KL +uint32 rh20; +#endif int rh_idx; /* Set trap offset based on MAOFF flag */ @@ -10316,7 +10314,9 @@ if (QBBN) /* Assign all RH10 & RH20 devices */ +#if KL rh20 = 0540; +#endif rh_idx = 0; for (i = 0; (dptr = rh_devs[i]) != NULL; i++) { dibp = (DIB *) dptr->ctxt; diff --git a/PDP10/kx10_disk.c b/PDP10/kx10_disk.c index 0d404057..411df3b8 100644 --- a/PDP10/kx10_disk.c +++ b/PDP10/kx10_disk.c @@ -55,7 +55,7 @@ struct disk_formats { - uint32 mode; + int mode; const char *name; }; diff --git a/PDP10/kx10_dpy.c b/PDP10/kx10_dpy.c index 668cda4e..0f7ad569 100644 --- a/PDP10/kx10_dpy.c +++ b/PDP10/kx10_dpy.c @@ -341,7 +341,6 @@ static int joy_buttons[JOY_MAX_UNITS * JOY_MAX_BUTTONS]; static void dpy_joy_motion(int which, int axis, int value) { - int result = FALSE; if (which < JOY_MAX_UNITS && axis < JOY_MAX_AXES) { joy_axes[which * JOY_MAX_AXES + axis] = value; } @@ -349,7 +348,6 @@ static void dpy_joy_motion(int which, int axis, int value) static void dpy_joy_button(int which, int button, int state) { - int result = FALSE; if (which < JOY_MAX_UNITS && button < JOY_MAX_BUTTONS) { joy_buttons[which * JOY_MAX_UNITS + button] = state; } diff --git a/PDP10/kx10_dt.c b/PDP10/kx10_dt.c index 449e7889..f92bf341 100644 --- a/PDP10/kx10_dt.c +++ b/PDP10/kx10_dt.c @@ -1062,7 +1062,7 @@ dt_boot(int32 unit_num, DEVICE * dptr) { UNIT *uptr = &dptr->units[unit_num]; uint32 *fbuf = (uint32 *) uptr->filebuf; /* file buffer */ - uint64 word; + uint64 word = 0; int off; int wc, addr; @@ -1232,7 +1232,6 @@ void dt_flush (UNIT* uptr) uint16 pdp8b[D8_NBSIZE]; uint16 pdp11b[D18_BSIZE]; uint32 ba, k, *fbuf; - int32 u = uptr - dt_dev.units; if (uptr->WRITTEN && uptr->hwmark && ((uptr->flags & UNIT_RO) == 0)) { /* any data? */ rewind (uptr->fileref); /* start of file */ diff --git a/PDP10/kx10_imp.c b/PDP10/kx10_imp.c index 4ebd6c16..304bb98d 100644 --- a/PDP10/kx10_imp.c +++ b/PDP10/kx10_imp.c @@ -405,7 +405,7 @@ struct imp_device { struct imp_map port_map[64]; /* Ports to adjust */ in_addr_T dhcpip; /* DHCP server address */ uint8 dhcp_state; /* State of DHCP */ - int dhcp_lease; /* DHCP lease time */ + uint32 dhcp_lease; /* DHCP lease time */ int dhcp_renew; /* DHCP renew time */ int dhcp_rebind; /* DHCP rebind time */ int dhcp_wait_time; /* seconds waiting for response */ @@ -743,7 +743,6 @@ imp_devirq(uint32 dev, t_addr addr) { t_stat imp_srv(UNIT * uptr) { - DEVICE *dptr = find_dev_from_unit(uptr); int i; int l; @@ -1017,7 +1016,6 @@ imp_packet_in(struct imp_device *imp) if (ip_hdr->ip_dst == imp_data.ip && imp_data.hostip != 0) { uint8 *payload = (uint8 *)(&imp->rbuffer[pad + (ip_hdr->ip_v_hl & 0xf) * 4]); - uint16 chk = ip_hdr->ip_sum; /* If TCP packet update the TCP checksum */ if (ip_hdr->ip_p == TCP_PROTO) { struct tcp *tcp_hdr = (struct tcp *)payload; @@ -2641,7 +2639,7 @@ t_stat imp_reset (DEVICE *dptr) imp_data.sendq = NULL; /* Set up free queue */ p = NULL; - for (i = 0; i < (sizeof(imp_buffer)/sizeof(struct imp_packet)); i++) { + for (i = 0; i < (int)(sizeof(imp_buffer)/sizeof(struct imp_packet)); i++) { imp_buffer[i].next = p; p = &imp_buffer[i]; } diff --git a/PDP10/kx10_mt.c b/PDP10/kx10_mt.c index 01674227..a17894e0 100644 --- a/PDP10/kx10_mt.c +++ b/PDP10/kx10_mt.c @@ -725,7 +725,7 @@ t_stat mt_srv(UNIT * uptr) } uptr->BPOS++; uptr->CPOS++; - if (uptr->BPOS == uptr->hwmark) + if (uptr->BPOS == (int32)uptr->hwmark) uptr->CNTRL |= MT_LASTWD; if (uptr->CPOS == cc_max) { uptr->CPOS = 0; diff --git a/PDP10/kx10_rh.c b/PDP10/kx10_rh.c index c2e5d724..80d409c1 100644 --- a/PDP10/kx10_rh.c +++ b/PDP10/kx10_rh.c @@ -491,7 +491,6 @@ t_stat rh_devio(uint32 dev, uint64 *data) { /* Handle KI and KL style interrupt vectors */ t_addr rh_devirq(uint32 dev, t_addr addr) { - DEVICE *dptr = NULL; struct rh_if *rhc = NULL; int drive; diff --git a/PDP10/kx10_sys.c b/PDP10/kx10_sys.c index 04b16095..9c6755f0 100644 --- a/PDP10/kx10_sys.c +++ b/PDP10/kx10_sys.c @@ -277,7 +277,7 @@ t_stat load_dmp (FILE *fileref) char *p; uint32 addr = 074; uint64 data; - int high = 0; + uint32 high = 0; while (fgets((char *)buffer, 80, fileref) != 0) { p = (char *)buffer; @@ -774,6 +774,7 @@ t_stat load_exb (FILE *fileref, int ftype) return SCPE_OK; } pos = 0; + word = 0; for (; wc > 0; wc--, pos++) { if (get_exb_byte(fileref, &byt, ftype)) return SCPE_FMT; @@ -1124,11 +1125,10 @@ static const char *devnam[NUMDEV] = { t_stat fprint_sym (FILE *of, t_addr addr, t_value *val, UNIT *uptr, int32 sw) { -int32 i, j, c, cflag, ac, xr, y, dev; +int32 i, j, c, ac, xr, y, dev; uint64 inst; inst = val[0]; -cflag = (uptr == NULL) || (uptr == &cpu_unit[0]); if (sw & SWMASK ('A')) { /* ASCII? */ if (inst > 0377) return SCPE_ARG; @@ -1250,12 +1250,11 @@ return (ind | (xr << 18) | val); t_stat parse_sym (CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw) { -int32 cflag, i, j; +int32 i, j; t_value ac, dev; t_stat r; char gbuf[CBUFSIZE], cbuf[2*CBUFSIZE]; -cflag = (uptr == NULL) || (uptr == &cpu_unit[0]); while (isspace (*cptr)) cptr++; memset (cbuf, '\0', sizeof(cbuf)); strncpy (cbuf, cptr, sizeof(cbuf)-7); diff --git a/PDP10/kx10_tu.c b/PDP10/kx10_tu.c index 34370f31..594a7254 100644 --- a/PDP10/kx10_tu.c +++ b/PDP10/kx10_tu.c @@ -627,7 +627,7 @@ t_stat tu_srv(UNIT * uptr) uptr->CPOS = 0; if (GET_FNC(uptr->CMD) == FNC_READ && rh_write(rhc) == 0) { tu_error(uptr, MTSE_OK); - if (uptr->DATAPTR == uptr->hwmark) + if ((uint32)uptr->DATAPTR == uptr->hwmark) (void)rh_blkend(rhc); rh_finish_op(rhc, 0); return SCPE_OK; diff --git a/PDP10/pdp6_dtc.c b/PDP10/pdp6_dtc.c index c4e1567a..447b92e6 100644 --- a/PDP10/pdp6_dtc.c +++ b/PDP10/pdp6_dtc.c @@ -1072,7 +1072,7 @@ dtc_boot(int32 unit_num, DEVICE * dptr) { UNIT *uptr = &dptr->units[unit_num]; uint32 *fbuf = (uint32 *) uptr->filebuf; /* file buffer */ - uint64 word; + uint64 word = 0; int off; int wc, addr; diff --git a/PDP10/pdp6_mtc.c b/PDP10/pdp6_mtc.c index df82286d..2be3fb5f 100644 --- a/PDP10/pdp6_mtc.c +++ b/PDP10/pdp6_mtc.c @@ -388,7 +388,7 @@ t_stat mtc_srv(UNIT * uptr) { DEVICE *dptr = find_dev_from_unit(uptr); - int unit = (uptr - dptr->units) & 7; + unsigned int unit = (uptr - dptr->units) & 7; int cmd = (uptr->CNTRL & FUNCTION) >> 8; t_mtrlnt reclen; t_stat r = SCPE_ARG; /* Force error if not set */ @@ -416,7 +416,7 @@ mtc_srv(UNIT * uptr) /* Check if command pending */ if ((mtc_hold_cmd & CMD_FULL) != 0) { - int u = (mtc_hold_cmd >> 4) & 07; + unsigned int u = (mtc_hold_cmd >> 4) & 07; sim_debug(DEBUG_DETAIL, dptr, "MTC%o New command %o\n", unit, u); /* Is it for me? */ if (u == unit) { diff --git a/PDP10/pdp6_slave.c b/PDP10/pdp6_slave.c index acd73dbb..ebbd8b65 100644 --- a/PDP10/pdp6_slave.c +++ b/PDP10/pdp6_slave.c @@ -291,7 +291,6 @@ static const char *slave_description (DEVICE *dptr) t_stat slave_devio(uint32 dev, uint64 *data) { - DEVICE *dptr = &slave_dev; UNIT *uptr = &slave_unit[0]; switch(dev & 03) {