Merge pull request #13180 from jordan-woyak/eof-logic

Core/VideoCommon: Fix some weird (!eof) logic.
This commit is contained in:
Admiral H. Curtiss 2025-01-08 05:27:42 +01:00 committed by GitHub
commit 7133bfbb0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 27 additions and 33 deletions

View File

@ -776,14 +776,11 @@ bool DSPAssembler::AssemblePass(const std::string& text, int pass)
m_location.line_num = 0;
m_cur_pass = pass;
#define LINEBUF_SIZE 1024
char line[LINEBUF_SIZE] = {0};
while (!m_failed && !fsrc.fail() && !fsrc.eof())
constexpr int LINEBUF_SIZE = 1024;
char line[LINEBUF_SIZE] = {};
while (!m_failed && fsrc.getline(line, LINEBUF_SIZE))
{
int opcode_size = 0;
fsrc.getline(line, LINEBUF_SIZE);
if (fsrc.fail())
break;
m_location.line_text = line;
m_location.line_num++;

View File

@ -137,10 +137,8 @@ void PostProcessingConfiguration::LoadOptions(const std::string& code)
std::vector<GLSLStringOption> option_strings;
GLSLStringOption* current_strings = nullptr;
while (!in.eof())
{
std::string line_str;
if (std::getline(in, line_str))
while (std::getline(in, line_str))
{
std::string_view line = line_str;
@ -177,7 +175,6 @@ void PostProcessingConfiguration::LoadOptions(const std::string& code)
}
}
}
}
for (const auto& it : option_strings)
{