1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-02-16 18:30:32 +00:00

Switches to use of the TargetList typedef wherever possible.

This commit is contained in:
Thomas Harte 2018-04-14 19:46:38 -04:00
parent 7efee9b52b
commit e599e65087
8 changed files with 9 additions and 9 deletions

View File

@ -63,14 +63,14 @@ static std::unique_ptr<Analyser::Static::Target> CartridgeTarget(
(additional audio hardware is also sometimes included, but it's implied by the banking hardware)
*/
static std::vector<std::unique_ptr<Analyser::Static::Target>> CartridgeTargetsFrom(
static Analyser::Static::TargetList CartridgeTargetsFrom(
const std::vector<std::shared_ptr<Storage::Cartridge::Cartridge>> &cartridges) {
// No cartridges implies no targets.
if(cartridges.empty()) {
return {};
}
std::vector<std::unique_ptr<Analyser::Static::Target>> targets;
Analyser::Static::TargetList targets;
for(const auto &cartridge : cartridges) {
const auto &segments = cartridge->get_segments();

View File

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

View File

@ -31,7 +31,7 @@ enum class Error {
receive the supplied static analyser result. The machine has been allocated
on the heap. It is the caller's responsibility to delete the class when finished.
*/
DynamicMachine *MachineForTargets(const std::vector<std::unique_ptr<Analyser::Static::Target>> &targets, const ::ROMMachine::ROMFetcher &rom_fetcher, Error &error);
DynamicMachine *MachineForTargets(const Analyser::Static::TargetList &targets, const ::ROMMachine::ROMFetcher &rom_fetcher, Error &error);
/*!
Returns a short string name for the machine identified by the target,

View File

@ -437,7 +437,7 @@ template<bool is_zx81> class ConcreteMachine:
private:
CPU::Z80::Processor<ConcreteMachine, false, is_zx81> z80_;
std::shared_ptr<Video> video_;
std::unique_ptr<Video> video_;
std::vector<uint8_t> zx81_rom_, zx80_rom_;
uint16_t tape_trap_address_, tape_return_address_;

View File

@ -10,6 +10,6 @@
@interface CSStaticAnalyser (ResultVector)
- (std::vector<std::unique_ptr<Analyser::Static::Target>> &)targets;
- (Analyser::Static::TargetList &)targets;
@end

View File

@ -594,7 +594,7 @@ static NSDictionary<NSString *, AtariROMRecord *> *romRecordsBySHA1 = @{
for(int c = 0; c < CC_SHA1_DIGEST_LENGTH; c++) [sha1 appendFormat:@"%02x", sha1Bytes[c]];
// get an analysis of the file
std::vector<std::unique_ptr<Analyser::Static::Target>> targets = Analyser::Static::GetTargets([fullPath UTF8String]);
TargetList targets = Analyser::Static::GetTargets([fullPath UTF8String]);
// grab the ROM record
AtariROMRecord *romRecord = romRecordsBySHA1[sha1];

View File

@ -212,7 +212,7 @@ static NSDictionary<NSString *, MSXROMRecord *> *romRecordsBySHA1 = @{
for(int c = 0; c < CC_SHA1_DIGEST_LENGTH; c++) [sha1 appendFormat:@"%02x", sha1Bytes[c]];
// get an analysis of the file
std::vector<std::unique_ptr<Analyser::Static::Target>> targets = Analyser::Static::GetTargets([fullPath UTF8String]);
TargetList targets = Analyser::Static::GetTargets([fullPath UTF8String]);
// grab the ROM record
MSXROMRecord *romRecord = romRecordsBySHA1[sha1];

View File

@ -239,7 +239,7 @@ int main(int argc, char *argv[]) {
}
// Determine the machine for the supplied file.
std::vector<std::unique_ptr<Analyser::Static::Target>> targets = Analyser::Static::GetTargets(arguments.file_name);
TargetList targets = Analyser::Static::GetTargets(arguments.file_name);
if(targets.empty()) {
std::cerr << "Cannot open " << arguments.file_name << "; no target machine found" << std::endl;
return -1;