Skip to content

Commit 3de8c9b

Browse files
svillarrpavlik
authored andcommitted
Fix some missing field initializer warnings
The code was actually initializing the fields after the struct initialization but the compiler is not smart enough to acknowledge that. Explicitly initialize the fields one by one to remove the warnings.
1 parent f122f9f commit 3de8c9b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
loader: Fix some warnings.

src/loader/loader_logger_recorders.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,15 @@ bool DebugUtilsLogRecorder::LogMessage(XrLoaderLogMessageSeverityFlagBits messag
160160
XrDebugUtilsMessageTypeFlagsEXT utils_type = LoaderLogMessageTypesToDebugUtilsMessageTypes(message_type);
161161

162162
// Convert the loader log message into the debug utils log message information
163-
XrDebugUtilsMessengerCallbackDataEXT utils_callback_data = {XR_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT};
163+
XrDebugUtilsMessengerCallbackDataEXT utils_callback_data;
164+
utils_callback_data.type = XR_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT;
164165
utils_callback_data.messageId = callback_data->message_id;
165166
utils_callback_data.functionName = callback_data->command_name;
166167
utils_callback_data.message = callback_data->message;
167-
std::vector<XrDebugUtilsObjectNameInfoEXT> utils_objects(callback_data->object_count,
168-
{XR_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT});
168+
std::vector<XrDebugUtilsObjectNameInfoEXT> utils_objects(callback_data->object_count);
169169
for (uint8_t object = 0; object < callback_data->object_count; ++object) {
170+
utils_objects[object].type = XR_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
171+
utils_objects[object].next = nullptr;
170172
utils_objects[object].objectHandle = callback_data->objects[object].handle;
171173
utils_objects[object].objectType = callback_data->objects[object].type;
172174
utils_objects[object].objectName = callback_data->objects[object].name.c_str();

0 commit comments

Comments
 (0)