Conversation
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
|
clang-tidy review says "All clean, LGTM! 👍" |
SlySven
left a comment
There was a problem hiding this comment.
If it makes a code-analyser bot happy then who am I to make it
| mpHost->mpConsole->print(prefix, Qt::red, mpHost->mBgColor); // Bright Red | ||
| mpHost->mpConsole->print(firstLineTail.append('\n'), QColor(255, 255, 50), mpHost->mBgColor); // Bright Yellow | ||
| for (quint8 _i = 0; _i < body.size(); ++_i) { | ||
| for (int _i = 0; _i < body.size(); ++_i) { |
There was a problem hiding this comment.
👍 I guess it is okay for these, I only used a smaller unsigned integer type because the number of line in the message could never be negative and I could not foresee there ever being as many as 256 lines in one of these messages. OTOH Qt insists on using a (standard) signed int for every size() method for each of it's (container) classes...
| label_mapFileSaveFormatVersion->setEnabled(false); | ||
| if (pHost->mpMap->mMaxVersion > pHost->mpMap->mDefaultVersion || pHost->mpMap->mMinVersion < pHost->mpMap->mDefaultVersion) { | ||
| for (short int i = pHost->mpMap->mMinVersion; i <= pHost->mpMap->mMaxVersion; ++i) { | ||
| for (int i = pHost->mpMap->mMinVersion; i <= pHost->mpMap->mMaxVersion; ++i) { |
There was a problem hiding this comment.
🤷♂️ Same again - only this time the integer type miss-match is entirely (my)self-inflicted - this loop populates the map format version number (for saving map files) QComboBox with each of the limited (currently 17, 18, 19 or, the default, 20 - inserted before all the others) values available - I never anticipate the number exceeding 255 so it was semi-appropriate to limit the loop variable to being a short - but then again, I think rain is wet so who am I to say...?
Brief overview of PR changes/additions
Fix CodeQL warnings - differently-sized integers can lead to an overflow. https://codeql.github.com/codeql-query-help/cpp/cpp-comparison-with-wider-type
Motivation for adding to Mudlet
Fix CodeQL issues that has been sitting around for a year without attention
Other info (issues closed, discussion etc)
The differently-sized integers aren't really helping all too much, but they do have the potential to cause trouble.