[Bf-blender-cvs] [3a6f481d5a7] master: Fix windows build: Don't use designated initializers in C++

Hans Goudey noreply at git.blender.org
Sat Apr 24 21:16:03 CEST 2021


Commit: 3a6f481d5a73bd2f35877394f2c4362697572663
Author: Hans Goudey
Date:   Sat Apr 24 14:15:57 2021 -0500
Branches: master
https://developer.blender.org/rB3a6f481d5a73bd2f35877394f2c4362697572663

Fix windows build: Don't use designated initializers in C++

Removes a cast in an argument followed by an initializer list, and
designated initializers, which are only part of the C++20 standard.

===================================================================

M	source/blender/editors/space_info/info_stats.cc
M	source/blender/editors/space_info/space_info.cc

===================================================================

diff --git a/source/blender/editors/space_info/info_stats.cc b/source/blender/editors/space_info/info_stats.cc
index 71a2594a8be..de92feaed10 100644
--- a/source/blender/editors/space_info/info_stats.cc
+++ b/source/blender/editors/space_info/info_stats.cc
@@ -696,7 +696,8 @@ void ED_info_draw_stats(
 
   UI_FontThemeColor(font_id, TH_TEXT_HI);
   BLF_enable(font_id, BLF_SHADOW);
-  BLF_shadow(font_id, 5, (const float[4]){0.0f, 0.0f, 0.0f, 1.0f});
+  const float shadow_color[4] = {0.0f, 0.0f, 0.0f, 1.0f};
+  BLF_shadow(font_id, 5, shadow_color);
   BLF_shadow_offset(font_id, 1, -1);
 
   /* Translated labels for each stat row. */
diff --git a/source/blender/editors/space_info/space_info.cc b/source/blender/editors/space_info/space_info.cc
index 43716a70f90..f24d1949a91 100644
--- a/source/blender/editors/space_info/space_info.cc
+++ b/source/blender/editors/space_info/space_info.cc
@@ -255,11 +255,10 @@ static void info_header_region_message_subscribe(const wmRegionMessageSubscribeP
   struct wmMsgBus *mbus = params->message_bus;
   ARegion *region = params->region;
 
-  wmMsgSubscribeValue msg_sub_value_region_tag_redraw = {
-      .owner = region,
-      .user_data = region,
-      .notify = ED_region_do_msg_notify_tag_redraw,
-  };
+  wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
+  msg_sub_value_region_tag_redraw.owner = region;
+  msg_sub_value_region_tag_redraw.user_data = region;
+  msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
 
   WM_msg_subscribe_rna_anon_prop(mbus, Window, view_layer, &msg_sub_value_region_tag_redraw);
   WM_msg_subscribe_rna_anon_prop(mbus, ViewLayer, name, &msg_sub_value_region_tag_redraw);



More information about the Bf-blender-cvs mailing list