use const char * instead of char * so we don't need a cast for string constants
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user