Cleanup: clang-tidy warnings

Silenciate warnings of usage of 'else' after 'return'
This commit is contained in:
Germano Cavalcante 2021-11-23 10:13:31 -03:00
parent bba6fe83e2
commit b7c98c87ac
1 changed files with 28 additions and 22 deletions

View File

@ -144,7 +144,8 @@ static void *t_view_get(TransInfo *t)
View3D *v3d = t->area->spacedata.first;
return (void *)v3d;
}
else if (t->region) {
if (t->region) {
return (void *)&t->region->v2d;
}
return NULL;
@ -158,29 +159,34 @@ static int t_around_get(TransInfo *t)
}
ScrArea *area = t->area;
if (t->spacetype == SPACE_VIEW3D) {
/* Bend always uses the cursor. */
if (t->mode == TFM_BEND) {
return V3D_AROUND_CURSOR;
}
else {
switch (t->spacetype) {
case SPACE_VIEW3D: {
if (t->mode == TFM_BEND) {
/* Bend always uses the cursor. */
return V3D_AROUND_CURSOR;
}
return t->settings->transform_pivot_point;
}
}
else if (t->spacetype == SPACE_IMAGE) {
SpaceImage *sima = area->spacedata.first;
return sima->around;
}
else if (t->spacetype == SPACE_GRAPH) {
SpaceGraph *sipo = area->spacedata.first;
return sipo->around;
}
else if (t->spacetype == SPACE_CLIP) {
SpaceClip *sclip = area->spacedata.first;
return sclip->around;
}
else if (t->spacetype == SPACE_SEQ && t->region->regiontype == RGN_TYPE_PREVIEW) {
return SEQ_tool_settings_pivot_point_get(t->scene);
case SPACE_IMAGE: {
SpaceImage *sima = area->spacedata.first;
return sima->around;
}
case SPACE_GRAPH: {
SpaceGraph *sipo = area->spacedata.first;
return sipo->around;
}
case SPACE_CLIP: {
SpaceClip *sclip = area->spacedata.first;
return sclip->around;
}
case SPACE_SEQ: {
if (t->region->regiontype == RGN_TYPE_PREVIEW) {
return SEQ_tool_settings_pivot_point_get(t->scene);
}
break;
}
default:
break;
}
return V3D_AROUND_CENTER_BOUNDS;