From fc812f1821ba55ab54ae529155e8581ca13699b2 Mon Sep 17 00:00:00 2001 From: Paul Philippov Date: Fri, 16 Oct 2026 15:51:21 -0400 Subject: [PATCH] otra: drop unused `base` parameter from `parse_otra_tables` `parse_otra_tables` never read `base`: `parse_otra` folds it into `h.part_off`, `h.seg_off`, and `h.pay_off`, so the tables are already absolute. The parameter only produced `-Wunused-parameter` warnings in every translation unit that includes `otra_format.hpp`. Remove the parameter and update both call sites. --- src/extract/otra.cpp | 2 +- src/otra_format.hpp | 2 +- src/validators/otra.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extract/otra.cpp b/src/extract/otra.cpp index af21d33..b407783 100644 --- a/src/extract/otra.cpp +++ b/src/extract/otra.cpp @@ -52,7 +52,7 @@ bool extract_otra(const Reader& r, const Finding& f, SafeRoot& root, const std:: return true; } - auto tables = otra::parse_otra_tables(r, f.offset, h); + auto tables = otra::parse_otra_tables(r, h); // Flat subtype: no populated tables — the body is a raw flash image. Write it // whole so downstream carving / recursion can work on it. diff --git a/src/otra_format.hpp b/src/otra_format.hpp index ccad054..f651008 100644 --- a/src/otra_format.hpp +++ b/src/otra_format.hpp @@ -113,7 +113,7 @@ inline std::optional
parse_otra(const Reader& r, size_t base) { // Walk the partition + segment tables and classify the subtype. Never throws; // on a flat/opaque image it returns Tables{segmented=false} with empty vectors. -inline Tables parse_otra_tables(const Reader& r, size_t base, const Header& h) { +inline Tables parse_otra_tables(const Reader& r, const Header& h) { Tables t; if (h.npart == 0 || h.npart > kMaxParts || h.nseg == 0 || h.nseg > kMaxSegs) return t; if (h.pay_off > r.size()) return t; diff --git a/src/validators/otra.cpp b/src/validators/otra.cpp index 4591fb8..dc00921 100644 --- a/src/validators/otra.cpp +++ b/src/validators/otra.cpp @@ -42,7 +42,7 @@ bool validate_otra(ValidatorCtx& ctx) { ctx.out.size = r.size() - base; if (!h.version.empty()) ctx.out.version = h.version; - auto tables = otra::parse_otra_tables(r, base, h); + auto tables = otra::parse_otra_tables(r, h); ctx.out.compression = tables.segmented ? "lzo1x" : "none"; if (tables.segmented) {