Skip to content

Commit

Permalink
Start fixing some of the gcc 12 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Jan 22, 2024
1 parent 6ee9c28 commit d6373aa
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/CurlManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ std::string CurlManager::doPut(const std::string& furl, const std::string& conte
std::string cl = "Content-Length: " + std::to_string(data.size());
head = curl_slist_append(head, cl.c_str());

curl_easy_setopt(curl, CURLOPT_PUT, 1L);
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
//curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, head);

ReadDataInfo dta;
Expand Down
5 changes: 3 additions & 2 deletions src/channeloutput/PixelString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,8 @@ void PixelString::AutoCreateOverlayModels(const std::vector<PixelString*>& strin
desc = "String-" + std::to_string(s + 1);
if (strings[s]->m_virtualStrings.size() > 1) {
desc.append(1, vsnum);
desc += "-" + std::to_string(vsidx + 1);
desc += std::string("-");
desc += std::to_string(vsidx + 1);
if (strings[s]->m_virtualStrings[vs].receiverNum == -1) {
vsidx++;
} else if (vs != 0) {
Expand Down Expand Up @@ -675,7 +676,7 @@ void PixelString::AutoCreateOverlayModels(const std::vector<PixelString*>& strin

if (name.find("Tree") != std::string::npos || name.find("TREE") != std::string::npos || name.find("tree") != std::string::npos || name.find("Vert") != std::string::npos || name.find("vert") != std::string::npos) {
// some common names that are usually vertical oriented
orientation = "V";
orientation = std::string("V");
}

if ((channelCount > 0) && (rn == -1)) {
Expand Down
4 changes: 2 additions & 2 deletions src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,9 @@ std::string ReplaceKeywords(std::string str, std::map<std::string, std::string>&
std::string key;

for (auto& k : keywords) {
key = "%";
key = std::string("%");
key += k.first;
key += "%";
key += std::string("%");

ReplaceString(str, key, k.second);
}
Expand Down
12 changes: 6 additions & 6 deletions src/oled/FPPMainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class BridgeStatsPage : public ListOLEDPage {
Json::Value result;
if (LoadJsonFromString(d, result)) {
items.clear();
items.push_back("Univ Pckts Err");
items.emplace_back("Univ Pckts Err");
for (int x = 0; x < result["universes"].size(); x++) {
Json::Value u = result["universes"][x];
std::string l = u["id"].asString();
Expand Down Expand Up @@ -345,16 +345,16 @@ void FPPMainMenu::itemSelected(const std::string& item) {
std::string nvresults;
std::string nv = "http://127.0.0.1/api/settings/EnableTethering";
if (nitem == "Automatic") {
nvdata = "0";
nvdata = std::string("0");
} else if (nitem == "On") {
nvdata = "1";
nvdata = std::string("1");
} else if (nitem == "Off") {
nvdata = "2";
nvdata = std::string("2");
} else {
nvdata = "0";
nvdata = std::string("0");
}
urlPut(nv, nvdata, nvresults);
nvdata = "1";
nvdata = std::string("1");
urlPut("http://127.0.0.1/api/settings/rebootFlag", "1", nvresults);

RebootPromptPage* pg = new RebootPromptPage("Reboot Required", "Reboot FPPD?", this);
Expand Down
2 changes: 1 addition & 1 deletion src/oled/NetworkOLEDPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void FPPNetworkOLEDPage::setParameterIP(const std::string& tp, const std::string
v = v.substr(1);
}
if (v.empty()) {
v = "0";
v = std::string("0");
}
}
if (x < 3) {
Expand Down
4 changes: 2 additions & 2 deletions src/scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ pid_t RunScript(std::string script, std::string scriptArgs, std::vector<std::pai
for (int p = 0; p < parts.size(); p++) {
if (tmpPart == "") {
if (startsWith(parts[p], "\"")) {
quote = "\"";
quote = std::string("\"");

tmpPart = parts[p].substr(1);
} else if (startsWith(parts[p], "'")) {
quote = "'";
quote = std::string("'");
tmpPart = parts[p].substr(1);
} else {
args[i] = strdup(parts[p].c_str());
Expand Down
4 changes: 2 additions & 2 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ void SettingsConfig::LoadSettingsInfo() {
} else {
if ((type == "checkbox") ||
(type == "number")) {
def = "0";
def = std::string("0");
} else {
def = "";
def = std::string("");
}
}

Expand Down

0 comments on commit d6373aa

Please sign in to comment.