1
0
mirror of https://github.com/simh/simh.git synced 2026-05-15 17:59:58 +00:00

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
This commit is contained in:
Mark Pizzolato
2026-05-13 11:19:44 -10:00
parent 242472d8b8
commit de4f01c73b
14 changed files with 23 additions and 25 deletions

View File

@@ -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 */

View File

@@ -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);

View File

@@ -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;

View File

@@ -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) */

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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);