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
Fix some annoying warnings #12652
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -454,30 +454,8 @@ class AudioDecoder : public ppu_thread | |
if (adecIsAtracX(type)) last_pts -= 0x10000; // hack | ||
} | ||
|
||
struct AVPacketHolder : AVPacket | ||
{ | ||
AVPacketHolder(u32 data_size) | ||
{ | ||
av_init_packet(this); | ||
|
||
if (data_size) | ||
{ | ||
this->data = static_cast<u8*>(av_calloc(1, data_size + AV_INPUT_BUFFER_PADDING_SIZE)); | ||
this->size = data_size + AV_INPUT_BUFFER_PADDING_SIZE; | ||
} | ||
else | ||
{ | ||
this->data = nullptr; | ||
this->size = 0; | ||
} | ||
} | ||
|
||
~AVPacketHolder() | ||
{ | ||
av_free(data); | ||
} | ||
|
||
} au(0); | ||
AVPacket* packet = av_packet_alloc(); | ||
std::unique_ptr<AVPacket, decltype([](AVPacket* p){av_packet_unref(p);})> packet_(packet); | ||
|
||
if (just_started && just_finished) | ||
{ | ||
|
@@ -544,8 +522,6 @@ class AudioDecoder : public ppu_thread | |
just_started = false; | ||
} | ||
|
||
bool last_frame = false; | ||
|
||
while (true) | ||
{ | ||
if (Emu.IsStopped() || is_closed) | ||
|
@@ -554,14 +530,7 @@ class AudioDecoder : public ppu_thread | |
break; | ||
} | ||
|
||
last_frame = av_read_frame(fmt, &au) < 0; | ||
if (last_frame) | ||
{ | ||
//break; | ||
av_free(au.data); | ||
au.data = NULL; | ||
au.size = 0; | ||
} | ||
av_read_frame(fmt, packet); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the result not checked? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previous code was destructor's job, so it shouldn't affect anything. |
||
|
||
struct AdecFrameHolder : AdecFrame | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,10 +43,9 @@ bool ime_jp_manager::addChar(u16 c) | |
if (!c || cursor >= (CELL_IMEJP_STRING_MAXLENGTH - 1) || cursor > input_string.length()) | ||
return false; | ||
|
||
std::u16string tmp; | ||
tmp += c; | ||
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)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't wanna test this but this really looks weird. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should work like before, I did workaround compiler bug. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's completely broken now |
||
cursor_end = ++cursor; | ||
input_state = CELL_IMEJP_BEFORE_CONVERT; | ||
return true; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) |
||
|
||
if (dotpos) | ||
{ | ||
|
There was a problem hiding this comment.
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?