From be750ee4275e9ac485add3123af1d7d08a9b5671 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 21 Jul 2017 21:52:37 -0400 Subject: [PATCH] Eliminated all dangling implicit signedness conversions. --- Outputs/CRT/CRT.cpp | 6 +++--- Outputs/CRT/CRT.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Outputs/CRT/CRT.cpp b/Outputs/CRT/CRT.cpp index 6b5c4ec80..387c28f8d 100644 --- a/Outputs/CRT/CRT.cpp +++ b/Outputs/CRT/CRT.cpp @@ -38,7 +38,7 @@ void CRT::set_new_timing(unsigned int cycles_per_line, unsigned int height_of_di unsigned int multiplied_cycles_per_line = cycles_per_line * time_multiplier_; // generate timing values implied by the given arguments - sync_capacitor_charge_threshold_ = ((int)(syncCapacityLineChargeThreshold * cycles_per_line) * 3) / 4; + sync_capacitor_charge_threshold_ = ((unsigned int)(syncCapacityLineChargeThreshold * cycles_per_line) * 3) / 4; // create the two flywheels horizontal_flywheel_.reset(new Flywheel(multiplied_cycles_per_line, (millisecondsHorizontalRetraceTime * multiplied_cycles_per_line) >> 6, multiplied_cycles_per_line >> 6)); @@ -364,8 +364,8 @@ Outputs::CRT::Rect CRT::get_rect_for_area(int first_line_after_sync, int number_ unsigned int horizontal_retrace_period = horizontal_period - horizontal_scan_period; // make sure that the requested range is visible - if(first_cycle_after_sync < horizontal_retrace_period) first_cycle_after_sync = (int)horizontal_retrace_period; - if(first_cycle_after_sync + number_of_cycles > horizontal_scan_period) number_of_cycles = (int)(horizontal_scan_period - (unsigned)first_cycle_after_sync); + if((unsigned int)first_cycle_after_sync < horizontal_retrace_period) first_cycle_after_sync = (int)horizontal_retrace_period; + if((unsigned int)(first_cycle_after_sync + number_of_cycles) > horizontal_scan_period) number_of_cycles = (int)(horizontal_scan_period - (unsigned)first_cycle_after_sync); float start_x = (float)((unsigned)first_cycle_after_sync - horizontal_retrace_period) / (float)horizontal_scan_period; float width = (float)number_of_cycles / (float)horizontal_scan_period; diff --git a/Outputs/CRT/CRT.hpp b/Outputs/CRT/CRT.hpp index 49f6bb206..f8267a570 100644 --- a/Outputs/CRT/CRT.hpp +++ b/Outputs/CRT/CRT.hpp @@ -43,7 +43,7 @@ class CRT { // elements of sync separation bool is_receiving_sync_; // true if the CRT is currently receiving sync (i.e. this is for edge triggering of horizontal sync) int sync_capacitor_charge_level_; // this charges up during times of sync and depletes otherwise; needs to hit a required threshold to trigger a vertical sync - int sync_capacitor_charge_threshold_; // this charges up during times of sync and depletes otherwise; needs to hit a required threshold to trigger a vertical sync + unsigned int sync_capacitor_charge_threshold_; // this charges up during times of sync and depletes otherwise; needs to hit a required threshold to trigger a vertical sync unsigned int sync_period_; struct Scan {