Cleanup: replace C-style casts with functional casts for numeric types

Use function style casts in C++ headers & source.
This commit is contained in:
2022-09-26 17:38:25 +10:00
parent 0210c4df17
commit 333e41eac6
54 changed files with 138 additions and 153 deletions

View File

@@ -3659,10 +3659,10 @@ static void ui_but_build_drawstr_float(uiBut *but, double value)
/* Change negative zero to regular zero, without altering anything else. */
value += +0.0f;
if (value == (double)FLT_MAX) {
if (value == double(FLT_MAX)) {
STR_CONCAT(but->drawstr, slen, "inf");
}
else if (value == (double)-FLT_MAX) {
else if (value == double(-FLT_MAX)) {
STR_CONCAT(but->drawstr, slen, "-inf");
}
else if (subtype == PROP_PERCENTAGE) {

View File

@@ -1396,8 +1396,7 @@ ARegion *UI_tooltip_create_from_gizmo(bContext *C, wmGizmo *gz)
{
wmWindow *win = CTX_wm_window(C);
const float aspect = 1.0f;
float init_position[2] = {static_cast<float>(win->eventstate->xy[0]),
static_cast<float>(win->eventstate->xy[1])};
float init_position[2] = {float(win->eventstate->xy[0]), float(win->eventstate->xy[1])};
uiTooltipData *data = ui_tooltip_data_from_gizmo(C, gz);
if (data == nullptr) {