diff options
author | tradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a> | 2001-11-05 15:00:23 +0000 |
---|---|---|
committer | tradke <tradke@b32723a9-ab3a-4a60-88e2-2e5d99d7c17a> | 2001-11-05 15:00:23 +0000 |
commit | ecc925d2e5bc7f33289f6f40ca5f911050e8971c (patch) | |
tree | 70d1ed815cc71892e11f932966729865925eff1f /src/CheckpointRecovery.c | |
parent | 18d93aaa1c56d58a6ceb60d225a886ebab4ac014 (diff) |
Added const qualifier to the 'cGH *' argument of some more IO functions.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOUtil/trunk@135 b32723a9-ab3a-4a60-88e2-2e5d99d7c17a
Diffstat (limited to 'src/CheckpointRecovery.c')
-rw-r--r-- | src/CheckpointRecovery.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/CheckpointRecovery.c b/src/CheckpointRecovery.c index b512e50..7328a7f 100644 --- a/src/CheckpointRecovery.c +++ b/src/CheckpointRecovery.c @@ -146,7 +146,7 @@ int IOUtil_RegisterRecover (const char *name, @var GH @vdesc Pointer to CCTK grid hierarchy - @vtype cGH * + @vtype const cGH * @vio in @endvar @var basefilename @@ -177,7 +177,7 @@ int IOUtil_RegisterRecover (const char *name, @vio in @endvar @@*/ -void IOUtil_PrepareFilename (cGH *GH, +void IOUtil_PrepareFilename (const cGH *GH, const char *basefilename, char *fname, int called_from, @@ -597,7 +597,7 @@ int IOUtil_RecoverParameters (int (*recoverFn) (cGH *GH, @var GH @vdesc Pointer to CCTK grid hierarchy - @vtype cGH * + @vtype const cGH * @vio in @endvar @@ -605,7 +605,7 @@ int IOUtil_RecoverParameters (int (*recoverFn) (cGH *GH, @returndesc the allocated string or NULL @endreturndesc @@*/ -char *IOUtil_GetAllParameters (cGH *GH) +char *IOUtil_GetAllParameters (const cGH *GH) { int i, first; char *param; @@ -691,22 +691,23 @@ char *IOUtil_GetAllParameters (cGH *GH) @var parameters @vdesc the parameter string - @vtype char * + @vtype const char * @vio in @endvar @@*/ -void IOUtil_SetAllParameters (char *parameters) +void IOUtil_SetAllParameters (const char *parameters) { DECLARE_CCTK_PARAMETERS char *tmp, *nextparam, *avalue, *param; char oldchar; - char *name, *thorn_impl; + char *name, *thorn_impl, *parameter_string, *free_me; const char *thorn; - while (*parameters) + parameter_string = free_me = strdup (parameters); + while (*parameter_string) { - nextparam = parameters; + nextparam = parameter_string; while (*nextparam != '\n' && *nextparam) { nextparam++; @@ -714,14 +715,14 @@ void IOUtil_SetAllParameters (char *parameters) oldchar = *nextparam; *nextparam = 0; - tmp = parameters; + tmp = parameter_string; while (*tmp != ' ') { tmp++; } *tmp = 0; - param = parameters; + param = parameter_string; avalue = tmp + 3; name = thorn_impl = NULL; @@ -755,12 +756,14 @@ void IOUtil_SetAllParameters (char *parameters) } *nextparam = oldchar; - parameters = nextparam; - if (*parameters == '\n') + parameter_string = nextparam; + if (*parameter_string == '\n') { - parameters++; + parameter_string++; } } + + free (free_me); } |