Skip to content

Commit

Permalink
Renamed ERROR_XXX to VAERROR_XXX (to avoid the generic name 'ERROR')
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Sep 1, 2024
1 parent 85e87da commit 4e9582a
Show file tree
Hide file tree
Showing 63 changed files with 730 additions and 730 deletions.
4 changes: 2 additions & 2 deletions Emulator/Base/CoreComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ CoreComponent::load(const u8 *buffer)

// Check integrity
if (hash != c->checksum(false) || FORCE_SNAP_CORRUPTED) {
if (SNP_DEBUG) { fatalError; } else { throw Error(ERROR_SNAP_CORRUPTED); }
if (SNP_DEBUG) { fatalError; } else { throw Error(VAERROR_SNAP_CORRUPTED); }
}

debug(SNP_DEBUG, "Loaded %ld bytes (expected %ld)\n", count, c->size(false));
Expand Down Expand Up @@ -306,7 +306,7 @@ CoreComponent::save(u8 *buffer)

// Check integrity
if (count != c->size(false) || FORCE_SNAP_CORRUPTED) {
if (SNP_DEBUG) { fatalError; } else { throw Error(ERROR_SNAP_CORRUPTED); }
if (SNP_DEBUG) { fatalError; } else { throw Error(VAERROR_SNAP_CORRUPTED); }
}

debug(SNP_DEBUG, "Saved %ld bytes (expected %ld)\n", count, c->size(false));
Expand Down
14 changes: 7 additions & 7 deletions Emulator/Base/Defaults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Defaults::load(const fs::path &path)
auto fs = std::ifstream(path, std::ifstream::binary);

if (!fs.is_open()) {
throw Error(ERROR_FILE_NOT_FOUND);
throw Error(VAERROR_FILE_NOT_FOUND);
}

debug(DEF_DEBUG, "Loading user defaults from %s...\n", path.string().c_str());
Expand Down Expand Up @@ -276,7 +276,7 @@ Defaults::load(std::stringstream &stream)
continue;
}

throw Error(ERROR_SYNTAX, line);
throw Error(VAERROR_SYNTAX, line);
}

if (accepted || skipped) {
Expand All @@ -291,7 +291,7 @@ Defaults::save(const fs::path &path)
auto fs = std::ofstream(path, std::ofstream::binary);

if (!fs.is_open()) {
throw Error(ERROR_FILE_CANT_WRITE);
throw Error(VAERROR_FILE_CANT_WRITE);
}

save(fs);
Expand Down Expand Up @@ -360,7 +360,7 @@ Defaults::getRaw(const string &key) const
if (values.contains(key)) return values.at(key);
if (fallbacks.contains(key)) return fallbacks.at(key);

throw Error(ERROR_INVALID_KEY, key);
throw Error(VAERROR_INVALID_KEY, key);
}

i64
Expand Down Expand Up @@ -397,7 +397,7 @@ Defaults::getFallbackRaw(const string &key) const
{
if (fallbacks.contains(key)) return fallbacks.at(key);

throw Error(ERROR_INVALID_KEY, key);
throw Error(VAERROR_INVALID_KEY, key);
}

i64
Expand Down Expand Up @@ -440,7 +440,7 @@ Defaults::set(const string &key, const string &value)

warn("Invalid key: %s\n", key.c_str());
assert(false);
throw Error(ERROR_INVALID_KEY, key);
throw Error(VAERROR_INVALID_KEY, key);
}

values[key] = value;
Expand Down Expand Up @@ -528,7 +528,7 @@ Defaults::remove(const string &key)

warn("Invalid key: %s\n", key.c_str());
assert(false);
throw Error(ERROR_INVALID_KEY, key);
throw Error(VAERROR_INVALID_KEY, key);
}
if (values.contains(key)) {
values.erase(key);
Expand Down
Loading

0 comments on commit 4e9582a

Please sign in to comment.