Cleanup: replace UI_MAX_NAME_STR with BKE_ST_MAXNAME

Since [0] some comments referencing UI_MAX_NAME_STR were incorrect.
Also correct buffer size for preview_id in uiTemplatePreview so newly
created names are guarantee to be the correct size.

[0]: a180314ac5
This commit is contained in:
Campbell Barton 2024-03-20 15:08:46 +11:00
parent ee64778cac
commit 3135e766ec
2 changed files with 3 additions and 3 deletions

View File

@ -3141,7 +3141,7 @@ void uiTemplatePreview(uiLayout *layout,
Tex *tex = (Tex *)id;
short *pr_texture = nullptr;
char _preview_id[UI_MAX_NAME_STR];
char _preview_id[sizeof(uiPreview::preview_id)];
if (id && !ELEM(GS(id->name), ID_MA, ID_TE, ID_WO, ID_LA, ID_LS)) {
RNA_warning("Expected ID of type material, texture, light, world or line style");

View File

@ -152,7 +152,7 @@ typedef struct Panel {
/** Runtime for drawing. */
struct uiLayout *layout;
/** Defined as UI_MAX_NAME_STR. */
/** Defined as #BKE_ST_MAXNAME. */
char panelname[64];
/** Panel name is identifier for restoring location. */
char *drawname;
@ -329,7 +329,7 @@ typedef struct TransformOrientation {
typedef struct uiPreview {
struct uiPreview *next, *prev;
/** Defined as #UI_MAX_NAME_STR. */
/** Defined as #BKE_ST_MAXNAME. */
char preview_id[64];
short height;
char _pad1[6];