[Codacy] Fixed some issues found by codacy.

Added skipping shaders directory in scan
This commit is contained in:
Gliniak 2024-01-20 13:19:37 +01:00
parent 18b5a6706a
commit c8ca077ec4
8 changed files with 8 additions and 10 deletions

View File

@ -5,3 +5,4 @@ exclude_paths:
- 'docs/**'
- 'android/**'
- '**.md'
- 'src/xenia/gpu/shaders/**'

View File

@ -1613,8 +1613,8 @@ void EmulatorWindow::LoadRecentlyLaunchedTitles() {
try {
cpptoml::parser p(file);
parsed_file = p.parse();
} catch (cpptoml::parse_exception exception) {
// TODO(Gliniak): Better handling of errors, but good enough for now.
} catch (cpptoml::parse_exception& exception) {
XELOGE("Cannot parse file: recent.toml. Error: {}", exception.what());
return;
}

View File

@ -385,7 +385,6 @@ void XmaContext::Decode(XMA_CONTEXT_DATA* data) {
data->input_buffer_0_packet_count * kBytesPerPacket;
size_t input_buffer_1_size =
data->input_buffer_1_packet_count * kBytesPerPacket;
size_t input_total_size = input_buffer_0_size + input_buffer_1_size;
size_t current_input_size =
data->current_buffer ? input_buffer_1_size : input_buffer_0_size;
@ -420,7 +419,6 @@ void XmaContext::Decode(XMA_CONTEXT_DATA* data) {
assert_false(data->stop_when_done);
assert_false(data->interrupt_when_done);
static int total_samples = 0;
bool reuse_input_buffer = false;
// Decode until we can't write any more data.
while (output_remaining_bytes > 0) {
if (!data->input_buffer_0_valid && !data->input_buffer_1_valid) {
@ -429,7 +427,7 @@ void XmaContext::Decode(XMA_CONTEXT_DATA* data) {
}
// Setup the input buffer if we are at loop_end.
// The input buffer must not be swapped out until all loops are processed.
reuse_input_buffer = TrySetupNextLoop(data, false);
bool reuse_input_buffer = TrySetupNextLoop(data, false);
// assert_true(packets_skip_ == 0);
// assert_true(split_frame_len_ == 0);

View File

@ -118,7 +118,7 @@ static uint64_t convertUnixtimeToWinFiletime(time_t unixtime) {
// so we convert linux time to nanoseconds and then add the number of
// nanoseconds from 1601 to 1970
// see https://msdn.microsoft.com/en-us/library/ms724228
uint64_t filetime = filetime = (unixtime * 10000000) + 116444736000000000;
uint64_t filetime = (unixtime * 10000000) + 116444736000000000;
return filetime;
}

View File

@ -61,7 +61,7 @@ std::shared_ptr<cpptoml::table> ParseConfig(
const std::filesystem::path& config_path) {
try {
return ParseFile(config_path);
} catch (cpptoml::parse_exception e) {
} catch (cpptoml::parse_exception& e) {
xe::FatalError(fmt::format("Failed to parse config file '{}':\n\n{}",
xe::path_to_utf8(config_path), e.what()));
return nullptr;

View File

@ -1172,7 +1172,7 @@ void* X64HelperEmitter::EmitVectorVRsqrteHelper(void* scalar_helper) {
vshufps(xmm0, xmm0,xmm0, _MM_SHUFFLE(3, 3, 3, 3));
call(scalar_helper);
// this->DebugBreak();
vinsertps(xmm0, xmm0, (3 << 4) | (0 << 6));
vinsertps(xmm0, xmm0, (3 << 4));
vblendps(xmm0, xmm0, ptr[backend()->LookupXMMConstantAddress(XMMFloatInf)],
0b0111);

View File

@ -1593,7 +1593,6 @@ void Value::VectorAverage(Value* other, TypeName type, bool is_unsigned,
void Value::ByteSwap() {
switch (type) {
case INT8_TYPE:
constant.i8 = constant.i8;
break;
case INT16_TYPE:
constant.i16 = xe::byte_swap(constant.i16);

View File

@ -1213,7 +1213,7 @@ void KernelState::InitializeKernelGuestGlobals() {
KernelGuestGlobals* block =
memory_->TranslateVirtual<KernelGuestGlobals*>(kernel_guest_globals_);
memset(block, 0, sizeof(block));
memset(block, 0, sizeof(KernelGuestGlobals));
auto idle_process = memory()->TranslateVirtual<X_KPROCESS*>(GetIdleProcess());
InitializeProcess(idle_process, X_PROCTYPE_IDLE, 0, 0, 0);