use const char * instead of char * so we don't need a cast for string constants

This commit is contained in:
Axel Kohlmeyer
2020-07-17 00:34:23 -04:00
parent abc9cfe30f
commit 0af7fbe98e
6 changed files with 17 additions and 16 deletions

View File

@ -752,9 +752,9 @@ int Variable::next(int narg, char **arg)
return index or -1 if not found
------------------------------------------------------------------------- */
int Variable::find(char *name)
int Variable::find(const char *name)
{
if(name==NULL) return -1;
if (name == nullptr) return -1;
for (int i = 0; i < nvar; i++)
if (strcmp(name,names[i]) == 0) return i;
return -1;
@ -864,7 +864,7 @@ int Variable::internalstyle(int ivar)
caller must respond
------------------------------------------------------------------------- */
char *Variable::retrieve(char *name)
char *Variable::retrieve(const char *name)
{
int ivar = find(name);
if (ivar < 0) return NULL;