Cleanup: quiet clang warnings

This commit is contained in:
Jacques Lucke 2023-01-23 00:55:15 +01:00
parent 4bef5f3df7
commit 93a840360a
Notes: blender-bot 2024-03-22 15:57:27 +01:00
Referenced by issue #104137, Broken HIP device detection in master
Referenced by issue #104762, Triangulate node cancels geometry transforms of a Set Position node
Referenced by issue #104762, Triangulate node cancels geometry transforms of a Set Position node
3 changed files with 5 additions and 3 deletions

View File

@ -641,7 +641,7 @@ UserDef *BKE_blendfile_userdef_read_from_memory(const void *filebuf,
UserDef *BKE_blendfile_userdef_from_defaults(void)
{
UserDef *userdef = MEM_cnew<UserDef>(__func__);
memcpy(userdef, &U_default, sizeof(*userdef));
*userdef = blender::dna::shallow_copy(U_default);
/* Add-ons. */
{

View File

@ -659,6 +659,8 @@ typedef struct UserDef_Experimental {
(((userdef)->flag & USER_DEVELOPER_UI) && ((userdef)->experimental).member)
typedef struct UserDef {
DNA_DEFINE_CXX_METHODS(UserDef)
/** UserDef has separate do-version handling, and can be read from other files. */
int versionfile, subversionfile;

View File

@ -2304,7 +2304,7 @@ static int wm_userpref_read_exec(bContext *C, wmOperator *op)
const bool use_factory_settings_app_template_only =
(use_factory_settings && RNA_boolean_get(op->ptr, "use_factory_startup_app_template_only"));
UserDef U_backup = U;
UserDef U_backup = blender::dna::shallow_copy(U);
wmHomeFileRead_Params read_homefile_params{};
read_homefile_params.use_data = use_data;
@ -2407,7 +2407,7 @@ static int wm_homefile_read_exec(bContext *C, wmOperator *op)
bool use_userdef = false;
char filepath_buf[FILE_MAX];
const char *filepath = nullptr;
UserDef U_backup = U;
UserDef U_backup = blender::dna::shallow_copy(U);
if (!use_factory_settings) {
PropertyRNA *prop = RNA_struct_find_property(op->ptr, "filepath");