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:
committed by
Copybara-Service
parent
13490962a8
commit
e4dddea42a
@@ -343,7 +343,7 @@ void mjv_initGeom(mjvGeom* geom, int type, const mjtNum* size,
|
||||
|
||||
// set size (for XYZ scaling)
|
||||
if (size) {
|
||||
switch (type) {
|
||||
switch ((mjtGeom) type) {
|
||||
case mjGEOM_SPHERE:
|
||||
geom->size[0] = (float)size[0];
|
||||
geom->size[1] = (float)size[0];
|
||||
@@ -869,7 +869,7 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
|
||||
int j = m->jnt_bodyid[i];
|
||||
mjtNum* from;
|
||||
mjtNum to[3];
|
||||
switch (m->jnt_type[i]) {
|
||||
switch ((mjtJoint) m->jnt_type[i]) {
|
||||
case mjJNT_FREE:
|
||||
thisgeom->type = mjGEOM_BOX;
|
||||
thisgeom->size[0] = thisgeom->size[1] = thisgeom->size[2] = 0.3*sz[1];
|
||||
|
||||
Reference in New Issue
Block a user