Skip to content

Commit 102aff2

Browse files
committed
Fix a couple of implicit type conversion warnings
1 parent 6533fec commit 102aff2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/commentcnv.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,7 @@ static void replaceCommentMarker(yyscan_t yyscanner,std::string_view s)
16241624
}
16251625
// copy comment line to output
16261626
yyextra->outBuf+=s.substr(p);
1627-
yyextra->col+=s.substr(p).length();
1627+
yyextra->col+=static_cast<int>(s.substr(p).length());
16281628
}
16291629
16301630
static inline int computeIndent(const char *s)
@@ -1849,7 +1849,7 @@ static void insertCommentStart(yyscan_t yyscanner)
18491849
if (static_cast<int>(marker.length())<=markerSpace && !yyextra->firstIncludeLine)
18501850
{
18511851
copyToOutput(yyscanner,marker);
1852-
i+=marker.length();
1852+
i+=static_cast<int>(marker.length());
18531853
}
18541854
for (;i<contentCol;i++)
18551855
{

src/markdown.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ int Markdown::Private::processCodeSpan(std::string_view data,size_t offset)
17551755
if (nb>=3) // found ``` that is not at the start of the line, keep it as-is.
17561756
{
17571757
out+=data.substr(0,nb);
1758-
return nb;
1758+
return static_cast<int>(nb);
17591759
}
17601760
return 0; // no matching delimiter
17611761
}

src/regex.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ void Ex::Private::compile()
286286
prevTokenPos = tokenPos;
287287
addToken(PToken(PToken::Kind::BeginCapture));
288288
size_t id = ++nextCaptureId; // groups start at 1, 0 is whole match
289-
data.back().setValue(id);
289+
data.back().setValue(static_cast<uint16_t>(id));
290290
captureStack.push_back(id);
291291
}
292292
break;
@@ -301,7 +301,7 @@ void Ex::Private::compile()
301301
size_t id = captureStack.back();
302302
captureStack.pop_back();
303303
addToken(PToken(PToken::Kind::EndCapture));
304-
data.back().setValue(id);
304+
data.back().setValue(static_cast<uint16_t>(id));
305305
}
306306
break;
307307
case '[': // character class

0 commit comments

Comments
 (0)