Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some annoying warnings #12652

Merged
merged 1 commit into from Sep 17, 2022
Merged

Fix some annoying warnings #12652

merged 1 commit into from Sep 17, 2022

Conversation

Nekotekina
Copy link
Member

No description provided.

@Nekotekina
Copy link
Member Author

Go go brrrr.

@Nekotekina Nekotekina merged commit b49a1f2 into RPCS3:master Sep 17, 2022
input_string.insert(cursor++, tmp);
cursor_end = cursor;
input_string += c; // resize
std::memmove(input_string.data() + cursor + 1, input_string.data() + cursor, sizeof(u16) * (input_string.size() - 1 - cursor));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't wanna test this but this really looks weird.
From a quick glance this entire change seems to change the logic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should work like before, I did workaround compiler bug.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's completely broken now

au.data = NULL;
au.size = 0;
}
av_read_frame(fmt, packet);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the result not checked?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous code was destructor's job, so it shouldn't affect anything.

}

} au(0);
AVPacket* packet = av_packet_alloc();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the object not checked for null?

@@ -148,7 +148,7 @@ int check_filename(std::string_view file_path, bool disallow_system_files, bool
return 70;
}

char name[CELL_SAVEDATA_FILENAME_SIZE - 3];
char name[CELL_SAVEDATA_FILENAME_SIZE + 3];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's harmless but it fixes annoying compiler bug (or some real bug I couldn't figure out)

AVPacket packet{};
av_init_packet(&packet);

AVPacket* packet = av_packet_alloc();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed and why doesn't it check for null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk, it's probably null only on out of memory, which itself is very serious problem which can't be worked around easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants