Fix nits in CFX_CTTGSUBTable
- Rename TRangeRecord to RangeRecord.
- Rename RangeRecord fields to follow the style guide.
- Fix lint errors.
Change-Id: I369f0515299139125c743f3818524cc6e127178e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/107450
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/font/cfx_cttgsubtable.cpp b/core/fpdfapi/font/cfx_cttgsubtable.cpp
index 26cf66d..79de426 100644
--- a/core/fpdfapi/font/cfx_cttgsubtable.cpp
+++ b/core/fpdfapi/font/cfx_cttgsubtable.cpp
@@ -134,11 +134,11 @@
return -1;
}
- const auto& range_records = absl::get<std::vector<TRangeRecord>>(coverage);
- for (const auto& rangeRec : range_records) {
- uint32_t s = rangeRec.Start;
- uint32_t e = rangeRec.End;
- uint32_t si = rangeRec.StartCoverageIndex;
+ const auto& range_records = absl::get<std::vector<RangeRecord>>(coverage);
+ for (const auto& range_rec : range_records) {
+ uint32_t s = range_rec.start;
+ uint32_t e = range_rec.end;
+ uint32_t si = range_rec.start_coverage_index;
if (s <= g && g <= e) {
return si + g - s;
}
@@ -155,7 +155,7 @@
int16_t CFX_CTTGSUBTable::GetInt16(FT_Bytes& p) const {
uint16_t ret = FXSYS_UINT16_GET_MSBFIRST(p);
p += 2;
- return *(int16_t*)&ret;
+ return *reinterpret_cast<int16_t*>(&ret);
}
uint16_t CFX_CTTGSUBTable::GetUInt16(FT_Bytes& p) const {
@@ -167,7 +167,7 @@
int32_t CFX_CTTGSUBTable::GetInt32(FT_Bytes& p) const {
uint32_t ret = FXSYS_UINT32_GET_MSBFIRST(p);
p += 4;
- return *(int32_t*)&ret;
+ return *reinterpret_cast<int32_t*>(&ret);
}
uint32_t CFX_CTTGSUBTable::GetUInt32(FT_Bytes& p) const {
@@ -277,11 +277,11 @@
return glyph_array;
}
- std::vector<TRangeRecord> range_records(GetUInt16(sp));
+ std::vector<RangeRecord> range_records(GetUInt16(sp));
for (auto& range_rec : range_records) {
- range_rec.Start = GetUInt16(sp);
- range_rec.End = GetUInt16(sp);
- range_rec.StartCoverageIndex = GetUInt16(sp);
+ range_rec.start = GetUInt16(sp);
+ range_rec.end = GetUInt16(sp);
+ range_rec.start_coverage_index = GetUInt16(sp);
}
return range_records;
}
@@ -312,7 +312,7 @@
CFX_CTTGSUBTable::FeatureRecord::~FeatureRecord() = default;
-CFX_CTTGSUBTable::TRangeRecord::TRangeRecord() = default;
+CFX_CTTGSUBTable::RangeRecord::RangeRecord() = default;
CFX_CTTGSUBTable::SubTable::SubTable() = default;
diff --git a/core/fpdfapi/font/cfx_cttgsubtable.h b/core/fpdfapi/font/cfx_cttgsubtable.h
index 3e484ad..ebae880 100644
--- a/core/fpdfapi/font/cfx_cttgsubtable.h
+++ b/core/fpdfapi/font/cfx_cttgsubtable.h
@@ -36,18 +36,18 @@
DataVector<uint16_t> lookup_list_indices;
};
- struct TRangeRecord {
- TRangeRecord();
+ struct RangeRecord {
+ RangeRecord();
- uint16_t Start = 0;
- uint16_t End = 0;
- uint16_t StartCoverageIndex = 0;
+ uint16_t start = 0;
+ uint16_t end = 0;
+ uint16_t start_coverage_index = 0;
};
// GlyphArray for format 1.
// RangeRecords for format 2.
using CoverageFormat = absl::
- variant<absl::monostate, DataVector<uint16_t>, std::vector<TRangeRecord>>;
+ variant<absl::monostate, DataVector<uint16_t>, std::vector<RangeRecord>>;
struct SubTable {
SubTable();