1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 23:23:52 +00:00

Do not leave variables without initialization, even in execution paths where they are unused

This commit is contained in:
Andrei Kortunov 2021-04-19 15:51:00 +04:00
parent 9647b670e4
commit 651ad11ad8
4 changed files with 4 additions and 4 deletions

View file

@ -17,7 +17,7 @@ namespace MWDialogue
std::vector<Token> parseHyperText(const std::string & text) std::vector<Token> parseHyperText(const std::string & text)
{ {
std::vector<Token> result; std::vector<Token> result;
size_t pos_end, iteration_pos = 0; size_t pos_end = std::string::npos, iteration_pos = 0;
for(;;) for(;;)
{ {
size_t pos_begin = text.find('@', iteration_pos); size_t pos_begin = text.find('@', iteration_pos);

View file

@ -148,7 +148,7 @@ namespace MWGui
// We need this copy for when @# hyperlinks are replaced // We need this copy for when @# hyperlinks are replaced
std::string text = mText; std::string text = mText;
size_t pos_end; size_t pos_end = std::string::npos;
for(;;) for(;;)
{ {
size_t pos_begin = text.find('@'); size_t pos_begin = text.find('@');

View file

@ -129,7 +129,7 @@ struct JournalViewModelImpl : JournalViewModel
utf8text.replace(pos_begin, pos_end+1-pos_begin, displayName); utf8text.replace(pos_begin, pos_end+1-pos_begin, displayName);
intptr_t value; intptr_t value = 0;
if (mModel->mKeywordSearch.containsKeyword(topicName, value)) if (mModel->mKeywordSearch.containsKeyword(topicName, value))
mHyperLinks[std::make_pair(pos_begin, pos_begin+displayName.size())] = value; mHyperLinks[std::make_pair(pos_begin, pos_begin+displayName.size())] = value;
} }

View file

@ -60,7 +60,7 @@ namespace MWPhysics
// attempt 3: further, less tall fixed distance movement, same as above // attempt 3: further, less tall fixed distance movement, same as above
// If you're making a full conversion you should purge the logic for attempts 2 and 3. Attempts 2 and 3 just try to work around problems with vanilla Morrowind assets. // If you're making a full conversion you should purge the logic for attempts 2 and 3. Attempts 2 and 3 just try to work around problems with vanilla Morrowind assets.
int attempt = 0; int attempt = 0;
float downStepSize; float downStepSize = 0;
while(attempt < 3) while(attempt < 3)
{ {
attempt++; attempt++;