Skip to content

Commit

Permalink
Removed redundant internal error
Browse files Browse the repository at this point in the history
  • Loading branch information
grunt-lucas committed Sep 16, 2023
1 parent 07d92e2 commit 6b31e4c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 0 additions & 2 deletions include/errors_warnings.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ extern const char *const WARN_TRANSPARENCY_COLLAPSE;

// Internal compiler errors (due to bug in the compiler)
void internalerror(std::string message);
void internalerror_numPalettesInPrimaryNeqPrimaryPalettesSize(std::string context, std::size_t configNumPalettesPrimary,
std::size_t primaryPalettesSize);
void internalerror_unknownCompilerMode(std::string context);
void internalerror_unknownDecompilerMode(std::string context);

Expand Down
6 changes: 3 additions & 3 deletions src/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,9 @@ std::unique_ptr<CompiledTileset> compile(PtContext &ctx, const DecompiledTileset
{
if (ctx.compilerConfig.mode == CompilerMode::SECONDARY &&
(ctx.fieldmapConfig.numPalettesInPrimary != ctx.compilerContext.pairedPrimaryTileset->palettes.size())) {
internalerror_numPalettesInPrimaryNeqPrimaryPalettesSize("compiler::compile",
ctx.fieldmapConfig.numPalettesInPrimary,
ctx.compilerContext.pairedPrimaryTileset->palettes.size());
internalerror(fmt::format(
"compiler::compile config.numPalettesInPrimary did not match primary palette set size ({} != {})",
ctx.fieldmapConfig.numPalettesInPrimary, ctx.compilerContext.pairedPrimaryTileset->palettes.size()));
}

auto compiled = std::make_unique<CompiledTileset>();
Expand Down
7 changes: 0 additions & 7 deletions src/errors_warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ static std::string getTilePrettyString(const RGBATile &tile)

void internalerror(std::string message) { throw std::runtime_error(message); }

void internalerror_numPalettesInPrimaryNeqPrimaryPalettesSize(std::string context, std::size_t configNumPalettesPrimary,
std::size_t primaryPalettesSize)
{
internalerror("config.numPalettesInPrimary did not match primary palette set size (" +
std::to_string(configNumPalettesPrimary) + " != " + std::to_string(primaryPalettesSize) + ")");
}

void internalerror_unknownCompilerMode(std::string context) { internalerror(context + " unknown CompilerMode"); }

void internalerror_unknownDecompilerMode(std::string context) { internalerror(context + " unknown DecompilerMode"); }
Expand Down

0 comments on commit 6b31e4c

Please sign in to comment.