mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilibc] Return empty string instead of null for GetOpMode (#8754)
Clang 21 catches returning `0` from `GetOpMode` as returning `null`. Since this state is very momentary and all comparisons inside WPILib are done against `GetOpModeId` instead, I changed it to return an empty string.
This commit is contained in:
@@ -695,7 +695,7 @@ int64_t DriverStation::GetOpModeId() {
|
||||
|
||||
std::string DriverStation::GetOpMode() {
|
||||
if (!::GetInstance().userProgramStarted) {
|
||||
return 0;
|
||||
return "";
|
||||
}
|
||||
|
||||
return GetInstance().OpModeToString(GetOpModeId());
|
||||
|
||||
Reference in New Issue
Block a user