Cleanup: remove redundant calls to strlen, don't cast "const" away
This commit is contained in:
@@ -197,7 +197,8 @@ struct StringCmp {
|
||||
static int cmpstringp(const void *p1, const void *p2)
|
||||
{
|
||||
/* Case-insensitive comparison. */
|
||||
return BLI_strcasecmp(((StringCmp *)p1)->name, ((StringCmp *)p2)->name);
|
||||
return BLI_strcasecmp(static_cast<const StringCmp *>(p1)->name,
|
||||
static_cast<const StringCmp *>(p2)->name);
|
||||
}
|
||||
|
||||
void UI_list_filter_and_sort_items(uiList *ui_list,
|
||||
|
||||
@@ -489,10 +489,11 @@ static void draw_strip_in_view(bContext *C, wmWindow * /*win*/, wmDrag *drag, co
|
||||
|
||||
BLI_assert(len_text_arr <= ARRAY_SIZE(text_array));
|
||||
|
||||
BLI_string_join_array(text_display, FILE_MAX, text_array, len_text_arr);
|
||||
const size_t text_display_len = BLI_string_join_array(
|
||||
text_display, FILE_MAX, text_array, len_text_arr);
|
||||
|
||||
UI_view2d_text_cache_add_rectf(
|
||||
®ion->v2d, &rect, text_display, strlen(text_display), text_color);
|
||||
®ion->v2d, &rect, text_display, text_display_len, text_color);
|
||||
}
|
||||
batch.flush_batch();
|
||||
|
||||
|
||||
@@ -505,9 +505,9 @@ static void draw_waveform_graticule(ARegion *region, SeqQuadsBatch &quads, const
|
||||
for (int i = 0; i < 3; i++) {
|
||||
const float y = area.ymin + (area.ymax - area.ymin) * lines[i];
|
||||
char buf[10];
|
||||
SNPRINTF(buf, "%.1f", lines[i]);
|
||||
const size_t buf_len = SNPRINTF_RLEN(buf, "%.1f", lines[i]);
|
||||
quads.add_line(x0, y, x1, y, col_grid);
|
||||
UI_view2d_text_cache_add(®ion->v2d, x0 + 8, y + 8, buf, strlen(buf), col_grid);
|
||||
UI_view2d_text_cache_add(®ion->v2d, x0 + 8, y + 8, buf, buf_len, col_grid);
|
||||
}
|
||||
/* Border. */
|
||||
uchar col_border[4] = {64, 64, 64, 128};
|
||||
|
||||
Reference in New Issue
Block a user