@@ -26,6 +26,7 @@ struct Position2D
2626// the object to/from JSON.
2727// You still need to call BT::RegisterJsonDefinition<Position2D>()
2828// in main()
29+ // NOLINTNEXTLINE(misc-use-internal-linkage)
2930BT_JSON_CONVERTER (Position2D, pos)
3031{
3132 add_field (" x" , &pos.x );
@@ -39,6 +40,7 @@ struct Waypoint
3940 double speed = 1.0 ;
4041};
4142
43+ // NOLINTNEXTLINE(misc-use-internal-linkage)
4244BT_JSON_CONVERTER (Waypoint, wp)
4345{
4446 add_field (" name" , &wp.name );
@@ -70,6 +72,7 @@ class UpdatePosition : public BT::SyncActionNode
7072
7173 // Helper to generate random offset [-range, +range]
7274 auto randOffset = [](double range) {
75+ // NOLINTNEXTLINE(cert-msc30-c,cert-msc50-cpp,concurrency-mt-unsafe)
7376 return (static_cast <double >(std::rand ()) / RAND_MAX - 0.5 ) * 2.0 * range;
7477 };
7578
@@ -120,8 +123,9 @@ class UpdatePosition : public BT::SyncActionNode
120123};
121124
122125// clang-format off
123-
124- static const char * xml_text = R"(
126+ namespace
127+ {
128+ const char * xml_text = R"(
125129<root BTCPP_format="4">
126130
127131 <BehaviorTree ID="MainTree">
@@ -150,7 +154,7 @@ static const char* xml_text = R"(
150154
151155</root>
152156 )" ;
153-
157+ } // namespace
154158// clang-format on
155159
156160int main ()
@@ -165,7 +169,7 @@ int main()
165169 // Groot2 editor requires a model of your registered Nodes.
166170 // You don't need to write that by hand, it can be automatically
167171 // generated using the following command.
168- const std::string xml_models = BT::writeTreeNodesModelXML (factory);
172+ [[maybe_unused]] const std::string xml_models = BT::writeTreeNodesModelXML (factory);
169173
170174 factory.registerBehaviorTreeFromText (xml_text);
171175
@@ -191,7 +195,7 @@ int main()
191195 BT::FileLogger2 logger2 (tree, " t11_groot_howto.btlog" );
192196 BT::MinitraceLogger minilog (tree, " minitrace.json" );
193197
194- while (1 )
198+ while (true )
195199 {
196200 std::cout << " Start" << std::endl;
197201 cross_door.reset ();
0 commit comments