Make switch statements over enums in engine source use a typed expression to support compiler checking of full coverage.

PiperOrigin-RevId: 556854229
Change-Id: I36a5d146d776e10b946e2f9b51ace4ef3866471b
This commit is contained in:
Yuval Tassa
2023-08-14 11:16:53 -07:00
committed by Copybara-Service
parent 13490962a8
commit e4dddea42a
15 changed files with 71 additions and 51 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ void mj_passive(const mjModel* m, mjData* d) {
int padr = m->jnt_qposadr[i];
int dadr = m->jnt_dofadr[i];
switch (m->jnt_type[i]) {
switch ((mjtJoint) m->jnt_type[i]) {
case mjJNT_FREE:
// apply force
d->qfrc_passive[dadr+0] -= stiffness*(d->qpos[padr+0] - m->qpos_spring[padr+0]);