Clang-Tidy: Enable bugprone-misplaced-widening-cast

This commit is contained in:
Sergey Sharybin 2020-07-03 17:09:24 +02:00
parent 4a5389816b
commit cad2d32be6
4 changed files with 3 additions and 4 deletions

View File

@ -36,7 +36,6 @@ Checks: >
-bugprone-integer-division,
-bugprone-incorrect-roundings,
-bugprone-suspicious-string-compare,
-bugprone-misplaced-widening-cast,
-bugprone-not-null-terminated-result,
-bugprone-suspicious-missing-comma,
-bugprone-parent-virtual-call,

View File

@ -297,7 +297,7 @@ void blf_font_size(FontBLF *font, unsigned int size, unsigned int dpi)
}
}
err = FT_Set_Char_Size(font->face, 0, (FT_F26Dot6)(size * 64), dpi, dpi);
err = FT_Set_Char_Size(font->face, 0, ((FT_F26Dot6)(size)) * 64, dpi, dpi);
if (err) {
/* FIXME: here we can go through the fixed size and choice a close one */
printf("The current font don't support the size, %u and dpi, %u\n", size, dpi);

View File

@ -1515,7 +1515,7 @@ static void ui_text_clip_right_ex(const uiFontStyle *fstyle,
l_end = BLF_width_to_strlen(fstyle->uifont_id, str, max_len, okwidth - sep_strwidth, &tmp);
memcpy(str + l_end, sep, sep_len + 1); /* +1 for trailing '\0'. */
if (r_final_len) {
*r_final_len = (size_t)(l_end + sep_len);
*r_final_len = (size_t)(l_end) + sep_len;
}
}
}

View File

@ -619,7 +619,7 @@ static void undomesh_to_editmesh(UndoMesh *um, Object *ob, BMEditMesh *em, Key *
if (kb_act->totelem != um->me.totvert) {
/* The current mesh has some extra/missing verts compared to the undo, adjust. */
MEM_SAFE_FREE(kb_act->data);
kb_act->data = MEM_mallocN((size_t)(key->elemsize * bm->totvert), __func__);
kb_act->data = MEM_mallocN((size_t)(key->elemsize) * bm->totvert, __func__);
kb_act->totelem = um->me.totvert;
}