Skip to content

Commit 86b0ecb

Browse files
Edward Limmeta-codesync[bot]
authored andcommitted
Fix -Wswitch-enum errors in FBAMRestorableDevice.m
Summary: Latest stables are blocked https://www.internalfb.com/shipyard/stable/fbobjc_stable/overview?session_id=1254665563091619 as a result of the enablement of We enabling [-Wswitch-enum for all Apple targets](https://fb.workplace.com/groups/mobile.sheriffs/permalink/29958097777145452/) Add explicit handling for `AMRestorableDeviceStateUnknown` in two switch statements in `FBAMRestorableDevice.m` to resolve compilation errors. The compiler with `-Werror,-Wswitch-enum` requires all enumeration values to be explicitly handled in switch statements. The `AMRestorableDeviceStateUnknown` case was missing from: 1. The `state` method at line 57 2. The `targetStateForDeviceState:` method at line 133 Both now explicitly handle the unknown state by returning `FBiOSTargetStateUnknown`. Differential Revision: D86477448 Privacy Context Container: L1246528 fbshipit-source-id: dbf49ad192db331e532352f439b4631a3a83d1b1
1 parent f7663f0 commit 86b0ecb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

FBDeviceControl/Management/FBAMRestorableDevice.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ - (FBiOSTargetState)state
6363
return FBiOSTargetStateRestoreOS;
6464
case AMRestorableDeviceStateBootedOS:
6565
return FBiOSTargetStateBooted;
66+
case AMRestorableDeviceStateUnknown:
67+
return FBiOSTargetStateUnknown;
6668
default:
6769
return FBiOSTargetStateUnknown;
6870
}
@@ -139,6 +141,8 @@ + (FBiOSTargetState)targetStateForDeviceState:(AMRestorableDeviceState)state
139141
return FBiOSTargetStateRestoreOS;
140142
case AMRestorableDeviceStateBootedOS:
141143
return FBiOSTargetStateBooted;
144+
case AMRestorableDeviceStateUnknown:
145+
return FBiOSTargetStateUnknown;
142146
default:
143147
return FBiOSTargetStateUnknown;
144148
}

0 commit comments

Comments
 (0)