Skip to content

Commit c1dafe2

Browse files
committed
Refs #20629: Fix windows build
Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
1 parent 933e4ef commit c1dafe2

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ void set_server_client_random_guidPrefix(
13791379
eprosima::fastdds::rtps::GuidUtils::instance().guid_prefix_create(0, guid);
13801380

13811381
auto now = std::chrono::high_resolution_clock::now();
1382-
srand(now.time_since_epoch().count());
1382+
srand(static_cast<uint32_t>(now.time_since_epoch().count()));
13831383
for (auto i = 4; i < 12; i++)
13841384
{
13851385
guid.value[i] = eprosima::fastrtps::rtps::octet(rand() % 254);

tools/fds/server.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ int fastdds_discovery_server(
176176
// Note there is a specific cast to pointer if the Option is valid
177177
option::Option* pOp = options[SERVERID];
178178
int server_id = -1;
179-
std::stringstream is;
179+
std::stringstream server_stream;
180180

181181
if (nullptr == pOp)
182182
{
@@ -203,8 +203,8 @@ int fastdds_discovery_server(
203203
else
204204
{
205205
// Cast of option to int has already been checked
206-
is << pOp->arg;
207-
is >> server_id;
206+
server_stream << pOp->arg;
207+
server_stream >> server_id;
208208
if (!eprosima::fastdds::rtps::get_server_client_default_guidPrefix(server_id,
209209
participantQos.wire_protocol().prefix))
210210
{
@@ -214,15 +214,15 @@ int fastdds_discovery_server(
214214
}
215215

216216
// Clear the std::stringstream state and reset it to an empty string
217-
is.clear();
218-
is.str("");
217+
server_stream.clear();
218+
server_stream.str("");
219219

220220
// Set Participant Name
221221
std::string server_name =
222222
(server_id == -1) ? "eProsima Guidless Server" : "eProsima Default Server" + std::to_string(
223223
server_id);
224-
is << server_name;
225-
participantQos.name(is.str().c_str());
224+
server_stream << server_name;
225+
participantQos.name(server_stream.str().c_str());
226226

227227
// Choose the kind of server to create
228228
pOp = options[BACKUP];
@@ -260,10 +260,6 @@ int fastdds_discovery_server(
260260
option::Option* pO_port = options[UDP_PORT];
261261
if (nullptr != pO_port)
262262
{
263-
// if (eprosima::fastdds::dds::check_udp_port(*pO_port, true) != option::ARG_OK)
264-
// {
265-
// return 1;
266-
// }
267263
std::stringstream is;
268264
is << pO_port->arg;
269265
uint16_t id;

0 commit comments

Comments
 (0)