Use char instead of uint8_t for json::parse (#5877)

The uint8_t usage causes warnings on newer clang versions.

Add GetCharBuffer() to MemoryBuffer classes to make this easy.
This commit is contained in:
Peter Johnson
2023-11-04 22:18:42 -07:00
committed by GitHub
parent ec1d261984
commit 14dcd0d26f
7 changed files with 23 additions and 12 deletions

View File

@@ -457,7 +457,7 @@ AnalysisManager::AnalysisManager(std::string_view path, Settings& settings,
throw FileReadingError(path);
}
m_json = wpi::json::parse(fileBuffer->begin(), fileBuffer->end());
m_json = wpi::json::parse(fileBuffer->GetCharBuffer());
WPI_INFO(m_logger, "Read {}", path);
}
@@ -475,7 +475,7 @@ AnalysisManager::AnalysisManager(std::string_view path, Settings& settings,
throw FileReadingError(newPath);
}
m_json = wpi::json::parse(fileBuffer->begin(), fileBuffer->end());
m_json = wpi::json::parse(fileBuffer->GetCharBuffer());
WPI_INFO(m_logger, "Read {}", newPath);
}

View File

@@ -40,7 +40,7 @@ static wpi::json GetJSON(std::string_view path, wpi::Logger& logger) {
throw std::runtime_error(fmt::format("Unable to read: {}", path));
}
wpi::json json = wpi::json::parse(fileBuffer->begin(), fileBuffer->end());
wpi::json json = wpi::json::parse(fileBuffer->GetCharBuffer());
WPI_INFO(logger, "Read frc-characterization JSON from {}", path);
return json;
}