Compiler indicated cleanups

This commit is contained in:
Mark Pizzolato 2013-03-19 01:11:22 -07:00
parent 9b3694b102
commit a262dd9c14
15 changed files with 61 additions and 58 deletions

View file

@ -722,9 +722,10 @@ static int32 sio0dCore(const int32 port, const int32 io, const int32 data) {
if (io == 0) { /* IN */
if ((sio_unit.flags & UNIT_ATT) && (!sio_unit.u4))
return mapCharacter(tmxr_getc_ln(&TerminalLines[spi.terminalLine]));
if (!sio_unit.u3)
if (!sio_unit.u3) {
sim_debug(BUFFER_EMPTY_MSG, &sio_dev, "\tSIO_D: " ADDRESS_FORMAT
" IN(0x%03x) for empty character buffer\n", PCX, port);
}
sio_unit.u3 = FALSE; /* no character is available any more */
return mapCharacter(sio_unit.buf); /* return previous character */
} /* OUT follows, no fall-through from IN */

View file

@ -1,6 +1,6 @@
/* hp2100_cpu.c: HP 21xx/1000 CPU simulator
Copyright (c) 1993-2012, Robert M. Supnik
Copyright (c) 1993-2013, Robert M. Supnik
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@ -29,6 +29,7 @@
DMA1,DMA2 12607B/12578A/12895A direct memory access controller
DCPC1,DCPC2 12897B dual channel port controller
18-Mar-13 JDB Removed redundant extern declarations
09-May-12 JDB Separated assignments from conditional expressions
13-Jan-12 JDB Minor speedup in "is_mapped"
Added casts to cpu_mod, dmasio, dmapio, cpu_reset, dma_reset
@ -444,6 +445,7 @@
#include "hp2100_defs.h"
#include "hp2100_cpu.h"
#include "hp2100_cpu1.h"
/* Memory protect constants */
@ -561,8 +563,9 @@ uint16 dms_map[MAP_NUM * MAP_LNT] = { 0 }; /* dms maps */
/* External data */
extern char halt_msg[];
extern char halt_msg []; /* halt message */
extern DIB clk_dib; /* CLK DIB for idle check */
extern const BOOT_ROM ptr_rom, dq_rom, ms_rom, ds_rom; /* boot ROMs for cpu_boot routine */
/* CPU local routines */
@ -601,14 +604,6 @@ IOHANDLER dmapio;
IOHANDLER dmasio;
IOHANDLER nullio;
/* External routines */
extern t_stat cpu_eau (uint32 IR, uint32 intrq);
extern t_stat cpu_uig_0 (uint32 IR, uint32 intrq, uint32 iotrap);
extern t_stat cpu_uig_1 (uint32 IR, uint32 intrq, uint32 iotrap);
extern void (*sim_vm_post) (t_bool from_scp);
/* Table of CPU features by model.
@ -3959,7 +3954,6 @@ t_stat cpu_show_idle (FILE *st, UNIT *uptr, int32 val, void *desc)
t_stat cpu_boot (int32 unitno, DEVICE *dptr)
{
extern const BOOT_ROM ptr_rom, dq_rom, ms_rom, ds_rom;
int32 dev = (SR >> IBL_V_DEV) & I_DEVMASK;
int32 sel = (SR >> IBL_V_SEL) & IBL_M_SEL;

View file

@ -1,6 +1,6 @@
/* hp2100_cpu.h: HP 2100 CPU definitions
Copyright (c) 2005-2010, Robert M. Supnik
Copyright (c) 2005-2013, Robert M. Supnik
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@ -23,6 +23,7 @@
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
18-Mar-13 JDB Added declarations for the MP abort handler and CPU registers
03-Jan-10 RMS Changed declarations of mp_control, mp_mefvv, for VMS compiler
15-Jul-08 JDB Rearranged declarations with hp2100_cpu.c and hp2100_defs.h
26-Jun-08 JDB Added mp_control to CPU state externals
@ -298,6 +299,7 @@ extern uint32 pcq_p;
extern uint32 stop_inst;
extern UNIT cpu_unit;
extern DEVICE cpu_dev;
extern REG cpu_reg [];
extern jmp_buf save_env;

View file

@ -305,11 +305,17 @@ extern t_stat cpu_signal (uint32 IR, uint32 intrq); /* [7] SIGNA
/* Microcode helper functions */
OP ReadOp (uint32 va, OPSIZE precision); /* generalized operand read */
void WriteOp (uint32 va, OP operand, OPSIZE precision); /* generalized operand write */
t_stat cpu_ops (OP_PAT pattern, OPS op, uint32 irq); /* operand processor */
extern OP ReadOp (uint32 va, OPSIZE precision); /* generalized operand read */
extern void WriteOp (uint32 va, OP operand, OPSIZE precision); /* generalized operand write */
extern t_stat cpu_ops (OP_PAT pattern, OPS op, uint32 irq); /* operand processor */
void fprint_ops (OP_PAT pattern, OPS op); /* debug print operands */
void fprint_regs (char *caption, uint32 regs, uint32 base); /* debug print CPU registers */
extern void fprint_ops (OP_PAT pattern, OPS op); /* debug print operands */
extern void fprint_regs (char *caption, uint32 regs, uint32 base); /* debug print CPU registers */
/* implemented in hp2100_cpu5.c (RTE-IV EMA functions) */
extern t_stat cpu_ema_eres (uint32 *rtn, uint32 dtbl, uint32 atbl, t_bool debug);
extern t_stat cpu_ema_eseg (uint32 *rtn, uint32 ir, uint32 tbl, t_bool debug);
extern t_stat cpu_ema_vset (uint32 *rtn, OPS op, t_bool debug);
#endif

View file

@ -1,6 +1,6 @@
/* hp2100_cpu6.c: HP 1000 RTE-6/VM OS instructions
Copyright (c) 2006-2012, J. David Bryan
Copyright (c) 2006-2013, J. David Bryan
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@ -25,6 +25,7 @@
CPU6 RTE-6/VM OS instructions
18-Mar-13 JDB Use MP abort handler declaration in hp2100_cpu.h
09-May-12 JDB Separated assignments from conditional expressions
29-Oct-10 JDB DMA channels renamed from 0,1 to 1,2 to match documentation
18-Sep-08 JDB Corrected .SIP debug formatting
@ -53,11 +54,6 @@
#include "hp2100_cpu1.h"
/* external variables */
extern jmp_buf save_env; /* MP abort handler */
/* Offsets to data and addresses within RTE. */
static const uint32 xi = 0001647; /* XI address */

View file

@ -1,7 +1,7 @@
/* hp2100_cpu7.c: HP 1000 VIS and SIGNAL/1000 microcode
Copyright (c) 2008, Holger Veit
Copyright (c) 2006-2012, J. David Bryan
Copyright (c) 2006-2013, J. David Bryan
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@ -26,6 +26,7 @@
CPU7 Vector Instruction Set and SIGNAL firmware
18-Mar-13 JDB Moved EMA helper declarations to hp2100_cpu1.h
09-May-12 JDB Separated assignments from conditional expressions
06-Feb-12 JDB Corrected "opsize" parameter type in vis_abs
11-Sep-08 JDB Moved microcode function prototypes to hp2100_cpu1.h
@ -123,11 +124,6 @@ static const OP zero = { { 0, 0, 0, 0, 0 } }; /* DEC 0.0D0 */
- VIS Microcode Source (12824-18059, revision 3).
*/
/* implemented in hp2100_cpu5.c (RTE-IV EMA functions) */
extern t_stat cpu_ema_eres(uint32* rtn,uint32 dtbl,uint32 atbl, t_bool debug);
extern t_stat cpu_ema_eseg(uint32* rtn,uint32 ir,uint32 tbl, t_bool debug);
extern t_stat cpu_ema_vset(uint32* rtn,OPS op, t_bool debug);
static const OP_PAT op_vis[16] = {
OP_N, OP_AAKAKAKK,OP_AKAKK, OP_AAKK, /* .VECT VPIV VABS VSUM */
OP_AAKK, OP_AAKAKK, OP_AAKK, OP_AAKK, /* VNRM VDOT VMAX VMAB */

View file

@ -1,6 +1,6 @@
/* hp2100_defs.h: HP 2100 simulator definitions
Copyright (c) 1993-2012, Robert M. Supnik
Copyright (c) 1993-2013, Robert M. Supnik
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@ -23,6 +23,7 @@
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
18-Mar-13 JDB Added "-Wdangling-else" to the suppression pragmas
14-Dec-12 JDB Added "-Wbitwise-op-parentheses" to the suppression pragmas
12-May-12 JDB Added pragmas to suppress logical operator precedence warnings
10-Feb-12 JDB Added hp_setsc, hp_showsc functions to support SC modifier
@ -81,6 +82,7 @@
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wlogical-op-parentheses"
#pragma GCC diagnostic ignored "-Wbitwise-op-parentheses"
#pragma GCC diagnostic ignored "-Wdangling-else"
#endif

View file

@ -1,7 +1,7 @@
/* hp2100_ds.c: HP 13037D/13175D disc controller/interface simulator
Copyright (c) 2004-2012, Robert M. Supnik
Copyright (c) 2012 J. David Bryan
Copyright (c) 2012-2013 J. David Bryan
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@ -26,6 +26,7 @@
DS 13037D/13175D disc controller/interface
18-Mar-13 JDB Fixed poll_drives definition to match declaration
24-Oct-12 JDB Changed CNTLR_OPCODE to title case to avoid name clash
29-Mar-12 JDB Rewritten to use the MAC/ICD disc controller library
ioIOO now notifies controller service of parameter output
@ -1337,7 +1338,7 @@ return;
sets the flag to notify the CPU.
*/
void poll_drives (void)
static void poll_drives (void)
{
if (mac_cntlr.state == cntlr_idle && ds.control == SET) /* is the controller idle and interrupts are allowed? */
if (dl_poll_drives (&mac_cntlr, ds_unit, DL_MAXDRIVE)) /* poll the drives; was Attention seen? */

View file

@ -1,6 +1,6 @@
/* hp2100_fp1.c: HP 1000 multiple-precision floating point routines
Copyright (c) 2005-2012, J. David Bryan
Copyright (c) 2005-2013, J. David Bryan
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@ -23,6 +23,7 @@
in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from the author.
18-Mar-13 JDB Changed type of mantissa masks array to to unsigned
06-Feb-12 JDB Added missing precision on constant "one" in fp_trun
21-Jun-11 JDB Completed the comments for divide; no code changes
08-Jun-08 JDB Quieted bogus gcc warning in fp_exec
@ -309,7 +310,7 @@ static const uint32 op_start[6] = { IN_V_SNUM,
FP_V_TMANT,
FP_V_EMANT };
static const t_int64 mant_mask[6] = { IN_SSMAGN,
static const t_uint64 mant_mask[6] = { IN_SSMAGN,
IN_SDMAGN,
FP_SFMANT,
FP_SXMANT,
@ -439,7 +440,7 @@ FPU unpacked;
unpacked.precision = precision; /* set value's precision */
unpacked.mantissa = /* unpack and mask mantissa */
unpack_int (packed, precision) & mant_mask[precision];
unpack_int (packed, precision) & (t_int64) mant_mask[precision];
switch (precision) {
@ -596,11 +597,11 @@ sign = (unpacked->mantissa < 0); /* save mantissa sign */
if (sign) /* round and mask the number */
unpacked->mantissa =
(unpacked->mantissa + n_half_lsb[unpacked->precision]) &
mant_mask[unpacked->precision];
(t_int64) mant_mask[unpacked->precision];
else
unpacked->mantissa =
(unpacked->mantissa + p_half_lsb[unpacked->precision]) &
mant_mask[unpacked->precision];
(t_int64) mant_mask[unpacked->precision];
if (sign != (unpacked->mantissa < 0)) /* mantissa overflow? */
lsrx (unpacked, 1); /* correct by shifting */

View file

@ -1,6 +1,6 @@
/* hp2100_sys.c: HP 2100 simulator interface
Copyright (c) 1993-2012, Robert M. Supnik
Copyright (c) 1993-2013, Robert M. Supnik
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@ -23,6 +23,7 @@
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
18-Mar-13 JDB Moved CPU state variable declarations to hp2100_cpu.h
09-May-12 JDB Quieted warnings for assignments in conditional expressions
10-Feb-12 JDB Deprecated DEVNO in favor of SC
Added hp_setsc, hp_showsc functions to support SC modifier
@ -61,9 +62,6 @@
#include "hp2100_cpu.h"
#include <ctype.h>
extern DEVICE cpu_dev;
extern UNIT cpu_unit;
extern REG cpu_reg[];
extern DEVICE mp_dev;
extern DEVICE dma1_dev, dma2_dev;

View file

@ -602,18 +602,20 @@ t_stat qty_common_svc( DIB * dibp, UNIT * unitp )
++qty_polls ; /* another time 'round the track */
newln = tmxr_poll_conn( &qty_desc ) ; /* anybody knocking at the door? */
if ( (newln >= 0) && qty_mdm )
{
if ( newln >= qty_max )
{
return SCPE_IERR; /* WTF - sanity check failed, over? */
}
else
{
line = newln ; /* handle modem control */
tmlnp =&qty_ldsc[ line ] ;
tmlnp->rcve = tmlnp->xmte = 1 ;
/* do QTY_LINE_ bit fiddling and state machine
* manipulation with modem control signals
*/
{
return SCPE_IERR; /* WTF - sanity check failed, over? */
}
else
{
line = newln ; /* handle modem control */
tmlnp =&qty_ldsc[ line ] ;
tmlnp->rcve = tmlnp->xmte = 1 ;
/* do QTY_LINE_ bit fiddling and state machine
* manipulation with modem control signals
*/
}
}
tmxr_poll_rx( &qty_desc ) ; /* poll input */

7
scp.c
View file

@ -2196,7 +2196,7 @@ return SCPE_OK;
t_stat set_cmd (int32 flag, char *cptr)
{
int32 lvl;
uint32 lvl;
t_stat r;
char gbuf[CBUFSIZE], *cvptr, *svptr;
DEVICE *dptr;
@ -2486,7 +2486,7 @@ return r;
t_stat show_cmd_fi (FILE *ofile, int32 flag, char *cptr)
{
int32 lvl;
uint32 lvl;
char gbuf[CBUFSIZE], *cvptr;
DEVICE *dptr;
UNIT *uptr;
@ -2966,6 +2966,7 @@ else return SCPE_NOFNC;
t_stat show_on (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr)
{
int32 lvl, i;
if (cptr && (*cptr != 0)) return SCPE_2MARG; /* now eol? */
for (lvl=sim_do_depth; lvl >= 0; --lvl) {
if (lvl > 0)
@ -3020,7 +3021,7 @@ for (mptr = dptr->modifiers; mptr->mask != 0; mptr++) {
if (mptr->pstring &&
((mptr->mask & MTAB_XTD)?
(MODMASK(mptr,flag) && !MODMASK(mptr,MTAB_NMO)):
((MTAB_VUN == flag) && ((uptr->flags & mptr->mask) == mptr->match)))) {
((MTAB_VUN == (uint32)flag) && ((uptr->flags & mptr->mask) == mptr->match)))) {
if (*toks > 2) {
fprintf (st, "\n");
*toks = 0;

View file

@ -559,7 +559,7 @@ struct sim_mtab {
#define MTAB_NMO (0020 | MTAB_XTD) /* only if named */
#define MTAB_NC (0040 | MTAB_XTD) /* no UC conversion */
#define MTAB_SHP (0100 | MTAB_XTD) /* show takes parameter */
#define MODMASK(mptr,flag) (((mptr)->mask & flag) == flag)/* flag mask test */
#define MODMASK(mptr,flag) (((mptr)->mask & (uint32)(flag)) == (uint32)(flag))/* flag mask test */
/* Search table */

View file

@ -524,11 +524,12 @@ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "HARDWARE\\DEVICEMAP\\SERIALCOMM", 0, KEY_
/* Enumerate all the values underneath HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM */
while (RegEnumValueA(hSERIALCOMM, dwIndex, list[ports].desc, &dwValueNameSize, NULL, &dwType, (BYTE *)list[ports].name, &dwDataSize) == ERROR_SUCCESS) {
/* String values with non-zero size are the interesting ones */
if ((dwType == REG_SZ) && (dwDataSize > 0))
if ((dwType == REG_SZ) && (dwDataSize > 0)) {
if (ports < max)
++ports;
else
break;
}
/* Besure to clear the working entry before trying again */
memset(list[ports].name, 0, sizeof(list[ports].name));
memset(list[ports].desc, 0, sizeof(list[ports].desc));

View file

@ -511,6 +511,7 @@ while (diff->tv_nsec > 1000000000) {
}
}
#if defined(SIM_ASYNCH_IO) && defined(SIM_ASYNCH_CLOCKS)
static int sim_timespec_compare (struct timespec *a, struct timespec *b)
{
while (a->tv_nsec > 1000000000) {
@ -532,6 +533,7 @@ if (a->tv_nsec > b->tv_nsec)
else
return 0;
}
#endif /* defined(SIM_ASYNCH_IO) && defined(SIM_ASYNCH_CLOCKS) */
/* OS independent clock calibration package */