silence compiler warnings
This commit is contained in:
@ -33,7 +33,8 @@ static std::string find_section(FILE *fp, const std::string &name)
|
||||
{
|
||||
char linebuf[BUFLEN];
|
||||
|
||||
fgets(linebuf, BUFLEN, fp);
|
||||
if (!fgets(linebuf, BUFLEN, fp))
|
||||
throw TokenizerException("Read error", utils::getsyserror());
|
||||
while (!feof(fp)) {
|
||||
if (utils::strmatch(linebuf, "^\\s*\\[.*\\]\\s*$")) {
|
||||
auto words = Tokenizer(linebuf).as_vector();
|
||||
|
||||
@ -148,8 +148,10 @@ void AngleWrite::command(int narg, char **arg)
|
||||
FILE *coeffs;
|
||||
char line[MAXLINE] = {'\0'};
|
||||
coeffs = fopen(coeffs_file.c_str(), "r");
|
||||
if (!coeffs)
|
||||
error->one(FLERR, "Unable to open temporary file {}: {}", coeffs_file, utils::getsyserror());
|
||||
for (int i = 0; i < atom->nangletypes; ++i) {
|
||||
fgets(line, MAXLINE, coeffs);
|
||||
utils::sfgets(FLERR, line, MAXLINE, coeffs, coeffs_file.c_str(), error);
|
||||
writer->input->one(fmt::format("angle_coeff {}", line));
|
||||
}
|
||||
fclose(coeffs);
|
||||
|
||||
@ -149,8 +149,10 @@ void DihedralWrite::command(int narg, char **arg)
|
||||
FILE *coeffs;
|
||||
char line[MAXLINE] = {'\0'};
|
||||
coeffs = fopen(coeffs_file.c_str(), "r");
|
||||
if (!coeffs)
|
||||
error->one(FLERR, "Unable to open temporary file {}: {}", utils::getsyserror());
|
||||
for (int i = 0; i < atom->ndihedraltypes; ++i) {
|
||||
fgets(line, MAXLINE, coeffs);
|
||||
utils::sfgets(FLERR, line, MAXLINE, coeffs, coeffs_file.c_str(), error);
|
||||
writer->input->one(fmt::format("dihedral_coeff {}", line));
|
||||
}
|
||||
fclose(coeffs);
|
||||
|
||||
@ -144,7 +144,7 @@ void ReadMdfFile(void)
|
||||
|
||||
molecule[n].residue[j].end = i;
|
||||
molecule[n].residue[++j].start = i;
|
||||
strncpy(molecule[n].residue[j].name,atoms[i].residue_string,MAX_NAME);
|
||||
memcpy(molecule[n].residue[j].name,atoms[i].residue_string,MAX_NAME);
|
||||
}
|
||||
}
|
||||
molecule[n].residue[j].end = molecule[n].end;
|
||||
@ -167,10 +167,9 @@ void ReadMdfFile(void)
|
||||
|
||||
for (n=0; n < no_molecules; n++) {
|
||||
for (j=0; j < molecule[n].no_residues; j++) {
|
||||
for (i=molecule[n].residue[j].start; i < molecule[n].residue[j].end;
|
||||
i++) {
|
||||
for (i=molecule[n].residue[j].start; i < molecule[n].residue[j].end; i++) {
|
||||
for (l=0; l < atoms[i].no_connect; l++) {
|
||||
strncpy(temp_string,atoms[i].connections[l],MAX_STRING);
|
||||
memcpy(temp_string,atoms[i].connections[l],MAX_STRING);
|
||||
temp_residue = strtok(temp_string,":");
|
||||
temp_atom_name = strtok(NULL,"%");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user