Skip to content

Commit 47d25a7

Browse files
committed
Xdr::data() no longer needs comment.c_str()
1 parent 00e305b commit 47d25a7

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

src/mesh/xdr_io.C

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void XdrIO::write (const std::string & name)
222222

223223
// Write vector of elemset ids to file with comment
224224
std::string comment_string = "# elemset ids for elemset code " + std::to_string(elemset_code);
225-
io.data(elemset_id_vec, comment_string.c_str());
225+
io.data(elemset_id_vec, comment_string);
226226
}
227227
}
228228

@@ -421,7 +421,7 @@ XdrIO::write_serialized_connectivity (Xdr & io,
421421
legend += "p_level ";
422422
legend += "(n0 ... nN-1) ]";
423423
comment += legend;
424-
io.data (n_global_elem_at_level[0], comment.c_str());
424+
io.data (n_global_elem_at_level[0], comment);
425425
}
426426

427427
for (auto pid : make_range(this->n_processors()))
@@ -542,7 +542,7 @@ XdrIO::write_serialized_connectivity (Xdr & io,
542542
buf << "p_level ";
543543
buf << "(n0 ... nN-1) ]";
544544

545-
io.data (n_global_elem_at_level[level], buf.str().c_str());
545+
io.data (n_global_elem_at_level[level], buf.str());
546546
}
547547

548548
for (auto pid : make_range(this->n_processors()))
@@ -1161,7 +1161,7 @@ void XdrIO::write_serialized_bcs_helper (Xdr & io, const new_header_id_type n_bc
11611161
{
11621162
std::stringstream comment_string;
11631163
comment_string << "# number of " << bc_type << " boundary conditions";
1164-
io.data (n_bcs_out, comment_string.str().c_str());
1164+
io.data (n_bcs_out, comment_string.str());
11651165
}
11661166
n_bcs_out = 0;
11671167

src/systems/equation_systems_io.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ void EquationSystems::write(std::string_view name,
529529
// Note: There is no Xdr::data overload taking a "const
530530
// std::string &" so we need to make a copy.
531531
std::string copy = sys_name;
532-
io.data (copy, comment.c_str());
532+
io.data (copy, comment);
533533
}
534534

535535
// 4.)
@@ -541,7 +541,7 @@ void EquationSystems::write(std::string_view name,
541541
comment = "# Type, System No. ";
542542
comment += std::to_string(sys_num);
543543

544-
io.data (sys_type, comment.c_str());
544+
io.data (sys_type, comment);
545545
}
546546

547547
// 5.) - 9.)

src/systems/system_io.C

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ void System::write_header (Xdr & io,
13211321
comment += "\"";
13221322

13231323
unsigned int nv = this->n_vars();
1324-
io.data (nv, comment.c_str());
1324+
io.data (nv, comment);
13251325
}
13261326

13271327

@@ -1338,7 +1338,7 @@ void System::write_header (Xdr & io,
13381338
comment += "\"";
13391339

13401340
std::string var_name = this->variable_name(var);
1341-
io.data (var_name, comment.c_str());
1341+
io.data (var_name, comment);
13421342
}
13431343

13441344
// 6.1.) Variable subdomains
@@ -1353,7 +1353,7 @@ void System::write_header (Xdr & io,
13531353
const std::set<subdomain_id_type> & domains = this->variable(var).active_subdomains();
13541354
std::vector<subdomain_id_type> domain_array;
13551355
domain_array.assign(domains.begin(), domains.end());
1356-
io.data (domain_array, comment.c_str());
1356+
io.data (domain_array, comment);
13571357
}
13581358

13591359
// 7.)
@@ -1368,7 +1368,7 @@ void System::write_header (Xdr & io,
13681368
comment += "\"";
13691369

13701370
int order = static_cast<int>(this->variable_type(var).order);
1371-
io.data (order, comment.c_str());
1371+
io.data (order, comment);
13721372
}
13731373

13741374

@@ -1383,7 +1383,7 @@ void System::write_header (Xdr & io,
13831383
comment += "\"";
13841384

13851385
int rad_order = static_cast<int>(this->variable_type(var).radial_order);
1386-
io.data (rad_order, comment.c_str());
1386+
io.data (rad_order, comment);
13871387
}
13881388

13891389
#endif
@@ -1400,7 +1400,7 @@ void System::write_header (Xdr & io,
14001400

14011401
const FEType & type = this->variable_type(var);
14021402
int fam = static_cast<int>(type.family);
1403-
io.data (fam, comment.c_str());
1403+
io.data (fam, comment);
14041404

14051405
#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
14061406

@@ -1411,7 +1411,7 @@ void System::write_header (Xdr & io,
14111411
comment += "\"";
14121412

14131413
int radial_fam = static_cast<int>(type.radial_family);
1414-
io.data (radial_fam, comment.c_str());
1414+
io.data (radial_fam, comment);
14151415

14161416
comment = "# Infinite Mapping Type, Variable \"";
14171417
comment += this->variable_name(var);
@@ -1420,7 +1420,7 @@ void System::write_header (Xdr & io,
14201420
comment += "\"";
14211421

14221422
int i_map = static_cast<int>(type.inf_map);
1423-
io.data (i_map, comment.c_str());
1423+
io.data (i_map, comment);
14241424
#endif
14251425
}
14261426
} // end of the variable loop
@@ -1437,7 +1437,7 @@ void System::write_header (Xdr & io,
14371437
comment += "\"";
14381438

14391439
unsigned int nvecs = write_additional_data ? this->n_vectors () : 0;
1440-
io.data (nvecs, comment.c_str());
1440+
io.data (nvecs, comment);
14411441
}
14421442

14431443
if (write_additional_data)
@@ -1451,13 +1451,13 @@ void System::write_header (Xdr & io,
14511451
comment = "# Name of " + dth_vector;
14521452
std::string vec_name = pr.first;
14531453

1454-
io.data (vec_name, comment.c_str());
1454+
io.data (vec_name, comment);
14551455
int vec_projection = _vector_projections.at(vec_name);
14561456
comment = "# Whether to do projections for " + dth_vector;
1457-
io.data (vec_projection, comment.c_str());
1457+
io.data (vec_projection, comment);
14581458
int vec_type = _vector_types.at(vec_name);
14591459
comment = "# Parallel type of " + dth_vector;
1460-
io.data (vec_type, comment.c_str());
1460+
io.data (vec_type, comment);
14611461
}
14621462
}
14631463
}
@@ -1580,7 +1580,7 @@ void System::write_parallel_data (Xdr & io,
15801580
comment += "\" Solution Vector";
15811581
}
15821582

1583-
io.data (io_buffer, comment.c_str());
1583+
io.data (io_buffer, comment);
15841584

15851585
// total_written_size += io_buffer.size();
15861586

@@ -1646,7 +1646,7 @@ void System::write_parallel_data (Xdr & io,
16461646
comment += "\"";
16471647
}
16481648

1649-
io.data (io_buffer, comment.c_str());
1649+
io.data (io_buffer, comment);
16501650

16511651
// total_written_size += io_buffer.size();
16521652
}

0 commit comments

Comments
 (0)