Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Aug 18, 2024
1 parent 3ba1b9d commit 98423dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/odr/internal/pdf/pdf_cmap_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ std::variant<Object, std::string> CMapParser::read_token() const {

std::string token;
while (true) {
int_type c = m_parser.geti();
if (c == eof) {
int_type i = m_parser.geti();
if (i == eof) {
return token;
}
auto c = static_cast<char_type>(i);
if (ObjectParser::is_whitespace(c)) {
return token;
}
Expand All @@ -50,6 +51,8 @@ std::variant<Object, std::string> CMapParser::read_token() const {
}

void CMapParser::read_codespacerange(std::uint32_t n, CMap &cmap) const {
(void)cmap;

m_parser.skip_whitespace();
for (std::uint32_t i = 0; i < n; ++i) {
auto from_glyph = m_parser.read_object();
Expand Down Expand Up @@ -86,6 +89,8 @@ void CMapParser::read_bfchar(std::uint32_t n, CMap &cmap) const {
}

void CMapParser::read_bfrange(std::uint32_t n, CMap &cmap) const {
(void)cmap;

m_parser.skip_whitespace();
for (std::uint32_t i = 0; i < n; ++i) {
auto from_glyph = m_parser.read_object();
Expand Down
2 changes: 1 addition & 1 deletion src/odr/internal/pdf/pdf_object_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ObjectParser::char_type ObjectParser::getc() const {
in().setstate(std::ios::eofbit);
throw std::runtime_error("unexpected stream exhaust");
}
return c;
return static_cast<char_type>(c);
}

ObjectParser::char_type ObjectParser::bumpc() const {
Expand Down

0 comments on commit 98423dc

Please sign in to comment.