Base/App: fix warnings from code analysers:

* convert old-style-casts to explicit C++ casts where possible
* make some implicit conversions explicit
This commit is contained in:
wmayer
2022-03-06 23:49:30 +01:00
parent 26ece78df4
commit 4a343ab31e
30 changed files with 211 additions and 155 deletions

View File

@@ -42,9 +42,9 @@ Range::Range(const char * range)
std::string from;
std::string to;
assert(range != NULL);
assert(range != nullptr);
if (strchr(range, ':') == NULL) {
if (strchr(range, ':') == nullptr) {
from = range;
to = range;
}
@@ -247,13 +247,13 @@ std::string App::CellAddress::toString(Cell cell) const
if (_absCol && flags.testFlag(Cell::Absolute))
s << '$';
if (col() < 26) {
s << (char)('A' + col());
s << static_cast<char>('A' + col());
}
else {
int colnum = col() - 26;
s << (char)('A' + (colnum / 26));
s << (char)('A' + (colnum % 26));
s << static_cast<char>('A' + (colnum / 26));
s << static_cast<char>('A' + (colnum % 26));
}
}