Skip to content

Commit 2bc4d4c

Browse files
committed
fix syntax errors
1 parent bc72e8b commit 2bc4d4c

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/binary.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <QByteArray>
2020
#include <QDebug>
2121

22-
2322
/**
2423
* @brief Look for a bit pattern that set 16:9 aspect ratio for Tomb Raider 4.
2524
*
@@ -32,8 +31,8 @@
3231
*/
3332
qint64 findReplacePattern(QFile* const file) {
3433
qint64 status = 0; // Initialize the status variable
35-
QByteArray fileContent = file.readAll();
36-
file.close();
34+
QByteArray fileContent = file->readAll();
35+
file->close();
3736

3837
// Define the pattern to find and replace
3938
QByteArray pattern = QByteArray::fromHex("abaaaa3f0ad7a33b");
@@ -50,17 +49,17 @@ qint64 findReplacePattern(QFile* const file) {
5049
fileContent.replace(index, pattern.size(), replacement);
5150

5251
// Reopen the file for writing
53-
if (!file.open(QIODevice::WriteOnly)) { // flawfinder: ignore
52+
if (!file->open(QIODevice::WriteOnly)) { // flawfinder: ignore
5453
qCritical() << "Error opening file for writing!";
5554
status = 2;
56-
} else if (file.write(fileContent) == -1) {
55+
} else if (file->write(fileContent) == -1) {
5756
qCritical() << "Error writing to file!";
5857
status = 3;
5958
} else {
6059
qDebug() << "Widescreen patch applied successfully!";
6160
}
6261

63-
file.close();
62+
file->close();
6463
return status;
6564
}
6665

@@ -91,7 +90,7 @@ qint64 widescreen_set(const QString& path) {
9190
}
9291

9392
// Perform the pattern replacement and propagate the status
94-
status = findReplacePattern(file);
93+
status = findReplacePattern(&file);
9594

9695
return status; // Single return point
9796
}

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ int main(int argc, char *argv[]) {
3636

3737
// Add custom -w option for widescreen
3838
parser.addOption(QCommandLineOption(
39-
QStringList {"w", "widescreen"}
40-
"Set widescreen bit on original games, probably not useful for TRLE"
39+
QStringList {"w", "widescreen"},
40+
"Set widescreen bit on original games, probably not useful for TRLE",
4141
"PATH"));
4242

4343
// Process arguments

0 commit comments

Comments
 (0)