1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 03:32:01 +00:00

Cuts down unused parameter warnings to just a few that may well indicate implementation errors.

This commit is contained in:
Thomas Harte 2020-05-30 01:06:43 -04:00
parent d066dd2b44
commit 48afc54af6
24 changed files with 42 additions and 25 deletions

View File

@ -179,7 +179,7 @@ static bool CheckBootSector(const std::shared_ptr<Storage::Disk::Disk> &disk, co
return false;
}
Analyser::Static::TargetList Analyser::Static::AmstradCPC::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) {
Analyser::Static::TargetList Analyser::Static::AmstradCPC::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
TargetList destination;
auto target = std::make_unique<Target>();
target->confidence = 0.5;

View File

@ -88,7 +88,7 @@ static void DeterminePagingFor8kCartridge(Target &target, const Storage::Cartrid
else if(tigervision_access_count > atari_access_count) target.paging_model = Target::PagingModel::Tigervision;
}
static void DeterminePagingFor16kCartridge(Target &target, const Storage::Cartridge::Cartridge::Segment &segment, const Analyser::Static::MOS6502::Disassembly &disassembly) {
static void DeterminePagingFor16kCartridge(Target &target, const Storage::Cartridge::Cartridge::Segment &, const Analyser::Static::MOS6502::Disassembly &disassembly) {
// Make an assumption that this is the Atari paging model.
target.paging_model = Target::PagingModel::Atari16k;
@ -108,7 +108,7 @@ static void DeterminePagingFor16kCartridge(Target &target, const Storage::Cartri
if(mnetwork_access_count > atari_access_count) target.paging_model = Target::PagingModel::MNetwork;
}
static void DeterminePagingFor64kCartridge(Target &target, const Storage::Cartridge::Cartridge::Segment &segment, const Analyser::Static::MOS6502::Disassembly &disassembly) {
static void DeterminePagingFor64kCartridge(Target &target, const Storage::Cartridge::Cartridge::Segment &, const Analyser::Static::MOS6502::Disassembly &disassembly) {
// Make an assumption that this is a Tigervision if there is a write to 3F.
target.paging_model =
(disassembly.external_stores.find(0x3f) != disassembly.external_stores.end()) ?
@ -177,7 +177,7 @@ static void DeterminePagingForCartridge(Target &target, const Storage::Cartridge
}
}
Analyser::Static::TargetList Analyser::Static::Atari2600::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) {
Analyser::Static::TargetList Analyser::Static::Atari2600::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
// TODO: sanity checking; is this image really for an Atari 2600?
auto target = std::make_unique<Target>();
target->confidence = 0.5;

View File

@ -52,7 +52,7 @@ static std::vector<std::shared_ptr<Storage::Cartridge::Cartridge>>
return coleco_cartridges;
}
Analyser::Static::TargetList Analyser::Static::Coleco::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) {
Analyser::Static::TargetList Analyser::Static::Coleco::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
TargetList targets;
auto target = std::make_unique<Target>(Machine::ColecoVision);
target->confidence = 1.0f - 1.0f / 32768.0f;

View File

@ -42,7 +42,7 @@ static std::vector<std::shared_ptr<Storage::Cartridge::Cartridge>>
return vic20_cartridges;
}
Analyser::Static::TargetList Analyser::Static::Commodore::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) {
Analyser::Static::TargetList Analyser::Static::Commodore::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType) {
TargetList destination;
auto target = std::make_unique<Target>();

View File

@ -260,7 +260,7 @@ static Analyser::Static::TargetList CartridgeTargetsFrom(
return targets;
}
Analyser::Static::TargetList Analyser::Static::MSX::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) {
Analyser::Static::TargetList Analyser::Static::MSX::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
TargetList destination;
// Append targets for any cartridges that look correct.

View File

@ -9,7 +9,7 @@
#include "StaticAnalyser.hpp"
#include "Target.hpp"
Analyser::Static::TargetList Analyser::Static::Macintosh::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) {
Analyser::Static::TargetList Analyser::Static::Macintosh::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType) {
// This analyser can comprehend disks and mass-storage devices only.
if(media.disks.empty() && media.mass_storage_devices.empty()) return {};

View File

@ -13,7 +13,7 @@
#include <algorithm>
#include <cstring>
Analyser::Static::TargetList Analyser::Static::Sega::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) {
Analyser::Static::TargetList Analyser::Static::Sega::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType) {
if(media.cartridges.empty())
return {};

View File

@ -28,7 +28,7 @@ static std::vector<Storage::Data::ZX8081::File> GetFiles(const std::shared_ptr<S
return files;
}
Analyser::Static::TargetList Analyser::Static::ZX8081::GetTargets(const Media &media, const std::string &file_name, TargetPlatform::IntType potential_platforms) {
Analyser::Static::TargetList Analyser::Static::ZX8081::GetTargets(const Media &media, const std::string &, TargetPlatform::IntType potential_platforms) {
TargetList destination;
if(!media.tapes.empty()) {
std::vector<Storage::Data::ZX8081::File> files = GetFiles(media.tapes.front());

View File

@ -148,7 +148,7 @@ uint8_t ACIA::parity(uint8_t value) {
return value ^ (parity_ == Parity::Even);
}
bool ACIA::serial_line_did_produce_bit(Serial::Line *line, int bit) {
bool ACIA::serial_line_did_produce_bit(Serial::Line *, int bit) {
// Shift this bit into the 11-bit input register; this is big enough to hold
// the largest transmission symbol.
++bits_received_;

View File

@ -19,7 +19,7 @@ Keyboard::Keyboard(const std::set<Key> &essential_modifiers) : essential_modifie
Keyboard::Keyboard(const std::set<Key> &observed_keys, const std::set<Key> &essential_modifiers) :
observed_keys_(observed_keys), essential_modifiers_(essential_modifiers), is_exclusive_(false) {}
bool Keyboard::set_key_pressed(Key key, char value, bool is_pressed) {
bool Keyboard::set_key_pressed(Key key, char, bool is_pressed) {
const size_t key_offset = size_t(key);
if(key_offset >= key_states_.size()) {
key_states_.resize(key_offset+1, false);

View File

@ -252,7 +252,7 @@ void VideoBase::output_low_resolution(uint8_t *target, const uint8_t *const sour
}
}
void VideoBase::output_fat_low_resolution(uint8_t *target, const uint8_t *const source, size_t length, int column, int row) const {
void VideoBase::output_fat_low_resolution(uint8_t *target, const uint8_t *const source, size_t length, int, int row) const {
const int row_shift = row&4;
for(size_t c = 0; c < length; ++c) {
// Fat low-resolution mode appears not to do anything to try to make odd and

View File

@ -286,7 +286,7 @@ void IntelligentKeyboard::set_mouse_position(uint16_t x, uint16_t y) {
mouse_position_[1] = std::min(int(y), mouse_range_[1]);
}
void IntelligentKeyboard::set_mouse_keycode_reporting(uint8_t delta_x, uint8_t delta_y) {
void IntelligentKeyboard::set_mouse_keycode_reporting(uint8_t, uint8_t) {
LOG("Unimplemented: set mouse keycode reporting");
}
@ -308,7 +308,7 @@ void IntelligentKeyboard::set_mouse_y_upward() {
mouse_y_multiplier_ = -1;
}
void IntelligentKeyboard::set_mouse_button_actions(uint8_t actions) {
void IntelligentKeyboard::set_mouse_button_actions(uint8_t) {
LOG("Unimplemented: set mouse button actions");
}
@ -461,6 +461,10 @@ void IntelligentKeyboard::set_joystick_interrogation_mode() {
}
void IntelligentKeyboard::set_joystick_keycode_mode(VelocityThreshold horizontal, VelocityThreshold vertical) {
// TODO: honour velocity thresholds.
(void)horizontal;
(void)vertical;
joystick_mode_ = JoystickMode::KeyCode;
clear_joystick_events();
}
@ -494,7 +498,7 @@ void IntelligentKeyboard::interrogate_joysticks() {
}
}
void IntelligentKeyboard::set_joystick_monitoring_mode(uint8_t rate) {
void IntelligentKeyboard::set_joystick_monitoring_mode(uint8_t) {
LOG("Unimplemented: joystick monitoring mode");
}

View File

@ -130,7 +130,7 @@ Video::Video() :
crt_.set_visible_area(crt_.get_rect_for_area(33, 260, 440, 1700, 4.0f / 3.0f));
}
void Video::set_ram(uint16_t *ram, size_t size) {
void Video::set_ram(uint16_t *ram, size_t) {
ram_ = ram;
}

View File

@ -52,6 +52,9 @@ void Tape::set_is_in_input_mode(bool is_in_input_mode) {
}
void Tape::set_counter(uint8_t value) {
// TODO: use value.
(void)value;
output_.cycles_into_pulse = 0;
output_.bits_remaining_until_empty = 0;
}

View File

@ -14,14 +14,14 @@ MachineTypes::MappedKeyboardMachine::MappedKeyboardMachine(const std::set<Inputs
keyboard_.set_delegate(this);
}
bool MappedKeyboardMachine::keyboard_did_change_key(Inputs::Keyboard *keyboard, Inputs::Keyboard::Key key, bool is_pressed) {
bool MappedKeyboardMachine::keyboard_did_change_key(Inputs::Keyboard *, Inputs::Keyboard::Key key, bool is_pressed) {
const uint16_t mapped_key = get_keyboard_mapper()->mapped_key_for_key(key);
if(mapped_key == KeyNotMapped) return false;
set_key_state(mapped_key, is_pressed);
return true;
}
void MappedKeyboardMachine::reset_all_keys(Inputs::Keyboard *keyboard) {
void MappedKeyboardMachine::reset_all_keys(Inputs::Keyboard *) {
// TODO: unify naming.
clear_all_keys();
}

View File

@ -72,7 +72,7 @@ struct ActivityObserver: public Activity::Observer {
[machine.delegate machine:machine led:[NSString stringWithUTF8String:name.c_str()] didChangeToLit:lit];
}
void announce_drive_event(const std::string &name, DriveEvent event) final {
void announce_drive_event(const std::string &name, DriveEvent) final {
[machine.delegate machine:machine ledShouldBlink:[NSString stringWithUTF8String:name.c_str()]];
}

View File

@ -8,6 +8,8 @@
#import "NSData+CRC32.h"
#include <zlib.h>
@implementation NSData (StdVector)
- (NSNumber *)crc32 {

View File

@ -67,7 +67,7 @@
CVDisplayLinkStart(_displayLink);
}
static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *now, const CVTimeStamp *outputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext) {
static CVReturn DisplayLinkCallback(__unused CVDisplayLinkRef displayLink, const CVTimeStamp *now, const CVTimeStamp *outputTime, __unused CVOptionFlags flagsIn, __unused CVOptionFlags *flagsOut, void *displayLinkContext) {
CSOpenGLView *const view = (__bridge CSOpenGLView *)displayLinkContext;
// Schedule an opportunity to check that the display link is still linked to the correct display.
@ -298,7 +298,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
if(!self.shouldCaptureMouse) {
[_mouseHideTimer invalidate];
_mouseHideTimer = [NSTimer scheduledTimerWithTimeInterval:3.0 repeats:NO block:^(NSTimer * _Nonnull timer) {
_mouseHideTimer = [NSTimer scheduledTimerWithTimeInterval:3.0 repeats:NO block:^(__unused NSTimer * _Nonnull timer) {
[NSCursor setHiddenUntilMouseMoves:YES];
[self.delegate openGLViewWillHideOSMouseCursor:self];
}];

View File

@ -50,7 +50,7 @@ void Metrics::announce_did_resize() {
frames_missed_ = frames_hit_ = 0;
}
void Metrics::announce_draw_status(size_t lines, std::chrono::high_resolution_clock::duration duration, bool complete) {
void Metrics::announce_draw_status(size_t, std::chrono::high_resolution_clock::duration, bool complete) {
if(!complete) {
++frames_missed_;
} else {

View File

@ -125,6 +125,8 @@ std::vector<uint8_t> Storage::Data::ZX8081::DataFromString(const std::wstring &s
std::vector<uint8_t> data;
// TODO
(void)string;
(void)is_zx81;
return data;
}

View File

@ -103,6 +103,9 @@ Storage::Disk::PCMSegment AppleGCR::five_and_three_data(const uint8_t *source) {
data[411] = epilogue[1];
data[416] = epilogue[2];
// TODO: encode.
(void)source;
// std::size_t source_pointer = 0;
// std::size_t destination_pointer = 3;
// while(source_pointer < 255) {

View File

@ -156,7 +156,7 @@ class FMEncoder: public Encoder {
output_short(FMDeletedDataAddressMark);
}
size_t item_size(SurfaceItem item) {
size_t item_size(SurfaceItem) {
// Marks are just slightly-invalid bytes, so everything is the same length.
return 2;
}

View File

@ -17,7 +17,7 @@ Track::Event UnformattedTrack::get_next_event() {
return event;
}
Storage::Time UnformattedTrack::seek_to(const Time &time_since_index_hole) {
Storage::Time UnformattedTrack::seek_to(const Time &) {
return Time(0);
}

View File

@ -120,6 +120,9 @@ void Header::serialise(uint8_t *target, uint16_t length) {
case Header::EndOfTape: target[0] = 0x05; break;
}
// TODO: validate length.
(void)length;
std::memcpy(&target[1], data.data(), 191);
}