modernize code

This commit is contained in:
Axel Kohlmeyer
2025-06-25 20:02:41 -04:00
parent b093094d5e
commit 9cc2638c91
2 changed files with 8 additions and 7 deletions

View File

@ -247,7 +247,7 @@ std::string utils::point_to_error(Input *input, int failed)
} }
return cmdline; return cmdline;
} else } else
return std::string(""); return {""};
} }
/* specialization for the case of just a single string argument */ /* specialization for the case of just a single string argument */
@ -290,7 +290,8 @@ std::string utils::errorurl(int errorcode)
return "\nFor more information see https://docs.lammps.org/Errors_details.html"; return "\nFor more information see https://docs.lammps.org/Errors_details.html";
else if (errorcode > 0) else if (errorcode > 0)
return fmt::format("\nFor more information see https://docs.lammps.org/err{:04d}", errorcode); return fmt::format("\nFor more information see https://docs.lammps.org/err{:04d}", errorcode);
else return ""; // negative numbers are reserved for future use pointing to a different URL else
return ""; // negative numbers are reserved for future use pointing to a different URL
} }
void utils::flush_buffers(LAMMPS *lmp) void utils::flush_buffers(LAMMPS *lmp)

View File

@ -41,12 +41,12 @@
#endif #endif
#if defined(LAMMPS_SMALLBIG) #if defined(LAMMPS_SMALLBIG)
typedef int tagint; using tagint = int;
typedef int64_t bigint; using bigint = int64_t;
#define BIGINT_FORMAT "%" PRId64 #define BIGINT_FORMAT "%" PRId64
#else /* LAMMPS_BIGBIG */ #else /* LAMMPS_BIGBIG */
typedef int64_t tagint; using tagint = int64_t;
typedef int64_t bigint; using bigint = int64_t;
#define BIGINT_FORMAT "%" PRId64 #define BIGINT_FORMAT "%" PRId64
#endif #endif
@ -80,7 +80,7 @@ int main(int narg, char **arg)
} }
n = strlen(arg[iarg]) + 1 + 4; n = strlen(arg[iarg]) + 1 + 4;
auto filetxt = new char[n]; auto *filetxt = new char[n];
strcpy(filetxt, arg[iarg]); strcpy(filetxt, arg[iarg]);
strcat(filetxt, ".txt"); strcat(filetxt, ".txt");
FILE *fptxt = fopen(filetxt, "w"); FILE *fptxt = fopen(filetxt, "w");