Revert "SCP: Remove ASCII source code character set dependency"

This reverts commit 7c7b44e409.

The prior commit didn't work for static initializers.  There are other ASCII dependencies in simh.  They should all be solved together or not at all.
This commit is contained in:
Mark Pizzolato 2015-08-07 00:54:23 -07:00
parent 7c7b44e409
commit bd2f592918
3 changed files with 4 additions and 17 deletions

12
scp.c
View file

@ -1845,18 +1845,6 @@ return 0;
} }
#endif #endif
/* Convert switch letter to bit mask */
int32 sim_swmask (int switch_ch)
{
static char *letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char *index = strchr (letters, switch_ch);
if (index)
return (1u << (int)(index - letters));
return 0; /* shouldn't happen */
}
t_stat process_stdin_commands (t_stat stat, char *argv[]); t_stat process_stdin_commands (t_stat stat, char *argv[]);
/* Main command loop */ /* Main command loop */

1
scp.h
View file

@ -116,7 +116,6 @@ t_stat sim_run_boot_prep (void);
double sim_gtime (void); double sim_gtime (void);
uint32 sim_grtime (void); uint32 sim_grtime (void);
int32 sim_qcount (void); int32 sim_qcount (void);
int32 sim_swmask (int switch_ch);
t_stat attach_unit (UNIT *uptr, char *cptr); t_stat attach_unit (UNIT *uptr, char *cptr);
t_stat detach_unit (UNIT *uptr); t_stat detach_unit (UNIT *uptr);
t_stat assign_device (DEVICE *dptr, char *cptr); t_stat assign_device (DEVICE *dptr, char *cptr);

View file

@ -278,10 +278,6 @@ typedef uint32 t_addr;
#define SIM_SW_REG (1u << 28) /* register value */ #define SIM_SW_REG (1u << 28) /* register value */
#define SIM_SW_STOP (1u << 29) /* stop message */ #define SIM_SW_STOP (1u << 29) /* stop message */
/* Convert switch letter to bit mask */
#define SWMASK(x) sim_swmask ((int)x)
/* Simulator status codes /* Simulator status codes
0 ok 0 ok
@ -362,6 +358,10 @@ typedef uint32 t_addr;
#define KBD_LIM_WAIT(x) (((x) > KBD_MAX_WAIT)? KBD_MAX_WAIT: (x)) #define KBD_LIM_WAIT(x) (((x) > KBD_MAX_WAIT)? KBD_MAX_WAIT: (x))
#define KBD_WAIT(w,s) ((w)? w: KBD_LIM_WAIT (s)) #define KBD_WAIT(w,s) ((w)? w: KBD_LIM_WAIT (s))
/* Convert switch letter to bit mask */
#define SWMASK(x) (1u << (((int) (x)) - ((int) 'A')))
/* String match - at least one character required */ /* String match - at least one character required */
#define MATCH_CMD(ptr,cmd) ((NULL == (ptr)) || (!*(ptr)) || strncmp ((ptr), (cmd), strlen (ptr))) #define MATCH_CMD(ptr,cmd) ((NULL == (ptr)) || (!*(ptr)) || strncmp ((ptr), (cmd), strlen (ptr)))