diff --git a/source/blender/blenlib/BLI_uuid.h b/source/blender/blenlib/BLI_uuid.h index 40ca733588a..0f5ec22b3c1 100644 --- a/source/blender/blenlib/BLI_uuid.h +++ b/source/blender/blenlib/BLI_uuid.h @@ -39,7 +39,7 @@ bool BLI_uuid_equal(bUUID uuid1, bUUID uuid2); /** * Format UUID as string. * The buffer must be at least 37 bytes (36 bytes for the UUID + terminating 0). - * Use `UUID_STRING_LEN` from DNA_uuid_types.h if you want to use a constant for this. + * Use `UUID_STRING_SIZE` from DNA_uuid_types.h if you want to use a constant for this. */ void BLI_uuid_format(char *buffer, bUUID uuid) ATTR_NONNULL(); diff --git a/source/blender/blenlib/intern/uuid.cc b/source/blender/blenlib/intern/uuid.cc index bc0f854cfd1..b285b5066f8 100644 --- a/source/blender/blenlib/intern/uuid.cc +++ b/source/blender/blenlib/intern/uuid.cc @@ -90,7 +90,7 @@ void BLI_uuid_format(char *buffer, const bUUID uuid) { const size_t buffer_len_unclamped = BLI_snprintf( buffer, - UUID_STRING_LEN, + UUID_STRING_SIZE, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", uuid.time_low, uuid.time_mid, @@ -105,7 +105,7 @@ void BLI_uuid_format(char *buffer, const bUUID uuid) uuid.node[5]); /* Assert the string length is not clamped. */ - BLI_assert(buffer_len_unclamped == UUID_STRING_LEN - 1); + BLI_assert(buffer_len_unclamped == UUID_STRING_SIZE - 1); UNUSED_VARS_NDEBUG(buffer_len_unclamped); } diff --git a/source/blender/editors/asset/intern/asset_indexer.cc b/source/blender/editors/asset/intern/asset_indexer.cc index 9dea1c6c7e5..c75eacfc7f6 100644 --- a/source/blender/editors/asset/intern/asset_indexer.cc +++ b/source/blender/editors/asset/intern/asset_indexer.cc @@ -268,7 +268,7 @@ struct AssetEntryWriter { void add_catalog_id(const CatalogID &catalog_id) { - char catalog_id_str[UUID_STRING_LEN]; + char catalog_id_str[UUID_STRING_SIZE]; BLI_uuid_format(catalog_id_str, catalog_id); attributes.append_as(std::pair(ATTRIBUTE_ENTRIES_CATALOG_ID, new StringValue(catalog_id_str))); } diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 2b3cd6a5a02..b6c0bcf522f 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1937,7 +1937,7 @@ struct Panel *UI_panel_add_instanced(const struct bContext *C, */ void UI_panels_free_instanced(const struct bContext *C, struct ARegion *region); -#define INSTANCED_PANEL_UNIQUE_STR_LEN 16 +#define INSTANCED_PANEL_UNIQUE_STR_SIZE 16 /** * Find a unique key to append to the #PanelType.idname for the lookup to the panel's #uiBlock. * Needed for instanced panels, where there can be multiple with the same type and identifier. diff --git a/source/blender/editors/interface/interface_panel.cc b/source/blender/editors/interface/interface_panel.cc index 79d71021809..f89f54b805b 100644 --- a/source/blender/editors/interface/interface_panel.cc +++ b/source/blender/editors/interface/interface_panel.cc @@ -283,7 +283,7 @@ void UI_list_panel_unique_str(Panel *panel, char *r_name) { /* The panel sort-order will be unique for a specific panel type because the instanced * panel list is regenerated for every change in the data order / length. */ - BLI_snprintf(r_name, INSTANCED_PANEL_UNIQUE_STR_LEN, "%d", panel->sortorder); + BLI_snprintf(r_name, INSTANCED_PANEL_UNIQUE_STR_SIZE, "%d", panel->sortorder); } /** diff --git a/source/blender/editors/screen/area.cc b/source/blender/editors/screen/area.cc index b0ae69ed8fb..ba3ce0e5bc5 100644 --- a/source/blender/editors/screen/area.cc +++ b/source/blender/editors/screen/area.cc @@ -2695,7 +2695,7 @@ static void ed_panel_draw(const bContext *C, const uiStyle *style = UI_style_get_dpi(); /* Draw panel. */ - char block_name[BKE_ST_MAXNAME + INSTANCED_PANEL_UNIQUE_STR_LEN]; + char block_name[BKE_ST_MAXNAME + INSTANCED_PANEL_UNIQUE_STR_SIZE]; if (unique_panel_str) { /* Instanced panels should have already been added at this point. */ BLI_string_join(block_name, sizeof(block_name), pt->idname, unique_panel_str); @@ -3019,7 +3019,7 @@ void ED_region_panels_layout_ex(const bContext *C, /* Use a unique identifier for instanced panels, otherwise an old block for a different * panel of the same type might be found. */ - char unique_panel_str[INSTANCED_PANEL_UNIQUE_STR_LEN]; + char unique_panel_str[INSTANCED_PANEL_UNIQUE_STR_SIZE]; UI_list_panel_unique_str(panel, unique_panel_str); ed_panel_draw(C, region, diff --git a/source/blender/editors/space_file/asset_catalog_tree_view.cc b/source/blender/editors/space_file/asset_catalog_tree_view.cc index a366e9e5367..d41293ae807 100644 --- a/source/blender/editors/space_file/asset_catalog_tree_view.cc +++ b/source/blender/editors/space_file/asset_catalog_tree_view.cc @@ -301,7 +301,7 @@ void AssetCatalogTreeViewItem::build_context_menu(bContext &C, uiLayout &column) &props); RNA_string_set(&props, "parent_path", catalog_item_.catalog_path().c_str()); - char catalog_id_str_buffer[UUID_STRING_LEN] = ""; + char catalog_id_str_buffer[UUID_STRING_SIZE] = ""; BLI_uuid_format(catalog_id_str_buffer, catalog_item_.get_catalog_id()); uiItemFullO(&column, "ASSET_OT_catalog_delete", diff --git a/source/blender/makesdna/DNA_uuid_types.h b/source/blender/makesdna/DNA_uuid_types.h index 2f0cac4fa66..56c4515f681 100644 --- a/source/blender/makesdna/DNA_uuid_types.h +++ b/source/blender/makesdna/DNA_uuid_types.h @@ -32,7 +32,7 @@ typedef struct bUUID { * Memory required for a string representation of a UUID according to RFC4122. * This is 36 characters for the string + a trailing zero byte. */ -#define UUID_STRING_LEN 37 +#define UUID_STRING_SIZE 37 #ifdef __cplusplus } diff --git a/source/blender/makesrna/intern/rna_asset.c b/source/blender/makesrna/intern/rna_asset.c index be81a523ff1..4fc145e62a9 100644 --- a/source/blender/makesrna/intern/rna_asset.c +++ b/source/blender/makesrna/intern/rna_asset.c @@ -293,7 +293,7 @@ static void rna_AssetMetaData_catalog_id_get(PointerRNA *ptr, char *value) static int rna_AssetMetaData_catalog_id_length(PointerRNA *UNUSED(ptr)) { - return UUID_STRING_LEN - 1; + return UUID_STRING_SIZE - 1; } static void rna_AssetMetaData_catalog_id_set(PointerRNA *ptr, const char *value) diff --git a/source/blender/makesrna/intern/rna_space.cc b/source/blender/makesrna/intern/rna_space.cc index 77ed7bc7005..47fd0943c2f 100644 --- a/source/blender/makesrna/intern/rna_space.cc +++ b/source/blender/makesrna/intern/rna_space.cc @@ -3350,7 +3350,7 @@ static void rna_FileAssetSelectParams_catalog_id_get(PointerRNA *ptr, char *valu static int rna_FileAssetSelectParams_catalog_id_length(PointerRNA * /*ptr*/) { - return UUID_STRING_LEN - 1; + return UUID_STRING_SIZE - 1; } static void rna_FileAssetSelectParams_catalog_id_set(PointerRNA *ptr, const char *value)