make more use of std::string and fmtlib where beneficial

This commit is contained in:
Axel Kohlmeyer
2020-06-25 21:13:14 -04:00
parent 8caa3e188c
commit 3c78ad0a70
7 changed files with 46 additions and 68 deletions

View File

@ -32,6 +32,7 @@
#include "memory.h"
#include "error.h"
#include "math_const.h"
#include "fmt/format.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -715,11 +716,8 @@ void ComputeOrientOrderAtom::init_clebsch_gordan()
double ComputeOrientOrderAtom::factorial(int n)
{
if (n < 0 || n > nmaxfactorial) {
char str[128];
sprintf(str, "Invalid argument to factorial %d", n);
error->all(FLERR, str);
}
if (n < 0 || n > nmaxfactorial)
error->all(FLERR,fmt::format("Invalid argument to factorial {}", n));
return nfac_table[n];
}