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

pull/593/head
Andrei Kortunov 4 years ago
parent 9647b670e4
commit 651ad11ad8

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

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

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

@ -60,7 +60,7 @@ namespace MWPhysics
// 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.
int attempt = 0;
float downStepSize;
float downStepSize = 0;
while(attempt < 3)
{
attempt++;

Loading…
Cancel
Save