Skip to content

Commit

Permalink
Merge pull request #4298 from micheleCTDE/fix/warnings
Browse files Browse the repository at this point in the history
Fix compiling warnings
  • Loading branch information
micheleCTDEAdmin committed May 18, 2024
2 parents a4cb495 + 90ea873 commit 0bf7766
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/newlines/class_colon_pos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "align/stack.h"
#include "chunk.h"
#include "log_rules.h"
#include "keywords.h"
#include "log_rules.h"
#include "mark_change.h"
#include "newlines/add.h"
#include "newlines/force.h"
Expand Down
10 changes: 6 additions & 4 deletions src/newlines/oc_msg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,20 @@ void newline_oc_msg(Chunk *start)
{
should_nl_msg = true;
}

bool finish_multi_line = options::nl_oc_msg_args_finish_multi_line();
if (finish_multi_line) {
size_t prev_line = -1;

if (finish_multi_line)
{
size_t prev_line = 0;

for (Chunk *pc = start->GetNextNcNnl(); pc->IsNotNullChunk(); pc = pc->GetNextNcNnl())
{
if (pc->GetLevel() <= start->GetLevel())
{
break;
}

if (prev_line != -1 && pc->GetOrigLine() != prev_line)
if (prev_line > 0 && pc->GetOrigLine() != prev_line)
{
should_nl_msg = true;
}
Expand Down
16 changes: 5 additions & 11 deletions src/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2266,18 +2266,12 @@ static std::map<std::size_t, std::pair<std::wregex, std::wregex> > get_reflow_fo

while (it_regex != it_regex_end)
{
std::wsmatch match = *it_regex;
std::wsmatch match = *it_regex;
auto &&index = std::stoi(match[3].str());
std::wregex *p_wregex = (match[1].length() > 0) ? &regex_map[index].second
: &regex_map[index].first;
*p_wregex = match[4].str();

if ( (( match[1].matched
|| match[2].matched))
&& match[3].matched
&& match[4].matched)
{
auto &&index = std::stoi(match[3].str());
std::wregex *p_wregex = match[1].matched ? &regex_map[index].second
: &regex_map[index].first;
*p_wregex = match[4].str();
}
++it_regex;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/tokenizer/EnumStructUnionParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,7 @@ void EnumStructUnionParser::mark_constructors()
{
break; // Issue #4250
}

if ( std::strcmp(prev->Text(), name) == 0
&& prev->GetLevel() == level
&& next->IsParenOpen())
Expand Down

0 comments on commit 0bf7766

Please sign in to comment.