Skip to content

Commit

Permalink
solved msvc compile warnings
Browse files Browse the repository at this point in the history
oblaser committed Mar 5, 2021
1 parent 3477e00 commit 2b403e1
Showing 3 changed files with 27 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/application/arg.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
\author Oliver Blaser
\date 01.03.2021
\date 05.03.2021
\copyright GNU GPLv3 - Copyright (c) 2021 Oliver Blaser
*/
@@ -349,7 +349,7 @@ ArgList potoroo::ArgList::parse(const char* args)
{
*(argv + i) = new char[list[i - 1].size()];

for (int j = 0; j < list[i - 1].size(); ++j) *((*(argv + i)) + j) = list[i - 1][j];
for (size_t j = 0; j < list[i - 1].size(); ++j) *((*(argv + i)) + j) = list[i - 1][j];
//copy(list[i - 1].begin(), list[i - 1].end(), *(argv + i));

#if PRJ_DEBUG
11 changes: 9 additions & 2 deletions src/application/job.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
\author Oliver Blaser
\date 02.03.2021
\date 05.03.2021
\copyright GNU GPLv3 - Copyright (c) 2021 Oliver Blaser
*/
@@ -164,6 +164,7 @@ namespace
ifstream jfs;

size_t fileSize = 0;
streampos fileSizeL = 0;

fs::path jobfile(filename);

@@ -180,9 +181,15 @@ namespace
jfs.open(jobfile, ios::binary | ios::in);

jfs.seekg(0, ios::end);
fileSize = jfs.tellg();
fileSizeL = jfs.tellg();
jfs.seekg(0, ios::beg);

if (fileSizeL > static_cast<size_t>(-1))
{
throw runtime_error("file too big");
}
else fileSize = static_cast<size_t>(fileSizeL);

if (fileSize == 0)
{
printWarning(procStr, "empty file");
22 changes: 16 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
\author Oliver Blaser
\date 03.03.2021
\date 05.03.2021
\copyright GNU GPLv3 - Copyright (c) 2021 Oliver Blaser
*/
@@ -78,17 +78,27 @@ namespace

void printVersion()
{
cout << "potoroo " << PRJ_VERSION ;
cout << "potoroo " << PRJ_VERSION;

#if PRJ_VERSION_PRERELEASE
cout << " " << sgr(SGRFGC_BRIGHT_MAGENTA) << "pre-release" << sgr(SGR_RESET) << " built at " << __DATE__ << " " << __TIME__;
cout << " " << sgr(SGRFGC_BRIGHT_MAGENTA) << "pre-release" << sgr(SGR_RESET);

#define VERSION_PRERELEASE_TYPE 0

#if (VERSION_PRERELEASE_TYPE == 1)
cout << " built tag " << "TAG";
#elif (VERSION_PRERELEASE_TYPE == 2)
cout << " built commit " << "COMMIT-HASH";
#else
cout << " built at " << __DATE__ << " " << __TIME__;
#endif
#endif

#if PRJ_DEBUG
cout << " " << sgr(SGRFGC_BRIGHT_RED) << " DEBUG" << sgr(SGR_RESET);
cout << " " << sgr(SGRFGC_BRIGHT_RED) << "DEBUG" << sgr(SGR_RESET);
#endif

cout << endl<< endl;
cout << endl << endl;
cout << "project page: <https://github.com/oblaser/potoroo>" << endl;
cout << endl;
cout << "Copyright (c) 2021 Oliver Blaser." << endl;
@@ -158,7 +168,7 @@ int main(int argc, char** argv)

//args.add(Arg("--force-jf"));

//args.add(Arg("-v"));
args.add(Arg("-v"));
//args.add(Arg("-h"));
#endif

0 comments on commit 2b403e1

Please sign in to comment.