cast return value to void to indicate that we want to ignore the result
This commit is contained in:
@ -106,7 +106,7 @@ void DumpAtomGZ::write_header(bigint ndump)
|
|||||||
}
|
}
|
||||||
header += fmt::format("ITEM: ATOMS {}\n", columns);
|
header += fmt::format("ITEM: ATOMS {}\n", columns);
|
||||||
|
|
||||||
writer.write(header.c_str(), header.length());
|
(void) writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ void DumpAtomGZ::write_header(bigint ndump)
|
|||||||
void DumpAtomGZ::write_data(int n, double *mybuf)
|
void DumpAtomGZ::write_data(int n, double *mybuf)
|
||||||
{
|
{
|
||||||
if (buffer_flag == 1) {
|
if (buffer_flag == 1) {
|
||||||
writer.write(mybuf, n);
|
(void) writer.write(mybuf, n);
|
||||||
} else {
|
} else {
|
||||||
constexpr size_t VBUFFER_SIZE = 256;
|
constexpr size_t VBUFFER_SIZE = 256;
|
||||||
char vbuffer[VBUFFER_SIZE];
|
char vbuffer[VBUFFER_SIZE];
|
||||||
@ -133,7 +133,7 @@ void DumpAtomGZ::write_data(int n, double *mybuf)
|
|||||||
static_cast<int>(mybuf[m + 1]), mybuf[m + 2], mybuf[m + 3], mybuf[m + 4]);
|
static_cast<int>(mybuf[m + 1]), mybuf[m + 2], mybuf[m + 3], mybuf[m + 4]);
|
||||||
}
|
}
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump atom/gz output");
|
error->one(FLERR, "Error while writing dump atom/gz output");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,7 +112,7 @@ void DumpAtomZstd::write_header(bigint ndump)
|
|||||||
}
|
}
|
||||||
header += fmt::format("ITEM: ATOMS {}\n", columns);
|
header += fmt::format("ITEM: ATOMS {}\n", columns);
|
||||||
|
|
||||||
writer.write(header.c_str(), header.length());
|
(void) writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ void DumpAtomZstd::write_header(bigint ndump)
|
|||||||
void DumpAtomZstd::write_data(int n, double *mybuf)
|
void DumpAtomZstd::write_data(int n, double *mybuf)
|
||||||
{
|
{
|
||||||
if (buffer_flag == 1) {
|
if (buffer_flag == 1) {
|
||||||
writer.write(mybuf, n);
|
(void) writer.write(mybuf, n);
|
||||||
} else {
|
} else {
|
||||||
constexpr size_t VBUFFER_SIZE = 256;
|
constexpr size_t VBUFFER_SIZE = 256;
|
||||||
char vbuffer[VBUFFER_SIZE];
|
char vbuffer[VBUFFER_SIZE];
|
||||||
@ -139,7 +139,7 @@ void DumpAtomZstd::write_data(int n, double *mybuf)
|
|||||||
static_cast<int>(mybuf[m + 1]), mybuf[m + 2], mybuf[m + 3], mybuf[m + 4]);
|
static_cast<int>(mybuf[m + 1]), mybuf[m + 2], mybuf[m + 3], mybuf[m + 4]);
|
||||||
}
|
}
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump atom/gz output");
|
error->one(FLERR, "Error while writing dump atom/gz output");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,7 +111,7 @@ void DumpCFGGZ::write_header(bigint n)
|
|||||||
header += fmt::format("entry_count = {}\n", nfield - 2);
|
header += fmt::format("entry_count = {}\n", nfield - 2);
|
||||||
for (int i = 0; i < nfield - 5; i++) header += fmt::format("auxiliary[{}] = {}\n", i, auxname[i]);
|
for (int i = 0; i < nfield - 5; i++) header += fmt::format("auxiliary[{}] = {}\n", i, auxname[i]);
|
||||||
|
|
||||||
writer.write(header.c_str(), header.length());
|
(void) writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -119,7 +119,7 @@ void DumpCFGGZ::write_header(bigint n)
|
|||||||
void DumpCFGGZ::write_data(int n, double *mybuf)
|
void DumpCFGGZ::write_data(int n, double *mybuf)
|
||||||
{
|
{
|
||||||
if (buffer_flag) {
|
if (buffer_flag) {
|
||||||
writer.write(mybuf, n);
|
(void) writer.write(mybuf, n);
|
||||||
} else {
|
} else {
|
||||||
constexpr size_t VBUFFER_SIZE = 256;
|
constexpr size_t VBUFFER_SIZE = 256;
|
||||||
char vbuffer[VBUFFER_SIZE];
|
char vbuffer[VBUFFER_SIZE];
|
||||||
@ -143,13 +143,13 @@ void DumpCFGGZ::write_data(int n, double *mybuf)
|
|||||||
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<bigint>(mybuf[m]));
|
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<bigint>(mybuf[m]));
|
||||||
}
|
}
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump cfg/gz output");
|
error->one(FLERR, "Error while writing dump cfg/gz output");
|
||||||
}
|
}
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
writer.write("\n", 1);
|
(void) writer.write("\n", 1);
|
||||||
}
|
}
|
||||||
} else if (unwrapflag == 1) {
|
} else if (unwrapflag == 1) {
|
||||||
int m = 0;
|
int m = 0;
|
||||||
@ -174,13 +174,13 @@ void DumpCFGGZ::write_data(int n, double *mybuf)
|
|||||||
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<bigint>(mybuf[m]));
|
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<bigint>(mybuf[m]));
|
||||||
}
|
}
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump cfg/gz output");
|
error->one(FLERR, "Error while writing dump cfg/gz output");
|
||||||
}
|
}
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
writer.write("\n", 1);
|
(void) writer.write("\n", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -119,7 +119,7 @@ void DumpCFGZstd::write_header(bigint n)
|
|||||||
header += fmt::format("entry_count = {}\n", nfield - 2);
|
header += fmt::format("entry_count = {}\n", nfield - 2);
|
||||||
for (int i = 0; i < nfield - 5; i++) header += fmt::format("auxiliary[{}] = {}\n", i, auxname[i]);
|
for (int i = 0; i < nfield - 5; i++) header += fmt::format("auxiliary[{}] = {}\n", i, auxname[i]);
|
||||||
|
|
||||||
writer.write(header.c_str(), header.length());
|
(void) writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -127,7 +127,7 @@ void DumpCFGZstd::write_header(bigint n)
|
|||||||
void DumpCFGZstd::write_data(int n, double *mybuf)
|
void DumpCFGZstd::write_data(int n, double *mybuf)
|
||||||
{
|
{
|
||||||
if (buffer_flag) {
|
if (buffer_flag) {
|
||||||
writer.write(mybuf, n);
|
(void) writer.write(mybuf, n);
|
||||||
} else {
|
} else {
|
||||||
constexpr size_t VBUFFER_SIZE = 256;
|
constexpr size_t VBUFFER_SIZE = 256;
|
||||||
char vbuffer[VBUFFER_SIZE];
|
char vbuffer[VBUFFER_SIZE];
|
||||||
@ -151,13 +151,13 @@ void DumpCFGZstd::write_data(int n, double *mybuf)
|
|||||||
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<bigint>(mybuf[m]));
|
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<bigint>(mybuf[m]));
|
||||||
}
|
}
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump cfg/gz output");
|
error->one(FLERR, "Error while writing dump cfg/gz output");
|
||||||
}
|
}
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
writer.write("\n", 1);
|
(void) writer.write("\n", 1);
|
||||||
}
|
}
|
||||||
} else if (unwrapflag == 1) {
|
} else if (unwrapflag == 1) {
|
||||||
int m = 0;
|
int m = 0;
|
||||||
@ -182,13 +182,13 @@ void DumpCFGZstd::write_data(int n, double *mybuf)
|
|||||||
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<bigint>(mybuf[m]));
|
written = snprintf(vbuffer, VBUFFER_SIZE, vformat[j], static_cast<bigint>(mybuf[m]));
|
||||||
}
|
}
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump cfg/gz output");
|
error->one(FLERR, "Error while writing dump cfg/gz output");
|
||||||
}
|
}
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
writer.write("\n", 1);
|
(void) writer.write("\n", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,7 +104,7 @@ void DumpCustomGZ::write_header(bigint ndump)
|
|||||||
}
|
}
|
||||||
header += fmt::format("ITEM: ATOMS {}\n", columns);
|
header += fmt::format("ITEM: ATOMS {}\n", columns);
|
||||||
|
|
||||||
writer.write(header.c_str(), header.length());
|
(void) writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ void DumpCustomGZ::write_header(bigint ndump)
|
|||||||
void DumpCustomGZ::write_data(int n, double *mybuf)
|
void DumpCustomGZ::write_data(int n, double *mybuf)
|
||||||
{
|
{
|
||||||
if (buffer_flag == 1) {
|
if (buffer_flag == 1) {
|
||||||
writer.write(mybuf, n);
|
(void) writer.write(mybuf, n);
|
||||||
} else {
|
} else {
|
||||||
constexpr size_t VBUFFER_SIZE = 256;
|
constexpr size_t VBUFFER_SIZE = 256;
|
||||||
char vbuffer[VBUFFER_SIZE];
|
char vbuffer[VBUFFER_SIZE];
|
||||||
@ -132,13 +132,13 @@ void DumpCustomGZ::write_data(int n, double *mybuf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump custom/gz output");
|
error->one(FLERR, "Error while writing dump custom/gz output");
|
||||||
}
|
}
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
writer.write("\n", 1);
|
(void) writer.write("\n", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,7 +122,7 @@ void DumpCustomZstd::write_header(bigint ndump)
|
|||||||
}
|
}
|
||||||
header += fmt::format("ITEM: ATOMS {}\n", columns);
|
header += fmt::format("ITEM: ATOMS {}\n", columns);
|
||||||
|
|
||||||
writer.write(header.c_str(), header.length());
|
(void) writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ void DumpCustomZstd::write_header(bigint ndump)
|
|||||||
void DumpCustomZstd::write_data(int n, double *mybuf)
|
void DumpCustomZstd::write_data(int n, double *mybuf)
|
||||||
{
|
{
|
||||||
if (buffer_flag == 1) {
|
if (buffer_flag == 1) {
|
||||||
writer.write(mybuf, n);
|
(void) writer.write(mybuf, n);
|
||||||
} else {
|
} else {
|
||||||
constexpr size_t VBUFFER_SIZE = 256;
|
constexpr size_t VBUFFER_SIZE = 256;
|
||||||
char vbuffer[VBUFFER_SIZE];
|
char vbuffer[VBUFFER_SIZE];
|
||||||
@ -150,13 +150,13 @@ void DumpCustomZstd::write_data(int n, double *mybuf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump custom/gz output");
|
error->one(FLERR, "Error while writing dump custom/gz output");
|
||||||
}
|
}
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
writer.write("\n", 1);
|
(void) writer.write("\n", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,7 +104,7 @@ void DumpLocalGZ::write_header(bigint ndump)
|
|||||||
}
|
}
|
||||||
header += fmt::format("ITEM: {} {}\n", label, columns);
|
header += fmt::format("ITEM: {} {}\n", label, columns);
|
||||||
|
|
||||||
writer.write(header.c_str(), header.length());
|
(void) writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ void DumpLocalGZ::write_header(bigint ndump)
|
|||||||
void DumpLocalGZ::write_data(int n, double *mybuf)
|
void DumpLocalGZ::write_data(int n, double *mybuf)
|
||||||
{
|
{
|
||||||
if (buffer_flag == 1) {
|
if (buffer_flag == 1) {
|
||||||
writer.write(mybuf, sizeof(char) * n);
|
(void) writer.write(mybuf, sizeof(char) * n);
|
||||||
} else {
|
} else {
|
||||||
constexpr size_t VBUFFER_SIZE = 256;
|
constexpr size_t VBUFFER_SIZE = 256;
|
||||||
char vbuffer[VBUFFER_SIZE];
|
char vbuffer[VBUFFER_SIZE];
|
||||||
@ -132,13 +132,13 @@ void DumpLocalGZ::write_data(int n, double *mybuf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump local/gz output");
|
error->one(FLERR, "Error while writing dump local/gz output");
|
||||||
}
|
}
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
writer.write("\n", 1);
|
(void) writer.write("\n", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,7 +112,7 @@ void DumpLocalZstd::write_header(bigint ndump)
|
|||||||
}
|
}
|
||||||
header += fmt::format("ITEM: {} {}\n", label, columns);
|
header += fmt::format("ITEM: {} {}\n", label, columns);
|
||||||
|
|
||||||
writer.write(header.c_str(), header.length());
|
(void) writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ void DumpLocalZstd::write_header(bigint ndump)
|
|||||||
void DumpLocalZstd::write_data(int n, double *mybuf)
|
void DumpLocalZstd::write_data(int n, double *mybuf)
|
||||||
{
|
{
|
||||||
if (buffer_flag == 1) {
|
if (buffer_flag == 1) {
|
||||||
writer.write(mybuf, sizeof(char) * n);
|
(void) writer.write(mybuf, sizeof(char) * n);
|
||||||
} else {
|
} else {
|
||||||
constexpr size_t VBUFFER_SIZE = 256;
|
constexpr size_t VBUFFER_SIZE = 256;
|
||||||
char vbuffer[VBUFFER_SIZE];
|
char vbuffer[VBUFFER_SIZE];
|
||||||
@ -140,13 +140,13 @@ void DumpLocalZstd::write_data(int n, double *mybuf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump local/gz output");
|
error->one(FLERR, "Error while writing dump local/gz output");
|
||||||
}
|
}
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
writer.write("\n", 1);
|
(void) writer.write("\n", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,7 +84,7 @@ void DumpXYZGZ::write_header(bigint ndump)
|
|||||||
auto header = fmt::format("{}\n Atoms. Timestep: {}", ndump, update->ntimestep);
|
auto header = fmt::format("{}\n Atoms. Timestep: {}", ndump, update->ntimestep);
|
||||||
if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time());
|
if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time());
|
||||||
header += "\n";
|
header += "\n";
|
||||||
writer.write(header.c_str(), header.length());
|
(void) writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ void DumpXYZGZ::write_header(bigint ndump)
|
|||||||
void DumpXYZGZ::write_data(int n, double *mybuf)
|
void DumpXYZGZ::write_data(int n, double *mybuf)
|
||||||
{
|
{
|
||||||
if (buffer_flag) {
|
if (buffer_flag) {
|
||||||
writer.write(mybuf, n);
|
(void) writer.write(mybuf, n);
|
||||||
} else {
|
} else {
|
||||||
constexpr size_t VBUFFER_SIZE = 256;
|
constexpr size_t VBUFFER_SIZE = 256;
|
||||||
char vbuffer[VBUFFER_SIZE];
|
char vbuffer[VBUFFER_SIZE];
|
||||||
@ -103,7 +103,7 @@ void DumpXYZGZ::write_data(int n, double *mybuf)
|
|||||||
snprintf(vbuffer, VBUFFER_SIZE, format, typenames[static_cast<int>(mybuf[m + 1])],
|
snprintf(vbuffer, VBUFFER_SIZE, format, typenames[static_cast<int>(mybuf[m + 1])],
|
||||||
mybuf[m + 2], mybuf[m + 3], mybuf[m + 4]);
|
mybuf[m + 2], mybuf[m + 3], mybuf[m + 4]);
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump xyz/gz output");
|
error->one(FLERR, "Error while writing dump xyz/gz output");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,7 +92,7 @@ void DumpXYZZstd::write_header(bigint ndump)
|
|||||||
auto header = fmt::format("{}\n Atoms. Timestep: {}", ndump, update->ntimestep);
|
auto header = fmt::format("{}\n Atoms. Timestep: {}", ndump, update->ntimestep);
|
||||||
if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time());
|
if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time());
|
||||||
header += "\n";
|
header += "\n";
|
||||||
writer.write(header.c_str(), header.length());
|
(void) writer.write(header.c_str(), header.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ void DumpXYZZstd::write_header(bigint ndump)
|
|||||||
void DumpXYZZstd::write_data(int n, double *mybuf)
|
void DumpXYZZstd::write_data(int n, double *mybuf)
|
||||||
{
|
{
|
||||||
if (buffer_flag) {
|
if (buffer_flag) {
|
||||||
writer.write(mybuf, n);
|
(void) writer.write(mybuf, n);
|
||||||
} else {
|
} else {
|
||||||
constexpr size_t VBUFFER_SIZE = 256;
|
constexpr size_t VBUFFER_SIZE = 256;
|
||||||
char vbuffer[VBUFFER_SIZE];
|
char vbuffer[VBUFFER_SIZE];
|
||||||
@ -111,7 +111,7 @@ void DumpXYZZstd::write_data(int n, double *mybuf)
|
|||||||
snprintf(vbuffer, VBUFFER_SIZE, format, typenames[static_cast<int>(mybuf[m + 1])],
|
snprintf(vbuffer, VBUFFER_SIZE, format, typenames[static_cast<int>(mybuf[m + 1])],
|
||||||
mybuf[m + 2], mybuf[m + 3], mybuf[m + 4]);
|
mybuf[m + 2], mybuf[m + 3], mybuf[m + 4]);
|
||||||
if (written > 0) {
|
if (written > 0) {
|
||||||
writer.write(vbuffer, written);
|
(void) writer.write(vbuffer, written);
|
||||||
} else if (written < 0) {
|
} else if (written < 0) {
|
||||||
error->one(FLERR, "Error while writing dump xyz/gz output");
|
error->one(FLERR, "Error while writing dump xyz/gz output");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -300,12 +300,12 @@ void DumpDCD::write_frame()
|
|||||||
|
|
||||||
nframes++;
|
nframes++;
|
||||||
out_integer = nframes;
|
out_integer = nframes;
|
||||||
fseek(fp,NFILE_POS,SEEK_SET);
|
(void) fseek(fp,NFILE_POS,SEEK_SET);
|
||||||
fwrite_int32(fp,out_integer);
|
fwrite_int32(fp,out_integer);
|
||||||
out_integer = update->ntimestep;
|
out_integer = update->ntimestep;
|
||||||
fseek(fp,NSTEP_POS,SEEK_SET);
|
(void) fseek(fp,NSTEP_POS,SEEK_SET);
|
||||||
fwrite_int32(fp,out_integer);
|
fwrite_int32(fp,out_integer);
|
||||||
fseek(fp,0,SEEK_END);
|
(void) fseek(fp,0,SEEK_END);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -488,7 +488,7 @@ void FixAveCorrelateLong::end_of_step()
|
|||||||
|
|
||||||
if (fp && comm->me == 0) {
|
if (fp && comm->me == 0) {
|
||||||
clearerr(fp);
|
clearerr(fp);
|
||||||
if (overwrite) platform::fseek(fp,filepos);
|
if (overwrite) (void) platform::fseek(fp,filepos);
|
||||||
fmt::print(fp,"# Timestep: {}\n", ntimestep);
|
fmt::print(fp,"# Timestep: {}\n", ntimestep);
|
||||||
for (unsigned int i=0; i < npcorr; ++i) {
|
for (unsigned int i=0; i < npcorr; ++i) {
|
||||||
fprintf(fp, "%lg ", t[i]*update->dt*nevery);
|
fprintf(fp, "%lg ", t[i]*update->dt*nevery);
|
||||||
|
|||||||
@ -573,7 +573,7 @@ void Dump::openfile()
|
|||||||
nameslist[numfiles] = utils::strdup(filecurrent);
|
nameslist[numfiles] = utils::strdup(filecurrent);
|
||||||
++numfiles;
|
++numfiles;
|
||||||
} else {
|
} else {
|
||||||
remove(nameslist[fileidx]);
|
(void) remove(nameslist[fileidx]);
|
||||||
delete[] nameslist[fileidx];
|
delete[] nameslist[fileidx];
|
||||||
nameslist[fileidx] = utils::strdup(filecurrent);
|
nameslist[fileidx] = utils::strdup(filecurrent);
|
||||||
fileidx = (fileidx + 1) % maxfiles;
|
fileidx = (fileidx + 1) % maxfiles;
|
||||||
|
|||||||
@ -899,7 +899,7 @@ void FixAveChunk::end_of_step()
|
|||||||
|
|
||||||
if (fp && comm->me == 0) {
|
if (fp && comm->me == 0) {
|
||||||
clearerr(fp);
|
clearerr(fp);
|
||||||
if (overwrite) platform::fseek(fp,filepos);
|
if (overwrite) (void) platform::fseek(fp,filepos);
|
||||||
double count = 0.0;
|
double count = 0.0;
|
||||||
for (m = 0; m < nchunk; m++) count += count_total[m];
|
for (m = 0; m < nchunk; m++) count += count_total[m];
|
||||||
fmt::print(fp,"{} {} {}\n",ntimestep,nchunk,count);
|
fmt::print(fp,"{} {} {}\n",ntimestep,nchunk,count);
|
||||||
|
|||||||
@ -716,7 +716,7 @@ void FixAveHisto::end_of_step()
|
|||||||
|
|
||||||
if (fp && comm->me == 0) {
|
if (fp && comm->me == 0) {
|
||||||
clearerr(fp);
|
clearerr(fp);
|
||||||
if (overwrite) platform::fseek(fp,filepos);
|
if (overwrite) (void) platform::fseek(fp,filepos);
|
||||||
fmt::print(fp,"{} {} {} {} {} {}\n",ntimestep,nbins,
|
fmt::print(fp,"{} {} {} {} {} {}\n",ntimestep,nbins,
|
||||||
stats_total[0],stats_total[1],stats_total[2],stats_total[3]);
|
stats_total[0],stats_total[1],stats_total[2],stats_total[3]);
|
||||||
if (stats_total[0] != 0.0)
|
if (stats_total[0] != 0.0)
|
||||||
|
|||||||
@ -453,7 +453,7 @@ void FixAveHistoWeight::end_of_step()
|
|||||||
|
|
||||||
if (fp && comm->me == 0) {
|
if (fp && comm->me == 0) {
|
||||||
clearerr(fp);
|
clearerr(fp);
|
||||||
if (overwrite) platform::fseek(fp,filepos);
|
if (overwrite) (void) platform::fseek(fp,filepos);
|
||||||
fmt::print(fp,"{} {} {} {} {} {}\n",ntimestep,nbins,
|
fmt::print(fp,"{} {} {} {} {} {}\n",ntimestep,nbins,
|
||||||
stats_total[0],stats_total[1],stats_total[2],stats_total[3]);
|
stats_total[0],stats_total[1],stats_total[2],stats_total[3]);
|
||||||
if (stats_total[0] != 0.0)
|
if (stats_total[0] != 0.0)
|
||||||
|
|||||||
@ -640,7 +640,7 @@ void FixAveTime::invoke_scalar(bigint ntimestep)
|
|||||||
|
|
||||||
if (fp && comm->me == 0) {
|
if (fp && comm->me == 0) {
|
||||||
clearerr(fp);
|
clearerr(fp);
|
||||||
if (overwrite) platform::fseek(fp,filepos);
|
if (overwrite) (void) platform::fseek(fp,filepos);
|
||||||
if (yaml_flag) {
|
if (yaml_flag) {
|
||||||
if (!yaml_header || overwrite) {
|
if (!yaml_header || overwrite) {
|
||||||
yaml_header = true;
|
yaml_header = true;
|
||||||
|
|||||||
@ -785,7 +785,7 @@ void Min::ev_set(bigint ntimestep)
|
|||||||
int flag;
|
int flag;
|
||||||
|
|
||||||
int eflag_global = 1;
|
int eflag_global = 1;
|
||||||
for (auto &icompute : elist_global) icompute->matchstep(ntimestep);
|
for (auto &icompute : elist_global) (void) icompute->matchstep(ntimestep);
|
||||||
|
|
||||||
flag = 0;
|
flag = 0;
|
||||||
int eflag_atom = 0;
|
int eflag_atom = 0;
|
||||||
|
|||||||
@ -942,7 +942,7 @@ int platform::ftruncate(FILE *fp, bigint length)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
platform::fseek(fp, length);
|
(void) platform::fseek(fp, length);
|
||||||
return ::ftruncate(fileno(fp), (off_t) length);
|
return ::ftruncate(fileno(fp), (off_t) length);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1030,11 +1030,11 @@ void ReadRestart::check_eof_magic()
|
|||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
bigint curpos = platform::ftell(fp);
|
bigint curpos = platform::ftell(fp);
|
||||||
platform::fseek(fp,platform::END_OF_FILE);
|
(void) platform::fseek(fp,platform::END_OF_FILE);
|
||||||
bigint offset = platform::ftell(fp) - n;
|
bigint offset = platform::ftell(fp) - n;
|
||||||
platform::fseek(fp,offset);
|
(void) platform::fseek(fp,offset);
|
||||||
utils::sfread(FLERR,str,sizeof(char),n,fp,nullptr,error);
|
utils::sfread(FLERR,str,sizeof(char),n,fp,nullptr,error);
|
||||||
platform::fseek(fp,curpos);
|
(void) platform::fseek(fp,curpos);
|
||||||
}
|
}
|
||||||
|
|
||||||
MPI_Bcast(str,n,MPI_CHAR,0,world);
|
MPI_Bcast(str,n,MPI_CHAR,0,world);
|
||||||
|
|||||||
@ -542,7 +542,7 @@ void ReaderNative::skip_buf(size_t size)
|
|||||||
{
|
{
|
||||||
bigint pos = platform::ftell(fp);
|
bigint pos = platform::ftell(fp);
|
||||||
pos += size;
|
pos += size;
|
||||||
platform::fseek(fp,pos);
|
(void) platform::fseek(fp,pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReaderNative::is_known_magic_str() const
|
bool ReaderNative::is_known_magic_str() const
|
||||||
|
|||||||
@ -817,7 +817,7 @@ int Variable::next(int narg, char **arg)
|
|||||||
fprintf(fp,"%d\n",nextindex+1);
|
fprintf(fp,"%d\n",nextindex+1);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
fp = nullptr;
|
fp = nullptr;
|
||||||
rename("tmp.lammps.variable.lock","tmp.lammps.variable");
|
(void) rename("tmp.lammps.variable.lock","tmp.lammps.variable");
|
||||||
if (universe->uscreen)
|
if (universe->uscreen)
|
||||||
fprintf(universe->uscreen, "Increment via next: value %d on partition %d\n",
|
fprintf(universe->uscreen, "Increment via next: value %d on partition %d\n",
|
||||||
nextindex+1,universe->iworld);
|
nextindex+1,universe->iworld);
|
||||||
|
|||||||
Reference in New Issue
Block a user