Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
paolo-projects committed Feb 9, 2022
1 parent ce24b91 commit e879f71
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ set (TESTTAR_SOURCES tests/test_tar.cpp /
src/installinfo.cpp /
src/winservices.cpp /
src/tar.cpp /
src/ziparchive.cpp /
src/toolsdownloader.cpp)
src/ziparchive.cpp)

add_executable( TestTar ${TESTTAR_SOURCES} "include/unlocker.h")

Expand Down
2 changes: 1 addition & 1 deletion include/archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Archive
public:
static bool extractZip(fs::path from, std::string filename, fs::path to);
static bool extractTar(fs::path from, std::string filename, fs::path to);
static void Archive::extractionProgress(float progress);
static void extractionProgress(float progress);
};

#endif // ARCHIVEUTILS_H
1 change: 1 addition & 0 deletions include/unlocker.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string>
#include "filesystem.hpp"
#include <map>
#include <stdexcept>

#include <curl/curl.h>

Expand Down
1 change: 1 addition & 0 deletions src/archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ bool Archive::extractZip(fs::path from, std::string filename, fs::path to)

void Archive::extractionProgress(float progress) {
printf("Extraction progress: %.0f %% \r", progress*100);
fflush(stdout);
}
1 change: 1 addition & 0 deletions src/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ int Network::progress_callback(void* clientp, double dltotal, double dlnow, doub
printf("Download progress: %d %%, %.2f MB / %.2f MB, %.3f MB/s \r",
(std::min)(100, (std::max)(0, int(dlnow * 100 / dltotal))),
mBytesNow, mBytesTotal, downloadRate);
fflush(stdout);

networkProgress->mBytesDownloadedLastTime = mBytesNow;
networkProgress->lastProgressUpdateTime = nowTime;
Expand Down
14 changes: 7 additions & 7 deletions src/unlocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void uninstall()
logerr("Error while restoring \"" + file.path().string() + "\".");
}
}
catch (fs::filesystem_error ex)
catch (const fs::filesystem_error& ex)
{
logerr(ex.what());
}
Expand All @@ -129,7 +129,7 @@ void uninstall()
logerr("Error while restoring \"" + file.path().string() + "\".");
}
}
catch (fs::filesystem_error ex)
catch (const fs::filesystem_error& ex)
{
logerr(ex.what());
}
Expand Down Expand Up @@ -185,7 +185,7 @@ void uninstall()
logerr("Error while restoring \"" + (backup / file).string() + "\".");
}
}
catch (fs::filesystem_error ex)
catch (const fs::filesystem_error& ex)
{
logerr(ex.what());
}
Expand All @@ -206,7 +206,7 @@ void uninstall()
logerr("Error while restoring \"" + (backup / fs::path(lib).filename()).string() + "\".");
}
}
catch (fs::filesystem_error ex)
catch (const fs::filesystem_error& ex)
{
logerr(ex.what());
}
Expand Down Expand Up @@ -356,15 +356,15 @@ void doPatch()

if (!fs::exists(vmx))
{
throw std::runtime_error(logerr("Vmx file not found");
throw std::runtime_error("Vmx file not found");
}
if (!fs::exists(vmx_debug))
{
throw std::runtime_error(logerr("Vmx-debug file not found");
throw std::runtime_error("Vmx-debug file not found");
}
if (!fs::exists(vmlib))
{
throw std::runtime_error(logerr("Vmlib file not found");
throw std::runtime_error("Vmlib file not found");
}

logd("File: " + vmx.filename().string());
Expand Down
1 change: 1 addition & 0 deletions tests/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <stdarg.h>
#include <stdio.h>
#include <cstring>
#include "colors.h"

#include <sys/stat.h>
Expand Down

0 comments on commit e879f71

Please sign in to comment.