summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/ipc_helpers.h19
-rw-r--r--src/core/hle/kernel/handle_table.cpp2
-rw-r--r--src/core/hle/kernel/scheduler.cpp10
-rw-r--r--src/core/hle/service/bcat/backend/boxcat.cpp10
-rw-r--r--src/core/hle/service/hid/controllers/keyboard.cpp4
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp25
-rw-r--r--src/core/hle/service/hid/hid.cpp2
-rw-r--r--src/core/hle/service/mii/manager.cpp4
-rw-r--r--src/core/hle/service/sockets/sockets_translate.cpp16
-rw-r--r--src/core/hle/service/sockets/sockets_translate.h4
-rw-r--r--src/core/hle/service/time/time_zone_manager.cpp21
-rw-r--r--src/core/hle/service/vi/vi.cpp2
12 files changed, 52 insertions, 67 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h
index 1b503331f..1c354037d 100644
--- a/src/core/hle/ipc_helpers.h
+++ b/src/core/hle/ipc_helpers.h
@@ -38,10 +38,11 @@ public:
38 explicit RequestHelperBase(Kernel::HLERequestContext& context) 38 explicit RequestHelperBase(Kernel::HLERequestContext& context)
39 : context(&context), cmdbuf(context.CommandBuffer()) {} 39 : context(&context), cmdbuf(context.CommandBuffer()) {}
40 40
41 void Skip(unsigned size_in_words, bool set_to_null) { 41 void Skip(u32 size_in_words, bool set_to_null) {
42 if (set_to_null) 42 if (set_to_null) {
43 memset(cmdbuf + index, 0, size_in_words * sizeof(u32)); 43 memset(cmdbuf + index, 0, size_in_words * sizeof(u32));
44 index += size_in_words; 44 }
45 index += static_cast<ptrdiff_t>(size_in_words);
45 } 46 }
46 47
47 /** 48 /**
@@ -49,15 +50,15 @@ public:
49 */ 50 */
50 void AlignWithPadding() { 51 void AlignWithPadding() {
51 if (index & 3) { 52 if (index & 3) {
52 Skip(4 - (index & 3), true); 53 Skip(static_cast<u32>(4 - (index & 3)), true);
53 } 54 }
54 } 55 }
55 56
56 unsigned GetCurrentOffset() const { 57 u32 GetCurrentOffset() const {
57 return static_cast<unsigned>(index); 58 return static_cast<u32>(index);
58 } 59 }
59 60
60 void SetCurrentOffset(unsigned offset) { 61 void SetCurrentOffset(u32 offset) {
61 index = static_cast<ptrdiff_t>(offset); 62 index = static_cast<ptrdiff_t>(offset);
62 } 63 }
63}; 64};
@@ -89,7 +90,7 @@ public:
89 90
90 // The entire size of the raw data section in u32 units, including the 16 bytes of mandatory 91 // The entire size of the raw data section in u32 units, including the 16 bytes of mandatory
91 // padding. 92 // padding.
92 u32 raw_data_size = sizeof(IPC::DataPayloadHeader) / 4 + 4 + normal_params_size; 93 u64 raw_data_size = sizeof(IPC::DataPayloadHeader) / 4 + 4 + normal_params_size;
93 94
94 u32 num_handles_to_move{}; 95 u32 num_handles_to_move{};
95 u32 num_domain_objects{}; 96 u32 num_domain_objects{};
@@ -105,7 +106,7 @@ public:
105 raw_data_size += sizeof(DomainMessageHeader) / 4 + num_domain_objects; 106 raw_data_size += sizeof(DomainMessageHeader) / 4 + num_domain_objects;
106 } 107 }
107 108
108 header.data_size.Assign(raw_data_size); 109 header.data_size.Assign(static_cast<u32>(raw_data_size));
109 if (num_handles_to_copy || num_handles_to_move) { 110 if (num_handles_to_copy || num_handles_to_move) {
110 header.enable_handle_descriptor.Assign(1); 111 header.enable_handle_descriptor.Assign(1);
111 } 112 }
diff --git a/src/core/hle/kernel/handle_table.cpp b/src/core/hle/kernel/handle_table.cpp
index fb30b6f8b..3e745c18b 100644
--- a/src/core/hle/kernel/handle_table.cpp
+++ b/src/core/hle/kernel/handle_table.cpp
@@ -118,7 +118,7 @@ std::shared_ptr<Object> HandleTable::GetGeneric(Handle handle) const {
118 118
119void HandleTable::Clear() { 119void HandleTable::Clear() {
120 for (u16 i = 0; i < table_size; ++i) { 120 for (u16 i = 0; i < table_size; ++i) {
121 generations[i] = i + 1; 121 generations[i] = static_cast<u16>(i + 1);
122 objects[i] = nullptr; 122 objects[i] = nullptr;
123 } 123 }
124 next_free_slot = 0; 124 next_free_slot = 0;
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp
index 5cbd3b912..6b7db5372 100644
--- a/src/core/hle/kernel/scheduler.cpp
+++ b/src/core/hle/kernel/scheduler.cpp
@@ -72,7 +72,7 @@ u32 GlobalScheduler::SelectThreads() {
72 if (top_thread != nullptr) { 72 if (top_thread != nullptr) {
73 // TODO(Blinkhawk): Implement Thread Pinning 73 // TODO(Blinkhawk): Implement Thread Pinning
74 } else { 74 } else {
75 idle_cores |= (1ul << core); 75 idle_cores |= (1U << core);
76 } 76 }
77 top_threads[core] = top_thread; 77 top_threads[core] = top_thread;
78 } 78 }
@@ -126,7 +126,7 @@ u32 GlobalScheduler::SelectThreads() {
126 top_threads[core_id] = suggested; 126 top_threads[core_id] = suggested;
127 } 127 }
128 128
129 idle_cores &= ~(1ul << core_id); 129 idle_cores &= ~(1U << core_id);
130 } 130 }
131 u32 cores_needing_context_switch{}; 131 u32 cores_needing_context_switch{};
132 for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) { 132 for (u32 core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) {
@@ -134,7 +134,7 @@ u32 GlobalScheduler::SelectThreads() {
134 ASSERT(top_threads[core] == nullptr || 134 ASSERT(top_threads[core] == nullptr ||
135 static_cast<u32>(top_threads[core]->GetProcessorID()) == core); 135 static_cast<u32>(top_threads[core]->GetProcessorID()) == core);
136 if (update_thread(top_threads[core], sched)) { 136 if (update_thread(top_threads[core], sched)) {
137 cores_needing_context_switch |= (1ul << core); 137 cores_needing_context_switch |= (1U << core);
138 } 138 }
139 } 139 }
140 return cores_needing_context_switch; 140 return cores_needing_context_switch;
@@ -364,7 +364,7 @@ void GlobalScheduler::EnableInterruptAndSchedule(u32 cores_pending_reschedule,
364 } else { 364 } else {
365 must_context_switch = true; 365 must_context_switch = true;
366 } 366 }
367 cores_pending_reschedule &= ~(1ul << core); 367 cores_pending_reschedule &= ~(1U << core);
368 } 368 }
369 if (must_context_switch) { 369 if (must_context_switch) {
370 auto& core_scheduler = kernel.CurrentScheduler(); 370 auto& core_scheduler = kernel.CurrentScheduler();
@@ -767,7 +767,7 @@ void Scheduler::SwitchToCurrent() {
767 current_thread->context_guard.unlock(); 767 current_thread->context_guard.unlock();
768 break; 768 break;
769 } 769 }
770 if (current_thread->GetProcessorID() != core_id) { 770 if (static_cast<u32>(current_thread->GetProcessorID()) != core_id) {
771 current_thread->context_guard.unlock(); 771 current_thread->context_guard.unlock();
772 break; 772 break;
773 } 773 }
diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp
index ca021a99f..589e288df 100644
--- a/src/core/hle/service/bcat/backend/boxcat.cpp
+++ b/src/core/hle/service/bcat/backend/boxcat.cpp
@@ -196,7 +196,9 @@ private:
196 const std::string& content_type_name) { 196 const std::string& content_type_name) {
197 if (client == nullptr) { 197 if (client == nullptr) {
198 client = std::make_unique<httplib::SSLClient>(BOXCAT_HOSTNAME, PORT); 198 client = std::make_unique<httplib::SSLClient>(BOXCAT_HOSTNAME, PORT);
199 client->set_timeout_sec(timeout_seconds); 199 client->set_connection_timeout(timeout_seconds);
200 client->set_read_timeout(timeout_seconds);
201 client->set_write_timeout(timeout_seconds);
200 } 202 }
201 203
202 httplib::Headers headers{ 204 httplib::Headers headers{
@@ -255,7 +257,7 @@ private:
255 return out; 257 return out;
256 } 258 }
257 259
258 std::unique_ptr<httplib::Client> client; 260 std::unique_ptr<httplib::SSLClient> client;
259 std::string path; 261 std::string path;
260 u64 title_id; 262 u64 title_id;
261 u64 build_id; 263 u64 build_id;
@@ -443,7 +445,9 @@ std::optional<std::vector<u8>> Boxcat::GetLaunchParameter(TitleIDVersion title)
443Boxcat::StatusResult Boxcat::GetStatus(std::optional<std::string>& global, 445Boxcat::StatusResult Boxcat::GetStatus(std::optional<std::string>& global,
444 std::map<std::string, EventStatus>& games) { 446 std::map<std::string, EventStatus>& games) {
445 httplib::SSLClient client{BOXCAT_HOSTNAME, static_cast<int>(PORT)}; 447 httplib::SSLClient client{BOXCAT_HOSTNAME, static_cast<int>(PORT)};
446 client.set_timeout_sec(static_cast<int>(TIMEOUT_SECONDS)); 448 client.set_connection_timeout(static_cast<int>(TIMEOUT_SECONDS));
449 client.set_read_timeout(static_cast<int>(TIMEOUT_SECONDS));
450 client.set_write_timeout(static_cast<int>(TIMEOUT_SECONDS));
447 451
448 httplib::Headers headers{ 452 httplib::Headers headers{
449 {std::string("Game-Assets-API-Version"), std::string(BOXCAT_API_VERSION)}, 453 {std::string("Game-Assets-API-Version"), std::string(BOXCAT_API_VERSION)},
diff --git a/src/core/hle/service/hid/controllers/keyboard.cpp b/src/core/hle/service/hid/controllers/keyboard.cpp
index 0b896d5ad..59b694cd4 100644
--- a/src/core/hle/service/hid/controllers/keyboard.cpp
+++ b/src/core/hle/service/hid/controllers/keyboard.cpp
@@ -42,8 +42,8 @@ void Controller_Keyboard::OnUpdate(const Core::Timing::CoreTiming& core_timing,
42 cur_entry.modifier = 0; 42 cur_entry.modifier = 0;
43 if (Settings::values.keyboard_enabled) { 43 if (Settings::values.keyboard_enabled) {
44 for (std::size_t i = 0; i < keyboard_keys.size(); ++i) { 44 for (std::size_t i = 0; i < keyboard_keys.size(); ++i) {
45 cur_entry.key[i / KEYS_PER_BYTE] |= 45 auto& entry = cur_entry.key[i / KEYS_PER_BYTE];
46 (keyboard_keys[i]->GetStatus() << (i % KEYS_PER_BYTE)); 46 entry = static_cast<u8>(entry | (keyboard_keys[i]->GetStatus() << (i % KEYS_PER_BYTE)));
47 } 47 }
48 48
49 for (std::size_t i = 0; i < keyboard_mods.size(); ++i) { 49 for (std::size_t i = 0; i < keyboard_mods.size(); ++i) {
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 2de4ed348..e311bc18c 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -269,7 +269,6 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) {
269 auto& rstick_entry = npad_pad_states[controller_idx].r_stick; 269 auto& rstick_entry = npad_pad_states[controller_idx].r_stick;
270 const auto& button_state = buttons[controller_idx]; 270 const auto& button_state = buttons[controller_idx];
271 const auto& analog_state = sticks[controller_idx]; 271 const auto& analog_state = sticks[controller_idx];
272 const auto& motion_state = motions[controller_idx];
273 const auto [stick_l_x_f, stick_l_y_f] = 272 const auto [stick_l_x_f, stick_l_y_f] =
274 analog_state[static_cast<std::size_t>(JoystickId::Joystick_Left)]->GetStatus(); 273 analog_state[static_cast<std::size_t>(JoystickId::Joystick_Left)]->GetStatus();
275 const auto [stick_r_x_f, stick_r_y_f] = 274 const auto [stick_r_x_f, stick_r_y_f] =
@@ -391,18 +390,6 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
391 390
392 libnx_entry.connection_status.raw = 0; 391 libnx_entry.connection_status.raw = 0;
393 libnx_entry.connection_status.IsConnected.Assign(1); 392 libnx_entry.connection_status.IsConnected.Assign(1);
394 auto& full_sixaxis_entry =
395 npad.sixaxis_full.sixaxis[npad.sixaxis_full.common.last_entry_index];
396 auto& handheld_sixaxis_entry =
397 npad.sixaxis_handheld.sixaxis[npad.sixaxis_handheld.common.last_entry_index];
398 auto& dual_left_sixaxis_entry =
399 npad.sixaxis_dual_left.sixaxis[npad.sixaxis_dual_left.common.last_entry_index];
400 auto& dual_right_sixaxis_entry =
401 npad.sixaxis_dual_right.sixaxis[npad.sixaxis_dual_right.common.last_entry_index];
402 auto& left_sixaxis_entry =
403 npad.sixaxis_left.sixaxis[npad.sixaxis_left.common.last_entry_index];
404 auto& right_sixaxis_entry =
405 npad.sixaxis_right.sixaxis[npad.sixaxis_right.common.last_entry_index];
406 393
407 switch (controller_type) { 394 switch (controller_type) {
408 case NPadControllerType::None: 395 case NPadControllerType::None:
@@ -541,18 +528,6 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
541 } 528 }
542 } 529 }
543 530
544 auto& main_controller =
545 npad.main_controller_states.npad[npad.main_controller_states.common.last_entry_index];
546 auto& handheld_entry =
547 npad.handheld_states.npad[npad.handheld_states.common.last_entry_index];
548 auto& dual_entry = npad.dual_states.npad[npad.dual_states.common.last_entry_index];
549 auto& left_entry = npad.left_joy_states.npad[npad.left_joy_states.common.last_entry_index];
550 auto& right_entry =
551 npad.right_joy_states.npad[npad.right_joy_states.common.last_entry_index];
552 auto& pokeball_entry =
553 npad.pokeball_states.npad[npad.pokeball_states.common.last_entry_index];
554 auto& libnx_entry = npad.libnx.npad[npad.libnx.common.last_entry_index];
555
556 auto& full_sixaxis_entry = 531 auto& full_sixaxis_entry =
557 npad.sixaxis_full.sixaxis[npad.sixaxis_full.common.last_entry_index]; 532 npad.sixaxis_full.sixaxis[npad.sixaxis_full.common.last_entry_index];
558 auto& handheld_sixaxis_entry = 533 auto& handheld_sixaxis_entry =
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 71dbaba7f..8918946a1 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -475,7 +475,7 @@ void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) {
475 475
476void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) { 476void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) {
477 IPC::RequestParser rp{ctx}; 477 IPC::RequestParser rp{ctx};
478 const auto enable{rp.Pop<bool>()}; 478 [[maybe_unused]] const auto enable{rp.Pop<bool>()};
479 const auto handle{rp.Pop<u32>()}; 479 const auto handle{rp.Pop<u32>()};
480 const auto applet_resource_user_id{rp.Pop<u64>()}; 480 const auto applet_resource_user_id{rp.Pop<u64>()};
481 481
diff --git a/src/core/hle/service/mii/manager.cpp b/src/core/hle/service/mii/manager.cpp
index 4730070cb..8e433eb41 100644
--- a/src/core/hle/service/mii/manager.cpp
+++ b/src/core/hle/service/mii/manager.cpp
@@ -428,7 +428,7 @@ bool MiiManager::IsFullDatabase() const {
428} 428}
429 429
430u32 MiiManager::GetCount(SourceFlag source_flag) const { 430u32 MiiManager::GetCount(SourceFlag source_flag) const {
431 u32 count{}; 431 std::size_t count{};
432 if ((source_flag & SourceFlag::Database) != SourceFlag::None) { 432 if ((source_flag & SourceFlag::Database) != SourceFlag::None) {
433 // TODO(bunnei): We don't implement the Mii database, but when we do, update this 433 // TODO(bunnei): We don't implement the Mii database, but when we do, update this
434 count += 0; 434 count += 0;
@@ -436,7 +436,7 @@ u32 MiiManager::GetCount(SourceFlag source_flag) const {
436 if ((source_flag & SourceFlag::Default) != SourceFlag::None) { 436 if ((source_flag & SourceFlag::Default) != SourceFlag::None) {
437 count += DefaultMiiCount; 437 count += DefaultMiiCount;
438 } 438 }
439 return count; 439 return static_cast<u32>(count);
440} 440}
441 441
442ResultVal<MiiInfo> MiiManager::UpdateLatest([[maybe_unused]] const MiiInfo& info, 442ResultVal<MiiInfo> MiiManager::UpdateLatest([[maybe_unused]] const MiiInfo& info,
diff --git a/src/core/hle/service/sockets/sockets_translate.cpp b/src/core/hle/service/sockets/sockets_translate.cpp
index 139743e1d..2e626fd86 100644
--- a/src/core/hle/service/sockets/sockets_translate.cpp
+++ b/src/core/hle/service/sockets/sockets_translate.cpp
@@ -89,9 +89,9 @@ Network::Protocol Translate(Type type, Protocol protocol) {
89 } 89 }
90} 90}
91 91
92u16 TranslatePollEventsToHost(u16 flags) { 92u16 TranslatePollEventsToHost(u32 flags) {
93 u16 result = 0; 93 u32 result = 0;
94 const auto translate = [&result, &flags](u16 from, u16 to) { 94 const auto translate = [&result, &flags](u32 from, u32 to) {
95 if ((flags & from) != 0) { 95 if ((flags & from) != 0) {
96 flags &= ~from; 96 flags &= ~from;
97 result |= to; 97 result |= to;
@@ -105,12 +105,12 @@ u16 TranslatePollEventsToHost(u16 flags) {
105 translate(POLL_NVAL, Network::POLL_NVAL); 105 translate(POLL_NVAL, Network::POLL_NVAL);
106 106
107 UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags); 107 UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags);
108 return result; 108 return static_cast<u16>(result);
109} 109}
110 110
111u16 TranslatePollEventsToGuest(u16 flags) { 111u16 TranslatePollEventsToGuest(u32 flags) {
112 u16 result = 0; 112 u32 result = 0;
113 const auto translate = [&result, &flags](u16 from, u16 to) { 113 const auto translate = [&result, &flags](u32 from, u32 to) {
114 if ((flags & from) != 0) { 114 if ((flags & from) != 0) {
115 flags &= ~from; 115 flags &= ~from;
116 result |= to; 116 result |= to;
@@ -125,7 +125,7 @@ u16 TranslatePollEventsToGuest(u16 flags) {
125 translate(Network::POLL_NVAL, POLL_NVAL); 125 translate(Network::POLL_NVAL, POLL_NVAL);
126 126
127 UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags); 127 UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags);
128 return result; 128 return static_cast<u16>(result);
129} 129}
130 130
131Network::SockAddrIn Translate(SockAddrIn value) { 131Network::SockAddrIn Translate(SockAddrIn value) {
diff --git a/src/core/hle/service/sockets/sockets_translate.h b/src/core/hle/service/sockets/sockets_translate.h
index 8ed041e31..e498913d4 100644
--- a/src/core/hle/service/sockets/sockets_translate.h
+++ b/src/core/hle/service/sockets/sockets_translate.h
@@ -31,10 +31,10 @@ Network::Type Translate(Type type);
31Network::Protocol Translate(Type type, Protocol protocol); 31Network::Protocol Translate(Type type, Protocol protocol);
32 32
33/// Translate abstract poll event flags to guest poll event flags 33/// Translate abstract poll event flags to guest poll event flags
34u16 TranslatePollEventsToHost(u16 flags); 34u16 TranslatePollEventsToHost(u32 flags);
35 35
36/// Translate guest poll event flags to abstract poll event flags 36/// Translate guest poll event flags to abstract poll event flags
37u16 TranslatePollEventsToGuest(u16 flags); 37u16 TranslatePollEventsToGuest(u32 flags);
38 38
39/// Translate guest socket address structure to abstract socket address structure 39/// Translate guest socket address structure to abstract socket address structure
40Network::SockAddrIn Translate(SockAddrIn value); 40Network::SockAddrIn Translate(SockAddrIn value);
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp
index 69152d0ac..bdf0439f2 100644
--- a/src/core/hle/service/time/time_zone_manager.cpp
+++ b/src/core/hle/service/time/time_zone_manager.cpp
@@ -820,7 +820,10 @@ static ResultCode ToCalendarTimeImpl(const TimeZoneRule& rules, s64 time, Calend
820 const ResultCode result{ 820 const ResultCode result{
821 ToCalendarTimeInternal(rules, time, calendar_time, calendar.additiona_info)}; 821 ToCalendarTimeInternal(rules, time, calendar_time, calendar.additiona_info)};
822 calendar.time.year = static_cast<s16>(calendar_time.year); 822 calendar.time.year = static_cast<s16>(calendar_time.year);
823 calendar.time.month = calendar_time.month + 1; // Internal impl. uses 0-indexed month 823
824 // Internal impl. uses 0-indexed month
825 calendar.time.month = static_cast<s8>(calendar_time.month + 1);
826
824 calendar.time.day = calendar_time.day; 827 calendar.time.day = calendar_time.day;
825 calendar.time.hour = calendar_time.hour; 828 calendar.time.hour = calendar_time.hour;
826 calendar.time.minute = calendar_time.minute; 829 calendar.time.minute = calendar_time.minute;
@@ -872,13 +875,15 @@ ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules,
872 const CalendarTime& calendar_time, s64& posix_time) const { 875 const CalendarTime& calendar_time, s64& posix_time) const {
873 posix_time = 0; 876 posix_time = 0;
874 877
875 CalendarTimeInternal internal_time{}; 878 CalendarTimeInternal internal_time{
876 internal_time.year = calendar_time.year; 879 .year = calendar_time.year,
877 internal_time.month = calendar_time.month - 1; // Internal impl. uses 0-indexed month 880 // Internal impl. uses 0-indexed month
878 internal_time.day = calendar_time.day; 881 .month = static_cast<s8>(calendar_time.month - 1),
879 internal_time.hour = calendar_time.hour; 882 .day = calendar_time.day,
880 internal_time.minute = calendar_time.minute; 883 .hour = calendar_time.hour,
881 internal_time.second = calendar_time.second; 884 .minute = calendar_time.minute,
885 .second = calendar_time.second,
886 };
882 887
883 s32 hour{internal_time.hour}; 888 s32 hour{internal_time.hour};
884 s32 minute{internal_time.minute}; 889 s32 minute{internal_time.minute};
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 480d34725..d380c60fb 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -159,7 +159,7 @@ public:
159 header.data_size = static_cast<u32_le>(write_index - sizeof(Header)); 159 header.data_size = static_cast<u32_le>(write_index - sizeof(Header));
160 header.data_offset = sizeof(Header); 160 header.data_offset = sizeof(Header);
161 header.objects_size = 4; 161 header.objects_size = 4;
162 header.objects_offset = sizeof(Header) + header.data_size; 162 header.objects_offset = static_cast<u32>(sizeof(Header) + header.data_size);
163 std::memcpy(buffer.data(), &header, sizeof(Header)); 163 std::memcpy(buffer.data(), &header, sizeof(Header));
164 164
165 return buffer; 165 return buffer;