Fixing most remaining C++ warnings in clang.
This commit is contained in:
@@ -196,9 +196,10 @@ dword_result_t NtReadFile(dword_t file_handle, dword_t event_handle,
|
||||
if (true || file->is_synchronous()) {
|
||||
// Synchronous.
|
||||
size_t bytes_read = 0;
|
||||
result = file->Read(buffer, buffer_length,
|
||||
byte_offset_ptr ? *byte_offset_ptr : -1, &bytes_read,
|
||||
apc_context);
|
||||
result = file->Read(
|
||||
buffer, buffer_length,
|
||||
byte_offset_ptr ? static_cast<uint32_t>(*byte_offset_ptr) : -1u,
|
||||
&bytes_read, apc_context);
|
||||
if (io_status_block) {
|
||||
io_status_block->status = result;
|
||||
io_status_block->information = static_cast<uint32_t>(bytes_read);
|
||||
@@ -210,8 +211,8 @@ dword_result_t NtReadFile(dword_t file_handle, dword_t event_handle,
|
||||
if ((uint32_t)apc_routine_ptr & ~1) {
|
||||
if (apc_context) {
|
||||
auto thread = XThread::GetCurrentThread();
|
||||
thread->EnqueueApc((uint32_t)apc_routine_ptr & ~1, apc_context,
|
||||
io_status_block, 0);
|
||||
thread->EnqueueApc(static_cast<uint32_t>(apc_routine_ptr) & ~1u,
|
||||
apc_context, io_status_block, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,9 +287,10 @@ dword_result_t NtWriteFile(dword_t file_handle, dword_t event_handle,
|
||||
if (true || file->is_synchronous()) {
|
||||
// Synchronous request.
|
||||
size_t bytes_written = 0;
|
||||
result = file->Write(buffer, buffer_length,
|
||||
byte_offset_ptr ? *byte_offset_ptr : -1,
|
||||
&bytes_written, apc_context);
|
||||
result = file->Write(
|
||||
buffer, buffer_length,
|
||||
byte_offset_ptr ? static_cast<uint32_t>(*byte_offset_ptr) : -1u,
|
||||
&bytes_written, apc_context);
|
||||
if (XSUCCEEDED(result)) {
|
||||
info = (int32_t)bytes_written;
|
||||
}
|
||||
@@ -356,7 +358,7 @@ dword_result_t NtRemoveIoCompletion(
|
||||
status = X_STATUS_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
uint64_t timeout_ticks = timeout ? *timeout : 0;
|
||||
uint64_t timeout_ticks = timeout ? static_cast<uint32_t>(*timeout) : 0u;
|
||||
if (port->WaitForNotification(timeout_ticks)) {
|
||||
auto notification = port->DequeueNotification();
|
||||
if (key_context) {
|
||||
|
||||
@@ -323,7 +323,8 @@ SHIM_CALL XexGetProcedureAddress_shim(PPCContext* ppc_context,
|
||||
void AppendParam(StringBuffer* string_buffer,
|
||||
pointer_t<X_EX_TITLE_TERMINATE_REGISTRATION> reg) {
|
||||
string_buffer->AppendFormat("%.8X(%.8X, %.8X)", reg.guest_address(),
|
||||
reg->notification_routine, reg->priority);
|
||||
static_cast<uint32_t>(reg->notification_routine),
|
||||
static_cast<uint32_t>(reg->priority));
|
||||
}
|
||||
|
||||
void ExRegisterTitleTerminateNotification(
|
||||
|
||||
@@ -832,7 +832,7 @@ dword_result_t KeWaitForSingleObject(lpvoid_t object_ptr, dword_t wait_reason,
|
||||
return X_STATUS_ABANDONED_WAIT_0;
|
||||
}
|
||||
|
||||
uint64_t timeout = timeout_ptr ? *timeout_ptr : 0;
|
||||
uint64_t timeout = timeout_ptr ? static_cast<uint32_t>(*timeout_ptr) : 0u;
|
||||
X_STATUS result = object->Wait(wait_reason, processor_mode, alertable,
|
||||
timeout_ptr ? &timeout : nullptr);
|
||||
|
||||
@@ -850,7 +850,7 @@ dword_result_t NtWaitForSingleObjectEx(dword_t object_handle, dword_t wait_mode,
|
||||
auto object =
|
||||
kernel_state()->object_table()->LookupObject<XObject>(object_handle);
|
||||
if (object) {
|
||||
uint64_t timeout = timeout_ptr ? *timeout_ptr : 0;
|
||||
uint64_t timeout = timeout_ptr ? static_cast<uint32_t>(*timeout_ptr) : 0u;
|
||||
result =
|
||||
object->Wait(3, wait_mode, alertable, timeout_ptr ? &timeout : nullptr);
|
||||
} else {
|
||||
@@ -885,7 +885,7 @@ dword_result_t KeWaitForMultipleObjects(dword_t count, lpdword_t objects_ptr,
|
||||
objects.push_back(std::move(object_ref));
|
||||
}
|
||||
|
||||
uint64_t timeout = timeout_ptr ? *timeout_ptr : 0;
|
||||
uint64_t timeout = timeout_ptr ? static_cast<uint32_t>(*timeout_ptr) : 0u;
|
||||
result = XObject::WaitMultiple(uint32_t(objects.size()),
|
||||
reinterpret_cast<XObject**>(objects.data()),
|
||||
wait_type, wait_reason, processor_mode,
|
||||
@@ -937,7 +937,7 @@ dword_result_t NtSignalAndWaitForSingleObjectEx(dword_t signal_handle,
|
||||
auto wait_object =
|
||||
kernel_state()->object_table()->LookupObject<XObject>(wait_handle);
|
||||
if (signal_object && wait_object) {
|
||||
uint64_t timeout = timeout_ptr ? *timeout_ptr : 0;
|
||||
uint64_t timeout = timeout_ptr ? static_cast<uint32_t>(*timeout_ptr) : 0u;
|
||||
result =
|
||||
XObject::SignalAndWait(signal_object.get(), wait_object.get(), 3, 1,
|
||||
alertable, timeout_ptr ? &timeout : nullptr);
|
||||
|
||||
Reference in New Issue
Block a user