Cleanup: Use raw string literal
Resolves modernize-raw-string-literal Clang-Tidy warning The way warning works is it suggests to use raw literal when overhead of having escape characters is higher than the overhead of having raw literal syntax (talking about code size overhead). This means that the warning will not trigger for "foo\"bar". Differential Revision: https://developer.blender.org/D10322
This commit is contained in:
parent
5ec4ba8080
commit
b4dca4ea2c
|
@ -39,7 +39,6 @@ Checks: >
|
||||||
-modernize-use-nodiscard,
|
-modernize-use-nodiscard,
|
||||||
-modernize-loop-convert,
|
-modernize-loop-convert,
|
||||||
-modernize-pass-by-value,
|
-modernize-pass-by-value,
|
||||||
-modernize-raw-string-literal,
|
|
||||||
|
|
||||||
WarningsAsErrors: '*'
|
WarningsAsErrors: '*'
|
||||||
CheckOptions:
|
CheckOptions:
|
||||||
|
|
|
@ -561,14 +561,14 @@ template<typename T> void cdt_draw(const std::string &label, const CDTArrangemen
|
||||||
const vec2<double> &uco = u->co.approx;
|
const vec2<double> &uco = u->co.approx;
|
||||||
const vec2<double> &vco = v->co.approx;
|
const vec2<double> &vco = v->co.approx;
|
||||||
int strokew = e->input_ids == nullptr ? thin_line : thick_line;
|
int strokew = e->input_ids == nullptr ? thin_line : thick_line;
|
||||||
f << "<line fill=\"none\" stroke=\"black\" stroke-width=\"" << strokew << "\" x1=\""
|
f << R"(<line fill="none" stroke="black" stroke-width=")" << strokew << "\" x1=\""
|
||||||
<< SX(uco[0]) << "\" y1=\"" << SY(uco[1]) << "\" x2=\"" << SX(vco[0]) << "\" y2=\""
|
<< SX(uco[0]) << "\" y1=\"" << SY(uco[1]) << "\" x2=\"" << SX(vco[0]) << "\" y2=\""
|
||||||
<< SY(vco[1]) << "\">\n";
|
<< SY(vco[1]) << "\">\n";
|
||||||
f << " <title>" << vertname(u) << vertname(v) << "</title>\n";
|
f << " <title>" << vertname(u) << vertname(v) << "</title>\n";
|
||||||
f << "</line>\n";
|
f << "</line>\n";
|
||||||
if (draw_edge_labels) {
|
if (draw_edge_labels) {
|
||||||
f << "<text x=\"" << SX((uco[0] + vco[0]) / 2) << "\" y=\"" << SY((uco[1] + vco[1]) / 2)
|
f << "<text x=\"" << SX((uco[0] + vco[0]) / 2) << "\" y=\"" << SY((uco[1] + vco[1]) / 2)
|
||||||
<< "\" font-size=\"small\">";
|
<< R"(" font-size="small">)";
|
||||||
f << vertname(u) << vertname(v) << sename(&e->symedges[0]) << sename(&e->symedges[1])
|
f << vertname(u) << vertname(v) << sename(&e->symedges[0]) << sename(&e->symedges[1])
|
||||||
<< "</text>\n";
|
<< "</text>\n";
|
||||||
}
|
}
|
||||||
|
@ -576,13 +576,13 @@ template<typename T> void cdt_draw(const std::string &label, const CDTArrangemen
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (const CDTVert<T> *v : cdt.verts) {
|
for (const CDTVert<T> *v : cdt.verts) {
|
||||||
f << "<circle fill=\"black\" cx=\"" << SX(v->co.approx[0]) << "\" cy=\"" << SY(v->co.approx[1])
|
f << R"(<circle fill="black" cx=")" << SX(v->co.approx[0]) << "\" cy=\"" << SY(v->co.approx[1])
|
||||||
<< "\" r=\"" << vert_radius << "\">\n";
|
<< "\" r=\"" << vert_radius << "\">\n";
|
||||||
f << " <title>[" << i << "]" << v->co.approx << "</title>\n";
|
f << " <title>[" << i << "]" << v->co.approx << "</title>\n";
|
||||||
f << "</circle>\n";
|
f << "</circle>\n";
|
||||||
if (draw_vert_labels) {
|
if (draw_vert_labels) {
|
||||||
f << "<text x=\"" << SX(v->co.approx[0]) + vert_radius << "\" y=\""
|
f << "<text x=\"" << SX(v->co.approx[0]) + vert_radius << "\" y=\""
|
||||||
<< SY(v->co.approx[1]) - vert_radius << "\" font-size=\"small\">[" << i << "]</text>\n";
|
<< SY(v->co.approx[1]) - vert_radius << R"(" font-size="small">[)" << i << "]</text>\n";
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,10 +275,10 @@ NodeWithSocketsRef::NodeWithSocketsRef(Node &node,
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
|
||||||
ss << "<<table border=\"0\" cellspacing=\"3\">";
|
ss << R"(<<table border="0" cellspacing="3">)";
|
||||||
|
|
||||||
/* Header */
|
/* Header */
|
||||||
ss << "<tr><td colspan=\"3\" align=\"center\"><b>";
|
ss << R"(<tr><td colspan="3" align="center"><b>)";
|
||||||
ss << ((name.size() == 0) ? "No Name" : name);
|
ss << ((name.size() == 0) ? "No Name" : name);
|
||||||
ss << "</b></td></tr>";
|
ss << "</b></td></tr>";
|
||||||
|
|
||||||
|
@ -291,7 +291,7 @@ NodeWithSocketsRef::NodeWithSocketsRef(Node &node,
|
||||||
if (name.size() == 0) {
|
if (name.size() == 0) {
|
||||||
name = "No Name";
|
name = "No Name";
|
||||||
}
|
}
|
||||||
ss << "<td align=\"left\" port=\"in" << i << "\">";
|
ss << R"(<td align="left" port="in)" << i << "\">";
|
||||||
ss << name;
|
ss << name;
|
||||||
ss << "</td>";
|
ss << "</td>";
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@ NodeWithSocketsRef::NodeWithSocketsRef(Node &node,
|
||||||
if (name.size() == 0) {
|
if (name.size() == 0) {
|
||||||
name = "No Name";
|
name = "No Name";
|
||||||
}
|
}
|
||||||
ss << "<td align=\"right\" port=\"out" << i << "\">";
|
ss << R"(<td align="right" port="out)" << i << "\">";
|
||||||
ss << name;
|
ss << name;
|
||||||
ss << "</td>";
|
ss << "</td>";
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,7 +184,7 @@ static void deg_debug_graphviz_legend(DotExportContext &ctx)
|
||||||
|
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "<";
|
ss << "<";
|
||||||
ss << "<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"4\">";
|
ss << R"(<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">)";
|
||||||
ss << "<TR><TD COLSPAN=\"2\"><B>Legend</B></TD></TR>";
|
ss << "<TR><TD COLSPAN=\"2\"><B>Legend</B></TD></TR>";
|
||||||
|
|
||||||
#ifdef COLOR_SCHEME_NODE_CLASS
|
#ifdef COLOR_SCHEME_NODE_CLASS
|
||||||
|
|
|
@ -87,7 +87,7 @@ string gnuplotify_name(const string &name)
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
const char ch = name[i];
|
const char ch = name[i];
|
||||||
if (ch == '_') {
|
if (ch == '_') {
|
||||||
result += "\\\\\\";
|
result += R"(\\\)";
|
||||||
}
|
}
|
||||||
result += ch;
|
result += ch;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue