diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-04-08 00:28:08 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-04-08 00:28:08 +0000 |
commit | 51d93f2260a63677402aa1c3b4cb3ccf0e3e2bf1 (patch) | |
tree | 68342b61cfc6ea11d0231fff25310c94475ca858 /src/main | |
parent | 100c54a3acfde8e0c320cca9f7525de619d633a5 (diff) |
Changes to get it compiling on the t3e. A variable of type const char *
can't be assigned to a variable of type char *, 'though a lot of
compilers seem to allow this 8-( The t3e one doesn't.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@455 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/Groups.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/main/Groups.c b/src/main/Groups.c index 11416aed..bb637308 100644 --- a/src/main/Groups.c +++ b/src/main/Groups.c @@ -296,8 +296,10 @@ int CCTK_GetVarNum(const char *implementation, int gnum,group_num; int variable; int fullname = 0; - char *impname; - char *varname; + char *realimpname; + char *realvarname; + const char *impname; + const char *varname; retval = -1; @@ -306,10 +308,16 @@ int CCTK_GetVarNum(const char *implementation, fullname = 1; /* variable_name must be of the form <implementation>::<variable> */ /* FIXME : Error checking */ - CCTK_DecomposeName(variable_name,&impname,&varname); + CCTK_DecomposeName(variable_name,&realimpname,&realvarname); + + /* Store the pointers to these strings in const char *s */ + impname = realimpname; + varname = realvarname; } else { + + /* Can only assign a const char * to a const char * */ impname = implementation; varname = variable_name; } @@ -354,8 +362,9 @@ int CCTK_GetVarNum(const char *implementation, if (fullname) { - free(impname); - free(varname); + /* Had to allocate new strings, so free them. */ + free(realimpname); + free(realvarname); } return retval; |