no typecasts needed when outputting ubuf integers with fmtlib auto format

This commit is contained in:
Axel Kohlmeyer
2020-07-07 11:35:47 -04:00
parent bdac1ae3e7
commit 94d98b6aea
4 changed files with 8 additions and 12 deletions

View File

@ -1876,7 +1876,7 @@ void AtomVec::write_data(FILE *fp, int n, double **buf)
int i,j,m,nn,datatype,cols;
for (i = 0; i < n; i++) {
fmt::print(fp,"{}",(tagint) ubuf(buf[i][0]).i);
fmt::print(fp,"{}",ubuf(buf[i][0]).i);
j = 1;
for (nn = 1; nn < ndata_atom; nn++) {
@ -2024,7 +2024,7 @@ void AtomVec::write_vel(FILE *fp, int n, double **buf)
int i,j,m,nn,datatype,cols;
for (i = 0; i < n; i++) {
fmt::print(fp,"{}",(tagint) ubuf(buf[i][0]).i);
fmt::print(fp,"{}",ubuf(buf[i][0]).i);
j = 1;
for (nn = 1; nn < ndata_vel; nn++) {

View File

@ -521,9 +521,8 @@ int AtomVecEllipsoid::pack_data_bonus(double **buf, int /*flag*/)
void AtomVecEllipsoid::write_data_bonus(FILE *fp, int n, double **buf, int /*flag*/)
{
for (int i = 0; i < n; i++) {
fmt::print(fp,"{} {} {} {} {} {} {} {}",
(tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6],buf[i][7]);
fmt::print(fp,"{} {} {} {} {} {} {} {}\n", ubuf(buf[i][0]).i,buf[i][1],
buf[i][2],buf[i][3],buf[i][4],buf[i][5],buf[i][6],buf[i][7]);
}
}

View File

@ -502,9 +502,8 @@ int AtomVecLine::pack_data_bonus(double **buf, int /*flag*/)
void AtomVecLine::write_data_bonus(FILE *fp, int n, double **buf, int /*flag*/)
{
for (int i = 0; i < n; i++) {
fmt::print(fp,"{} {} {} {} {}",
(tagint) ubuf(buf[i][0]).i,
buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
fmt::print(fp,"{} {} {} {} {}\n",ubuf(buf[i][0]).i,
buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
}
}

View File

@ -738,10 +738,8 @@ int AtomVecTri::pack_data_bonus(double **buf, int /*flag*/)
void AtomVecTri::write_data_bonus(FILE *fp, int n, double **buf, int /*flag*/)
{
for (int i = 0; i < n; i++) {
fmt::print(fp,"{} {} {} {} {} {} {} {} {} {} {}",
(tagint) ubuf(buf[i][0]).i,
buf[i][1],buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6],
fmt::print(fp,"{} {} {} {} {} {} {} {} {} {} {}\n",ubuf(buf[i][0]).i,
buf[i][1],buf[i][2],buf[i][3],buf[i][4],buf[i][5],buf[i][6],
buf[i][7],buf[i][8],buf[i][9]);
}
}