Skip to content
Snippets Groups Projects
Commit a2edef7c authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

local variable fp in pair style eam/cd was shadowing class member. renamed local variable to fptr

parent 1f9504c5
No related branches found
No related tags found
No related merge requests found
...@@ -456,11 +456,11 @@ void PairCDEAM::read_h_coeff(char *filename) ...@@ -456,11 +456,11 @@ void PairCDEAM::read_h_coeff(char *filename)
{ {
if(comm->me == 0) { if(comm->me == 0) {
// Open potential file // Open potential file
FILE *fp; FILE *fptr;
char line[MAXLINE]; char line[MAXLINE];
char nextline[MAXLINE]; char nextline[MAXLINE];
fp = force->open_potential(filename); fptr = force->open_potential(filename);
if (fp == NULL) { if (fptr == NULL) {
char str[128]; char str[128];
sprintf(str,"Cannot open EAM potential file %s", filename); sprintf(str,"Cannot open EAM potential file %s", filename);
error->one(FLERR,str); error->one(FLERR,str);
...@@ -468,7 +468,7 @@ void PairCDEAM::read_h_coeff(char *filename) ...@@ -468,7 +468,7 @@ void PairCDEAM::read_h_coeff(char *filename)
// h coefficients are stored at the end of the file. // h coefficients are stored at the end of the file.
// Skip to last line of file. // Skip to last line of file.
while(fgets(nextline, MAXLINE, fp) != NULL) { while(fgets(nextline, MAXLINE, fptr) != NULL) {
strcpy(line, nextline); strcpy(line, nextline);
} }
char* ptr = strtok(line, " \t\n\r\f"); char* ptr = strtok(line, " \t\n\r\f");
...@@ -483,7 +483,7 @@ void PairCDEAM::read_h_coeff(char *filename) ...@@ -483,7 +483,7 @@ void PairCDEAM::read_h_coeff(char *filename)
error->one(FLERR,"Failed to read h(x) function coefficients from EAM file."); error->one(FLERR,"Failed to read h(x) function coefficients from EAM file.");
// Close the potential file. // Close the potential file.
fclose(fp); fclose(fptr);
} }
MPI_Bcast(&nhcoeff, 1, MPI_INT, 0, world); MPI_Bcast(&nhcoeff, 1, MPI_INT, 0, world);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment