SCP: Fix Coverity identified issues/noise

This commit is contained in:
Mark Pizzolato 2019-07-15 00:04:40 -07:00
parent 716df3c297
commit 2840e3b67f
2 changed files with 32 additions and 30 deletions

View file

@ -4240,7 +4240,7 @@ static void ansi_fill_text_buffer (FILE *f, char *buf, size_t buf_size, size_t r
memcpy (buf + offset, tmp, move_size); memcpy (buf + offset, tmp, move_size);
offset += move_size; offset += move_size;
if (offset == buf_size) { if (offset == buf_size) {
fseek (f, start + move_size, SEEK_SET); (void)fseek (f, start + move_size, SEEK_SET);
break; break;
} }
} }

View file

@ -2530,8 +2530,8 @@ else {
} }
crtc->hz = 0; /* back to 0 */ crtc->hz = 0; /* back to 0 */
} }
sim_debug (DBG_CAL|DBG_INT, &sim_timer_dev, "_rtcn_configure_calibrated_clock(newtmr=%d) - Changing Calibrated Timer from %d (%dHz) to %d (%dHz)\n", newtmr, sim_calb_tmr, crtc->last_hz, tmr, rtc->hz);
} }
sim_debug (DBG_CAL|DBG_INT, &sim_timer_dev, "_rtcn_configure_calibrated_clock(newtmr=%d) - Changing Calibrated Timer from %d (%dHz) to %d (%dHz)\n", newtmr, sim_calb_tmr, crtc->hz, tmr, crtc->hz);
sim_calb_tmr = tmr; sim_calb_tmr = tmr;
} }
sim_calb_tmr = tmr; sim_calb_tmr = tmr;
@ -2767,8 +2767,9 @@ if ((inst_delay == 0) && (usec_delay != 0))
inst_delay_d = inst_delay = 1; /* Minimum non-zero delay is 1 instruction */ inst_delay_d = inst_delay = 1; /* Minimum non-zero delay is 1 instruction */
if (uptr->usecs_remaining != 0.0) /* No calibrated timer yet, wait one cycle */ if (uptr->usecs_remaining != 0.0) /* No calibrated timer yet, wait one cycle */
inst_delay_d = inst_delay = 1; /* Minimum non-zero delay is 1 instruction */ inst_delay_d = inst_delay = 1; /* Minimum non-zero delay is 1 instruction */
crtc = &rtcs[sim_calb_tmr]; if (sim_calb_tmr != -1) {
if ((sim_calb_tmr != -1) && (crtc->hz)) { /* Calibrated Timer available? */ crtc = &rtcs[sim_calb_tmr];
if (crtc->hz) { /* Calibrated Timer available? */
int32 inst_til_tick = sim_activate_time (crtc->timer_unit) - 1; int32 inst_til_tick = sim_activate_time (crtc->timer_unit) - 1;
int32 ticks_til_calib = crtc->hz - crtc->ticks; int32 ticks_til_calib = crtc->hz - crtc->ticks;
double usecs_per_tick = floor (1000000.0 / crtc->hz); double usecs_per_tick = floor (1000000.0 / crtc->hz);
@ -2800,6 +2801,7 @@ if ((sim_calb_tmr != -1) && (crtc->hz)) { /* Calibrated Timer available? *
} }
} }
} }
}
/* /*
* We're here to schedule if: * We're here to schedule if:
* No Calibrated Timer, OR * No Calibrated Timer, OR