allow const char * argument

This commit is contained in:
Axel Kohlmeyer
2022-08-11 03:45:56 -04:00
parent 91b98484ad
commit 2eb6ff1111
2 changed files with 3 additions and 4 deletions

View File

@ -1891,11 +1891,10 @@ void Atom::add_molecule(int narg, char **arg)
return -1 if does not exist
------------------------------------------------------------------------- */
int Atom::find_molecule(char *id)
int Atom::find_molecule(const char *id)
{
if (id == nullptr) return -1;
int imol;
for (imol = 0; imol < nmolecule; imol++)
for (int imol = 0; imol < nmolecule; imol++)
if (strcmp(id,molecules[imol]->id) == 0) return imol;
return -1;
}

View File

@ -344,7 +344,7 @@ class Atom : protected Pointers {
int shape_consistency(int, double &, double &, double &);
void add_molecule(int, char **);
int find_molecule(char *);
int find_molecule(const char *);
void add_molecule_atom(class Molecule *, int, int, tagint);
void first_reorder();