Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
efosamark committed Apr 23, 2024
1 parent bb868c8 commit c7d057f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions source/hex_funcs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,7 @@ FILE* openFile(const std::string& filePath) {
return file;
}

void closeFile(FILE* const file) {
fclose(file);
}

size_t findCustOffset(FILE* const file) {
long findCustOffset(FILE* const file) {
const std::vector<std::size_t> dataOffsets = findHexDataOffsetsF(file, "43555354");
if (dataOffsets.empty()) {
log("readHexDataAtOffset: data \"%s\" not found.", "CUST");
Expand All @@ -149,7 +145,7 @@ size_t findCustOffset(FILE* const file) {
return dataOffsets[0];
}

std::string readHexDataAtOffset(FILE* const file, const std::string& hexData, const size_t offsetFromData, size_t length, int custOffset = -1) {
std::string readHexDataAtOffset(FILE* const file, const std::string& hexData, const size_t offsetFromData, size_t length, long custOffset = -1) {
// log("Entered readHexDataAtOffset");

if (!file) {
Expand Down
2 changes: 1 addition & 1 deletion source/ini_funcs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ std::string readIniValue(const std::string& filePath, const std::string& section
return ""; // Key not found
}

std::vector<std::vector<int>> parseIntIniData (std::string input, bool skipFirstItem = true) {
std::vector<std::vector<int>> parseIntIniData (const std::string input, bool skipFirstItem = true) {
// Remove outer brackets
input = input.substr(6, input.length() - 3);

Expand Down
4 changes: 2 additions & 2 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ class SubMenu : public tsl::Gui {
~SubMenu() {}

FILE* kipFile = nullptr;
size_t custOffset;
long custOffset;

auto addSliderItem(auto& sliderOption)
{
Expand Down Expand Up @@ -1257,7 +1257,7 @@ class SubMenu : public tsl::Gui {
}

if (kipFile) {
closeFile(kipFile);
fclose(kipFile);
kipFile = nullptr;
}
constexpr int lineHeight = 20; // Adjust the line height as needed
Expand Down

0 comments on commit c7d057f

Please sign in to comment.