diff --git a/source/hex_funcs.hpp b/source/hex_funcs.hpp index 3971b8c1..4580b55e 100644 --- a/source/hex_funcs.hpp +++ b/source/hex_funcs.hpp @@ -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 dataOffsets = findHexDataOffsetsF(file, "43555354"); if (dataOffsets.empty()) { log("readHexDataAtOffset: data \"%s\" not found.", "CUST"); @@ -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) { diff --git a/source/ini_funcs.hpp b/source/ini_funcs.hpp index ed260cac..962d6558 100644 --- a/source/ini_funcs.hpp +++ b/source/ini_funcs.hpp @@ -587,7 +587,7 @@ std::string readIniValue(const std::string& filePath, const std::string& section return ""; // Key not found } -std::vector> parseIntIniData (std::string input, bool skipFirstItem = true) { +std::vector> parseIntIniData (const std::string input, bool skipFirstItem = true) { // Remove outer brackets input = input.substr(6, input.length() - 3); diff --git a/source/main.cpp b/source/main.cpp index 5071b8ba..ee96d945 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -792,7 +792,7 @@ class SubMenu : public tsl::Gui { ~SubMenu() {} FILE* kipFile = nullptr; - size_t custOffset; + long custOffset; auto addSliderItem(auto& sliderOption) { @@ -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