Fix C++ "init-statement in selection" warning

This commit is contained in:
Nigel Tao committed 2023-01-26 15:39:23 +11:00
1 parent e915543f09
commit 255d3a0a29
3 files changed
+6 -3

No files matched your search

+2 -1
View File
@@ -786,7 +786,8 @@ compute_exit_code(std::string status_msg) {
// (other non-zero exit codes). Specifically, exit code 2 for internal
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
// linux) for a segmentation fault (e.g. null pointer dereference).
if (size_t i = status_msg.find('='); i != std::string::npos) {
size_t i = status_msg.find('=');
if (i != std::string::npos) {
status_msg = status_msg.substr(0, i);
}
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
+2 -1
View File
@@ -381,7 +381,8 @@ compute_exit_code(std::string status_msg) {
// (other non-zero exit codes). Specifically, exit code 2 for internal
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
// linux) for a segmentation fault (e.g. null pointer dereference).
if (size_t i = status_msg.find('='); i != std::string::npos) {
size_t i = status_msg.find('=');
if (i != std::string::npos) {
status_msg = status_msg.substr(0, i);
}
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;
+2 -1
View File
@@ -593,7 +593,8 @@ compute_exit_code(std::string status_msg) {
// (other non-zero exit codes). Specifically, exit code 2 for internal
// invariant violation, exit code 139 (which is 128 + SIGSEGV on x86_64
// linux) for a segmentation fault (e.g. null pointer dereference).
if (size_t i = status_msg.find('='); i != std::string::npos) {
size_t i = status_msg.find('=');
if (i != std::string::npos) {
status_msg = status_msg.substr(0, i);
}
return (status_msg.find("internal error:") != std::string::npos) ? 2 : 1;