Skip to content

Commit

Permalink
CDC1700: Cleanup minor compiler warnings.
Browse files Browse the repository at this point in the history
- Avoid macro name conflic REG_NONE changed to REG_NOREG
- Avoid a t_offset truncation assigning to a uint16 in drm_attach.
  • Loading branch information
markpizz committed Dec 15, 2017
1 parent a5feaf2 commit 2260eee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CDC1700/cdc1700_defs.h
Expand Up @@ -392,7 +392,7 @@ enum IOstatus {
#define MOD_ENHRA 0x0038
#define MOD_ENHRB 0x0007

#define REG_NONE 0x0
#define REG_NOREG 0x0
#define REG_R1 0x1
#define REG_R2 0x2
#define REG_R3 0x3
Expand Down
22 changes: 11 additions & 11 deletions CDC1700/cdc1700_dis.c
Expand Up @@ -270,28 +270,28 @@ int disassem(char *buf, uint16 addr, t_bool dbg, t_bool targ, t_bool exec)
case OPC_STOSJMP:
if (enhMode == 0) {
enhValid = TRUE;
if (enhRB == REG_NONE)
if (enhRB == REG_NOREG)
strcpy(enhInstr, "SJE");
else sprintf(enhInstr, "SJ%c", enhRegChar[enhRB]);
}
break;

case OPC_STOADD:
if ((enhMode == 0) && (enhRB != REG_NONE)) {
if ((enhMode == 0) && (enhRB != REG_NOREG)) {
enhValid = TRUE;
sprintf(enhInstr, "AR%c", enhRegChar[enhRB]);
}
break;

case OPC_STOSUB:
if ((enhMode == 0) && (enhRB != REG_NONE)) {
if ((enhMode == 0) && (enhRB != REG_NOREG)) {
enhValid = TRUE;
sprintf(enhInstr, "SB%c", enhRegChar[enhRB]);
}
break;

case OPC_STOAND:
if (enhRB != REG_NONE)
if (enhRB != REG_NOREG)
switch (enhMode) {
case WORD_REG:
enhValid = TRUE;
Expand All @@ -308,29 +308,29 @@ int disassem(char *buf, uint16 addr, t_bool dbg, t_bool targ, t_bool exec)
case OPC_STOLOADST:
switch (enhMode) {
case WORD_REG:
if (enhRB != REG_NONE) {
if (enhRB != REG_NOREG) {
enhValid = TRUE;
sprintf(enhInstr, "LR%c", enhRegChar[enhRB]);
}
break;

case WORD_MEM:
if (enhRB != REG_NONE) {
if (enhRB != REG_NOREG) {
enhValid = TRUE;
sprintf(enhInstr, "SR%c", enhRegChar[enhRB]);
}
break;

case CHAR_REG:
if (enhRB != REG_NONE) {
if (enhRB != REG_NOREG) {
enhValid = TRUE;
enhChar = TRUE;
strcpy(enhInstr, "LCA");
}
break;

case CHAR_MEM:
if (enhRB != REG_NONE) {
if (enhRB != REG_NOREG) {
enhValid = TRUE;
enhChar = TRUE;
strcpy(enhInstr, "SCA");
Expand All @@ -340,7 +340,7 @@ int disassem(char *buf, uint16 addr, t_bool dbg, t_bool targ, t_bool exec)
break;

case OPC_STOOR:
if (enhRB != REG_NONE)
if (enhRB != REG_NOREG)
switch (enhMode) {
case WORD_REG:
enhValid = TRUE;
Expand All @@ -357,14 +357,14 @@ int disassem(char *buf, uint16 addr, t_bool dbg, t_bool targ, t_bool exec)
case OPC_STOCRE:
switch (enhMode) {
case WORD_REG:
if (enhRB != REG_NONE) {
if (enhRB != REG_NOREG) {
enhValid = TRUE;
sprintf(enhInstr, "C%cE", enhRegChar[enhRB]);
}
break;

case CHAR_REG:
if (enhRB != REG_NONE) {
if (enhRB != REG_NOREG) {
enhValid = TRUE;
enhChar = TRUE;
strcpy(enhInstr, "CCE");
Expand Down
4 changes: 2 additions & 2 deletions CDC1700/cdc1700_drm.c
Expand Up @@ -715,7 +715,7 @@ t_stat drm_attach (UNIT *uptr, CONST char *cptr)
{
t_addr capac = uptr->capac;
t_stat r;
uint16 tracks;
t_offset tracks;

r = attach_unit(uptr, cptr);
if (r != SCPE_OK)
Expand Down Expand Up @@ -744,7 +744,7 @@ t_stat drm_attach (UNIT *uptr, CONST char *cptr)
return sim_messagef(SCPE_OPENERR, "Invalid file size");
}
DRMdev.STATUS = IO_ST_READY | IO_ST_DATA;
DRMdev.iod_tracks = tracks;
DRMdev.iod_tracks = (uint16)tracks;
DRMdev.iod_event = Instructions;

return SCPE_OK;
Expand Down

0 comments on commit 2260eee

Please sign in to comment.