Make some global string pointers const, not just the strings.

Minor cleanup.
This commit is contained in:
Henrik Rydgård committed 2023-12-29 14:09:45 +01:00
1 parent f22249cef5
commit e3177ac870
30 files changed
+97 -97

No files matched your search

+3 -3
View File
@@ -80,7 +80,7 @@ RiscVCPUInfoParser::RiscVCPUInfoParser() {
int RiscVCPUInfoParser::ProcessorCount() {
// Not using present as that counts the logical CPUs (aka harts.)
static const char *marker = "processor\t: ";
static const char * const marker = "processor\t: ";
std::set<std::string> processors;
for (auto core : cores_) {
for (auto line : core) {
@@ -107,7 +107,7 @@ int RiscVCPUInfoParser::TotalLogicalCount() {
return high - low + 1;
}
static const char *marker = "hart\t\t: ";
static const char * const marker = "hart\t\t: ";
std::set<std::string> harts;
for (auto core : cores_) {
for (auto line : core) {
@@ -120,7 +120,7 @@ int RiscVCPUInfoParser::TotalLogicalCount() {
}
std::string RiscVCPUInfoParser::ISAString() {
static const char *marker = "isa\t\t: ";
static const char * const marker = "isa\t\t: ";
for (auto core : cores_) {
for (auto line : core) {
if (line.find(marker) != line.npos)