A few modest objectives:
- get rid of IDE warnings (clang?)
- get rid of make warnings
- refactor code to modern C++ standards 14/17
- write a few unit tests
- maybe a mock or two
- when compilers add modules support, refactor to use modules
For example, I refactored the following:
Code: Select all
unsigned long length = static_cast<unsigned long>(f.Size());
if (length > 0) {
char *temp = static_cast<char*>(malloc( length+1));
temp[length] = '\0';
f.Read( temp, length );
bool end = true;
for (int i = static_cast<int>(length-1); i >= 0; i--) {
if (temp[i] == '\r' || temp[i] == '\n')
temp[i] = (end ? '\0' : '_');
else if (temp[i] == '\0' || temp[i] == ' ' || temp[i] == '\t')
temp[i] = (end ? '\0' : '_');
else
end = false;
}
*res = (temp);
free( temp );
}
f.Close();
Code: Select all
const auto size = static_cast<const unsigned long>(f.Size());
if(size > 0) {
vector<char> file(size, 0);
auto filePointer = reinterpret_cast<char*>(&file[0]);
f.Read(filePointer, size);
auto end = true;
for (auto it = file.rbegin(); it != file.rend(); ++it) {
switch(*it) {
case '\r':
case '\n':
case '\0':
case '\t':
case ' ':
*it = end ? '\0' : '_';
break;
default: end = false;
}
}
}
f.Close();
I can also fork the project, if the devs don't feel comfortable giving me access to the repository.
Roy