summaryrefslogtreecommitdiff
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorGravatar Sebastian Valle2017-09-30 08:22:14 -0500
committerGravatar GitHub2017-09-30 08:22:14 -0500
commita3de996ae7c41bb8d475b47dcd08abdd571cfc73 (patch)
tree016f6866d15fb9a41a15666f492bed352d95b523 /src/core/hle/service
parentMerge pull request #2961 from Subv/load_titles (diff)
parentFixed type conversion ambiguity (diff)
downloadyuzu-a3de996ae7c41bb8d475b47dcd08abdd571cfc73.tar.gz
yuzu-a3de996ae7c41bb8d475b47dcd08abdd571cfc73.tar.xz
yuzu-a3de996ae7c41bb8d475b47dcd08abdd571cfc73.zip
Merge pull request #2962 from huwpascoe/static_cast
Fixed type conversion ambiguity
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/apt/apt.cpp4
-rw-r--r--src/core/hle/service/cam/cam.cpp2
-rw-r--r--src/core/hle/service/cfg/cfg.cpp2
-rw-r--r--src/core/hle/service/fs/archive.cpp2
-rw-r--r--src/core/hle/service/hid/hid.cpp2
-rw-r--r--src/core/hle/service/ldr_ro/cro_helper.h6
-rw-r--r--src/core/hle/service/nwm/nwm_uds.cpp10
-rw-r--r--src/core/hle/service/nwm/uds_beacon.cpp4
-rw-r--r--src/core/hle/service/nwm/uds_data.cpp8
9 files changed, 21 insertions, 19 deletions
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp
index 8c0ba73f2..4c6156345 100644
--- a/src/core/hle/service/apt/apt.cpp
+++ b/src/core/hle/service/apt/apt.cpp
@@ -561,7 +561,7 @@ void ReceiveParameter(Service::Interface* self) {
561 ? Kernel::g_handle_table.Create(next_parameter->object).Unwrap() 561 ? Kernel::g_handle_table.Create(next_parameter->object).Unwrap()
562 : 0); 562 : 0);
563 563
564 rb.PushStaticBuffer(buffer, static_cast<u32>(next_parameter->buffer.size()), 0); 564 rb.PushStaticBuffer(buffer, next_parameter->buffer.size(), 0);
565 565
566 Memory::WriteBlock(buffer, next_parameter->buffer.data(), next_parameter->buffer.size()); 566 Memory::WriteBlock(buffer, next_parameter->buffer.data(), next_parameter->buffer.size());
567 567
@@ -609,7 +609,7 @@ void GlanceParameter(Service::Interface* self) {
609 ? Kernel::g_handle_table.Create(next_parameter->object).Unwrap() 609 ? Kernel::g_handle_table.Create(next_parameter->object).Unwrap()
610 : 0); 610 : 0);
611 611
612 rb.PushStaticBuffer(buffer, static_cast<u32>(next_parameter->buffer.size()), 0); 612 rb.PushStaticBuffer(buffer, next_parameter->buffer.size(), 0);
613 613
614 Memory::WriteBlock(buffer, next_parameter->buffer.data(), next_parameter->buffer.size()); 614 Memory::WriteBlock(buffer, next_parameter->buffer.data(), next_parameter->buffer.size());
615 615
diff --git a/src/core/hle/service/cam/cam.cpp b/src/core/hle/service/cam/cam.cpp
index c9f9e9d95..8172edae8 100644
--- a/src/core/hle/service/cam/cam.cpp
+++ b/src/core/hle/service/cam/cam.cpp
@@ -177,7 +177,7 @@ void CompletionEventCallBack(u64 port_id, int) {
177 LOG_ERROR(Service_CAM, "The destination size (%u) doesn't match the source (%zu)!", 177 LOG_ERROR(Service_CAM, "The destination size (%u) doesn't match the source (%zu)!",
178 port.dest_size, buffer_size); 178 port.dest_size, buffer_size);
179 } 179 }
180 Memory::WriteBlock(port.dest, buffer.data(), std::min<u32>(port.dest_size, buffer_size)); 180 Memory::WriteBlock(port.dest, buffer.data(), std::min<size_t>(port.dest_size, buffer_size));
181 } 181 }
182 182
183 port.is_receiving = false; 183 port.is_receiving = false;
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp
index f26a1f65f..f78c25fb2 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -141,7 +141,7 @@ void GetCountryCodeString(Service::Interface* self) {
141 141
142void GetCountryCodeID(Service::Interface* self) { 142void GetCountryCodeID(Service::Interface* self) {
143 u32* cmd_buff = Kernel::GetCommandBuffer(); 143 u32* cmd_buff = Kernel::GetCommandBuffer();
144 u16 country_code = cmd_buff[1]; 144 u16 country_code = static_cast<u16>(cmd_buff[1]);
145 u16 country_code_id = 0; 145 u16 country_code_id = 0;
146 146
147 // The following algorithm will fail if the first country code isn't 0. 147 // The following algorithm will fail if the first country code isn't 0.
diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp
index 4ccb3cd32..4ee7df73c 100644
--- a/src/core/hle/service/fs/archive.cpp
+++ b/src/core/hle/service/fs/archive.cpp
@@ -217,7 +217,7 @@ void Directory::HandleSyncRequest(Kernel::SharedPtr<Kernel::ServerSession> serve
217 LOG_TRACE(Service_FS, "Read %s: count=%d", GetName().c_str(), count); 217 LOG_TRACE(Service_FS, "Read %s: count=%d", GetName().c_str(), count);
218 218
219 // Number of entries actually read 219 // Number of entries actually read
220 u32 read = backend->Read(entries.size(), entries.data()); 220 u32 read = backend->Read(static_cast<u32>(entries.size()), entries.data());
221 cmd_buff[2] = read; 221 cmd_buff[2] = read;
222 Memory::WriteBlock(address, entries.data(), read * sizeof(FileSys::Entry)); 222 Memory::WriteBlock(address, entries.data(), read * sizeof(FileSys::Entry));
223 break; 223 break;
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index aa5d821f9..379fbd71c 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -251,7 +251,7 @@ static void UpdateGyroscopeCallback(u64 userdata, int cycles_late) {
251 Math::Vec3<float> gyro; 251 Math::Vec3<float> gyro;
252 std::tie(std::ignore, gyro) = motion_device->GetStatus(); 252 std::tie(std::ignore, gyro) = motion_device->GetStatus();
253 double stretch = Core::System::GetInstance().perf_stats.GetLastFrameTimeScale(); 253 double stretch = Core::System::GetInstance().perf_stats.GetLastFrameTimeScale();
254 gyro *= gyroscope_coef * stretch; 254 gyro *= gyroscope_coef * static_cast<float>(stretch);
255 gyroscope_entry.x = static_cast<s16>(gyro.x); 255 gyroscope_entry.x = static_cast<s16>(gyro.x);
256 gyroscope_entry.y = static_cast<s16>(gyro.y); 256 gyroscope_entry.y = static_cast<s16>(gyro.y);
257 gyroscope_entry.z = static_cast<s16>(gyro.z); 257 gyroscope_entry.z = static_cast<s16>(gyro.z);
diff --git a/src/core/hle/service/ldr_ro/cro_helper.h b/src/core/hle/service/ldr_ro/cro_helper.h
index 3bc10dbdc..57b4fb6df 100644
--- a/src/core/hle/service/ldr_ro/cro_helper.h
+++ b/src/core/hle/service/ldr_ro/cro_helper.h
@@ -413,7 +413,8 @@ private:
413 */ 413 */
414 template <typename T> 414 template <typename T>
415 void GetEntry(std::size_t index, T& data) const { 415 void GetEntry(std::size_t index, T& data) const {
416 Memory::ReadBlock(GetField(T::TABLE_OFFSET_FIELD) + index * sizeof(T), &data, sizeof(T)); 416 Memory::ReadBlock(GetField(T::TABLE_OFFSET_FIELD) + static_cast<u32>(index * sizeof(T)),
417 &data, sizeof(T));
417 } 418 }
418 419
419 /** 420 /**
@@ -425,7 +426,8 @@ private:
425 */ 426 */
426 template <typename T> 427 template <typename T>
427 void SetEntry(std::size_t index, const T& data) { 428 void SetEntry(std::size_t index, const T& data) {
428 Memory::WriteBlock(GetField(T::TABLE_OFFSET_FIELD) + index * sizeof(T), &data, sizeof(T)); 429 Memory::WriteBlock(GetField(T::TABLE_OFFSET_FIELD) + static_cast<u32>(index * sizeof(T)),
430 &data, sizeof(T));
429 } 431 }
430 432
431 /** 433 /**
diff --git a/src/core/hle/service/nwm/nwm_uds.cpp b/src/core/hle/service/nwm/nwm_uds.cpp
index 4e2af9ae6..8ef0cda09 100644
--- a/src/core/hle/service/nwm/nwm_uds.cpp
+++ b/src/core/hle/service/nwm/nwm_uds.cpp
@@ -316,7 +316,7 @@ static void RecvBeaconBroadcastData(Interface* self) {
316 auto beacons = GetReceivedBeacons(mac_address); 316 auto beacons = GetReceivedBeacons(mac_address);
317 317
318 BeaconDataReplyHeader data_reply_header{}; 318 BeaconDataReplyHeader data_reply_header{};
319 data_reply_header.total_entries = beacons.size(); 319 data_reply_header.total_entries = static_cast<u32>(beacons.size());
320 data_reply_header.max_output_size = out_buffer_size; 320 data_reply_header.max_output_size = out_buffer_size;
321 321
322 Memory::WriteBlock(current_buffer_pos, &data_reply_header, sizeof(BeaconDataReplyHeader)); 322 Memory::WriteBlock(current_buffer_pos, &data_reply_header, sizeof(BeaconDataReplyHeader));
@@ -326,8 +326,8 @@ static void RecvBeaconBroadcastData(Interface* self) {
326 for (const auto& beacon : beacons) { 326 for (const auto& beacon : beacons) {
327 BeaconEntryHeader entry{}; 327 BeaconEntryHeader entry{};
328 // TODO(Subv): Figure out what this size is used for. 328 // TODO(Subv): Figure out what this size is used for.
329 entry.unk_size = sizeof(BeaconEntryHeader) + beacon.data.size(); 329 entry.unk_size = static_cast<u32>(sizeof(BeaconEntryHeader) + beacon.data.size());
330 entry.total_size = sizeof(BeaconEntryHeader) + beacon.data.size(); 330 entry.total_size = static_cast<u32>(sizeof(BeaconEntryHeader) + beacon.data.size());
331 entry.wifi_channel = beacon.channel; 331 entry.wifi_channel = beacon.channel;
332 entry.header_size = sizeof(BeaconEntryHeader); 332 entry.header_size = sizeof(BeaconEntryHeader);
333 entry.mac_address = beacon.transmitter_address; 333 entry.mac_address = beacon.transmitter_address;
@@ -338,9 +338,9 @@ static void RecvBeaconBroadcastData(Interface* self) {
338 current_buffer_pos += sizeof(BeaconEntryHeader); 338 current_buffer_pos += sizeof(BeaconEntryHeader);
339 339
340 Memory::WriteBlock(current_buffer_pos, beacon.data.data(), beacon.data.size()); 340 Memory::WriteBlock(current_buffer_pos, beacon.data.data(), beacon.data.size());
341 current_buffer_pos += beacon.data.size(); 341 current_buffer_pos += static_cast<VAddr>(beacon.data.size());
342 342
343 total_size += sizeof(BeaconEntryHeader) + beacon.data.size(); 343 total_size += static_cast<u32>(sizeof(BeaconEntryHeader) + beacon.data.size());
344 } 344 }
345 345
346 // Update the total size in the structure and write it to the buffer again. 346 // Update the total size in the structure and write it to the buffer again.
diff --git a/src/core/hle/service/nwm/uds_beacon.cpp b/src/core/hle/service/nwm/uds_beacon.cpp
index 552eaf65e..73a80d940 100644
--- a/src/core/hle/service/nwm/uds_beacon.cpp
+++ b/src/core/hle/service/nwm/uds_beacon.cpp
@@ -243,7 +243,7 @@ std::vector<u8> GenerateNintendoFirstEncryptedDataTag(const NetworkInfo& network
243 243
244 EncryptedDataTag tag{}; 244 EncryptedDataTag tag{};
245 tag.header.tag_id = static_cast<u8>(TagId::VendorSpecific); 245 tag.header.tag_id = static_cast<u8>(TagId::VendorSpecific);
246 tag.header.length = sizeof(tag) - sizeof(TagHeader) + payload_size; 246 tag.header.length = static_cast<u8>(sizeof(tag) - sizeof(TagHeader) + payload_size);
247 tag.oui_type = static_cast<u8>(NintendoTagId::EncryptedData0); 247 tag.oui_type = static_cast<u8>(NintendoTagId::EncryptedData0);
248 tag.oui = NintendoOUI; 248 tag.oui = NintendoOUI;
249 249
@@ -279,7 +279,7 @@ std::vector<u8> GenerateNintendoSecondEncryptedDataTag(const NetworkInfo& networ
279 279
280 EncryptedDataTag tag{}; 280 EncryptedDataTag tag{};
281 tag.header.tag_id = static_cast<u8>(TagId::VendorSpecific); 281 tag.header.tag_id = static_cast<u8>(TagId::VendorSpecific);
282 tag.header.length = tag_length; 282 tag.header.length = static_cast<u8>(tag_length);
283 tag.oui_type = static_cast<u8>(NintendoTagId::EncryptedData1); 283 tag.oui_type = static_cast<u8>(NintendoTagId::EncryptedData1);
284 tag.oui = NintendoOUI; 284 tag.oui = NintendoOUI;
285 285
diff --git a/src/core/hle/service/nwm/uds_data.cpp b/src/core/hle/service/nwm/uds_data.cpp
index 0fd9b8b8c..3ef2a84b6 100644
--- a/src/core/hle/service/nwm/uds_data.cpp
+++ b/src/core/hle/service/nwm/uds_data.cpp
@@ -197,7 +197,7 @@ static std::vector<u8> DecryptDataFrame(const std::vector<u8>& encrypted_payload
197 df.ChannelMessageEnd(CryptoPP::DEFAULT_CHANNEL); 197 df.ChannelMessageEnd(CryptoPP::DEFAULT_CHANNEL);
198 df.SetRetrievalChannel(CryptoPP::DEFAULT_CHANNEL); 198 df.SetRetrievalChannel(CryptoPP::DEFAULT_CHANNEL);
199 199
200 int size = df.MaxRetrievable(); 200 size_t size = df.MaxRetrievable();
201 201
202 std::vector<u8> pdata(size); 202 std::vector<u8> pdata(size);
203 df.Get(pdata.data(), size); 203 df.Get(pdata.data(), size);
@@ -251,7 +251,7 @@ static std::vector<u8> EncryptDataFrame(const std::vector<u8>& payload,
251 251
252 df.SetRetrievalChannel(CryptoPP::DEFAULT_CHANNEL); 252 df.SetRetrievalChannel(CryptoPP::DEFAULT_CHANNEL);
253 253
254 int size = df.MaxRetrievable(); 254 size_t size = df.MaxRetrievable();
255 255
256 std::vector<u8> cipher(size); 256 std::vector<u8> cipher(size);
257 df.Get(cipher.data(), size); 257 df.Get(cipher.data(), size);
@@ -266,8 +266,8 @@ static std::vector<u8> EncryptDataFrame(const std::vector<u8>& payload,
266std::vector<u8> GenerateDataPayload(const std::vector<u8>& data, u8 channel, u16 dest_node, 266std::vector<u8> GenerateDataPayload(const std::vector<u8>& data, u8 channel, u16 dest_node,
267 u16 src_node, u16 sequence_number) { 267 u16 src_node, u16 sequence_number) {
268 std::vector<u8> buffer = GenerateLLCHeader(EtherType::SecureData); 268 std::vector<u8> buffer = GenerateLLCHeader(EtherType::SecureData);
269 std::vector<u8> securedata_header = 269 std::vector<u8> securedata_header = GenerateSecureDataHeader(
270 GenerateSecureDataHeader(data.size(), channel, dest_node, src_node, sequence_number); 270 static_cast<u16>(data.size()), channel, dest_node, src_node, sequence_number);
271 271
272 buffer.insert(buffer.end(), securedata_header.begin(), securedata_header.end()); 272 buffer.insert(buffer.end(), securedata_header.begin(), securedata_header.end());
273 buffer.insert(buffer.end(), data.begin(), data.end()); 273 buffer.insert(buffer.end(), data.begin(), data.end());