From de4f01c73b59a2399a676cbc25b00c4fb2135930 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 13 May 2026 11:19:44 -1000 Subject: [PATCH] I1401, I7094, ID16, ID32, ND100, PDP10, SAGE, VAX780, SCP: Declaration Hygiene simh t_bool has been declared as int. Given this, compilers didn't notice inconsistent declarations with other int types. These changes fix those problems. I1401: Consistently declare conv_old as t_bool I7094: Consistently declare ch6_req_wr as returning t_stat ID16, ID32: Consistently declare idc_wds as returning t_stat ND100: Properly declare sim_load flag argument as int PDP10: Consistently declare build_dib_tab as returning t_stat SAGE: Properly declare sim_load flag argument as int VAX780: Consistently declare rtfile_read as returning t_bool TIMER: Properly declare sim_timer_cancel as returning t_stat CONSOLE: Properly declare sim_os_fd_isatty as returning int --- I1401/i1401_cd.c | 2 +- I7094/i7094_io.c | 2 +- Ibm1130/ibm1130_cr.c | 2 -- Ibm1130/ibm1130_defs.h | 4 ++-- Ibm1130/ibm1130_gui.c | 2 +- Ibm1130/ibm1130_stddev.c | 2 -- Interdata/id_idc.c | 4 ++-- ND100/nd100_sys.c | 2 +- PDP10/pdp10_ksio.c | 2 +- SAGE/m68k_sys.c | 2 +- VAX/vax780_fload.c | 2 +- sim_console.c | 18 ++++++++++-------- sim_timer.c | 2 +- sim_timer.h | 2 +- 14 files changed, 23 insertions(+), 25 deletions(-) diff --git a/I1401/i1401_cd.c b/I1401/i1401_cd.c index e60e93f9..71d353f7 100644 --- a/I1401/i1401_cd.c +++ b/I1401/i1401_cd.c @@ -98,7 +98,7 @@ extern uint8 M[]; extern int32 ind[64], ssa, iochk; -extern int32 conv_old; +extern t_bool conv_old; int32 s1sel, s2sel, s4sel, s8sel; char cdr_buf[(2 * CBUFSIZE) + 1]; /* > CDR_WIDTH */ diff --git a/I7094/i7094_io.c b/I7094/i7094_io.c index d9278019..47475cb5 100644 --- a/I7094/i7094_io.c +++ b/I7094/i7094_io.c @@ -1410,7 +1410,7 @@ return SCPE_OK; /* Output - request channel output service */ -t_bool ch6_req_wr (uint32 ch, uint32 unit) +t_stat ch6_req_wr (uint32 ch, uint32 unit) { if (ch6_qconn (ch, unit)) { /* ch conn to caller? */ ch_req |= REQ_CH (ch); diff --git a/Ibm1130/ibm1130_cr.c b/Ibm1130/ibm1130_cr.c index 51d8eacb..e08a7821 100644 --- a/Ibm1130/ibm1130_cr.c +++ b/Ibm1130/ibm1130_cr.c @@ -721,8 +721,6 @@ static CPCODE cardcode_026C[] = /* 026 commercial */ {0x2220, '('}, /* if ASCII has (, treat like % */ }; -extern int cgi; - static int16 ascii_to_card[256]; static CPCODE *cardcode; diff --git a/Ibm1130/ibm1130_defs.h b/Ibm1130/ibm1130_defs.h index cb649757..cda20429 100644 --- a/Ibm1130/ibm1130_defs.h +++ b/Ibm1130/ibm1130_defs.h @@ -41,8 +41,8 @@ /* ------------------------------------------------------------------------ */ /* Global state */ -extern int cgi; /* TRUE if we are running as a CGI program */ -extern int cgiwritable; /* TRUE if we can write the disk images back to the image file in CGI mode */ +extern t_bool cgi; /* TRUE if we are running as a CGI program */ +extern t_bool cgiwritable; /* TRUE if we can write the disk images back to the image file in CGI mode */ extern t_bool sim_gui; extern uint16 M[]; /* core memory, up to 32Kwords (note: don't even think about trying 64K) */ diff --git a/Ibm1130/ibm1130_gui.c b/Ibm1130/ibm1130_gui.c index a392dc28..bdc213b6 100644 --- a/Ibm1130/ibm1130_gui.c +++ b/Ibm1130/ibm1130_gui.c @@ -411,7 +411,7 @@ static void RepaintRegion (HWND hWnd, int left, int top, int right, int bottom) * reflected instantly. * ------------------------------------------------------------------------ */ -void update_gui (BOOL force) +void update_gui (t_bool force) { int i; BOOL state; diff --git a/Ibm1130/ibm1130_stddev.c b/Ibm1130/ibm1130_stddev.c index 6dfb74d8..2d1e908b 100644 --- a/Ibm1130/ibm1130_stddev.c +++ b/Ibm1130/ibm1130_stddev.c @@ -111,8 +111,6 @@ typedef struct tag_os_map { /* os_map = overstrike mapping */ unsigned char inlist[MAX_OS_CHARS]; /* inlist = overstruck ASCII characters, sorted. NOT NULL TERMINATED */ } OS_MAP; -extern int cgi; - static int32 tti_dsw = 0; /* device status words */ static int32 tto_dsw = 0; int32 con_dsw = 0; diff --git a/Interdata/id_idc.c b/Interdata/id_idc.c index dda143d6..2c772f6b 100644 --- a/Interdata/id_idc.c +++ b/Interdata/id_idc.c @@ -667,7 +667,7 @@ return SCPE_OK; /* Write data sector */ -t_bool idc_wds (UNIT *uptr) +t_stat idc_wds (UNIT *uptr) { for ( ; idc_bptr < IDC_NUMBY; idc_bptr++) idcxb[idc_bptr] = idc_db; /* fill with last */ @@ -678,7 +678,7 @@ if (ferror (uptr->fileref)) { /* error? */ idc_done (STC_DTE); return SCPE_IOERR; } -return FALSE; +return SCPE_OK; } /* Data transfer error test routine */ diff --git a/ND100/nd100_sys.c b/ND100/nd100_sys.c index 716d3238..9396ebb5 100644 --- a/ND100/nd100_sys.c +++ b/ND100/nd100_sys.c @@ -94,7 +94,7 @@ gw(FILE *f) */ t_stat -sim_load(FILE *f, CONST char *buf, CONST char *fnam, t_bool flag) +sim_load(FILE *f, CONST char *buf, CONST char *fnam, int flag) { int B, C, E, F, H, I; int w, i, rv; diff --git a/PDP10/pdp10_ksio.c b/PDP10/pdp10_ksio.c index ad4d92b1..5d17bd18 100644 --- a/PDP10/pdp10_ksio.c +++ b/PDP10/pdp10_ksio.c @@ -1867,7 +1867,7 @@ return; /* Build dib_tab from device list */ -t_bool build_dib_tab (void) +t_stat build_dib_tab (void) { int32 i, j, k; DEVICE *dptr; diff --git a/SAGE/m68k_sys.c b/SAGE/m68k_sys.c index a2588ff6..63d209de 100644 --- a/SAGE/m68k_sys.c +++ b/SAGE/m68k_sys.c @@ -231,7 +231,7 @@ error: return SCPE_FMT; } -t_stat sim_load(FILE* fptr, CONST char* cptr, CONST char* fnam, t_bool flag) +t_stat sim_load(FILE* fptr, CONST char* cptr, CONST char* fnam, int flag) { int i,len,rc; uint16 data; diff --git a/VAX/vax780_fload.c b/VAX/vax780_fload.c index 6b003acf..7c4ea050 100644 --- a/VAX/vax780_fload.c +++ b/VAX/vax780_fload.c @@ -207,7 +207,7 @@ return 0; /* Read blocks */ -t_stat rtfile_read (uint32 block, uint32 count, uint16 *buffer) +t_bool rtfile_read (uint32 block, uint32 count, uint16 *buffer) { uint32 i, j; uint32 pos; diff --git a/sim_console.c b/sim_console.c index 28a4f080..5ab79404 100644 --- a/sim_console.c +++ b/sim_console.c @@ -152,7 +152,7 @@ static t_stat sim_os_ttinit (void); static t_stat sim_os_ttrun (void); static t_stat sim_os_ttcmd (void); static t_stat sim_os_ttclose (void); -static t_bool sim_os_fd_isatty (int fd); +static int sim_os_fd_isatty (int fd); static t_stat sim_os_connect_telnet (int port); static t_stat sim_set_rem_telnet (int32 flag, CONST char *cptr); @@ -3311,12 +3311,12 @@ static int answer = -1; if (answer == -1) answer = sim_os_fd_isatty (0); -return (t_bool)answer; +return (t_bool)(answer != 0); } t_bool sim_fd_isatty (int fd) { -return sim_os_fd_isatty (fd); +return (sim_os_fd_isatty (fd) != 0); } /* Platform specific routine definitions */ @@ -3414,7 +3414,7 @@ sys$dassgn (tty_chan); return SCPE_OK; } -static t_bool sim_os_fd_isatty (int fd) +static int sim_os_fd_isatty (int fd) { return isatty (fd); } @@ -3615,7 +3615,7 @@ static t_stat sim_os_ttclose (void) return SCPE_OK; } -static t_bool sim_os_fd_isatty (int fd) +static int sim_os_fd_isatty (int fd) { DWORD Mode; HANDLE handle; @@ -3634,7 +3634,9 @@ switch (fd) { handle = NULL; } -return (handle) && (handle != INVALID_HANDLE_VALUE) && GetConsoleMode (handle, &Mode); +return (((handle) && + (handle != INVALID_HANDLE_VALUE) && + (GetConsoleMode (handle, &Mode) != 0)) ? 1 : 0); } static t_stat sim_os_poll_kbd (void) @@ -3890,7 +3892,7 @@ static t_stat sim_os_ttclose (void) return sim_ttcmd (); } -static t_bool sim_os_fd_isatty (int fd) +static int sim_os_fd_isatty (int fd) { return isatty (fd); } @@ -4259,7 +4261,7 @@ static t_stat sim_os_ttclose (void) return sim_ttcmd (); } -static t_bool sim_os_fd_isatty (int fd) +static int sim_os_fd_isatty (int fd) { return isatty (fd); } diff --git a/sim_timer.c b/sim_timer.c index 0f70ada8..c96ef75c 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -3515,7 +3515,7 @@ for (tmr=0; tmr<=SIM_NTIMERS; tmr++) { return FALSE; } -t_bool sim_timer_cancel (UNIT *uptr) +t_stat sim_timer_cancel (UNIT *uptr) { int32 tmr; diff --git a/sim_timer.h b/sim_timer.h index c2cf1f52..cc883dae 100644 --- a/sim_timer.h +++ b/sim_timer.h @@ -141,7 +141,7 @@ t_stat sim_timer_activate_after (UNIT *uptr, double usec_delay); int32 _sim_timer_activate_time (UNIT *uptr); double sim_timer_activate_time_usecs (UNIT *uptr); t_bool sim_timer_is_active (UNIT *uptr); -t_bool sim_timer_cancel (UNIT *uptr); +t_stat sim_timer_cancel (UNIT *uptr); t_stat sim_register_clock_unit (UNIT *uptr); t_stat sim_register_clock_unit_tmr (UNIT *uptr, int32 tmr); t_stat sim_clock_coschedule (UNIT *uptr, int32 interval);