diff options
Diffstat (limited to 'src/Output.c')
-rw-r--r-- | src/Output.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/Output.c b/src/Output.c index 1f2c8ff..144a74f 100644 --- a/src/Output.c +++ b/src/Output.c @@ -14,6 +14,7 @@ #include "cctk.h" #include "cctk_Parameters.h" #include "util_String.h" +#include "CactusBase/IOUtil/src/ioutil_Utils.h" #include "ioJpegGH.h" /* the rcs ID and its dummy function to use it */ @@ -262,7 +263,7 @@ static void CheckSteerableParameters (ioJpegGH *myGH) if (strcmp (out_vars, myGH->out_vars) || myGH->out_every_default != i) { num_vars = CCTK_NumVars (); - memset (myGH->out_every, 0, num_vars * sizeof (int)); + memset (myGH->out_every, 0, num_vars * sizeof (CCTK_INT)); CCTK_TraverseString (out_vars, SetOutputFlag, myGH, CCTK_GROUP_OR_VAR); if (myGH->out_every_default == i || ! CCTK_Equals (verbose, "none")) @@ -270,7 +271,7 @@ static void CheckSteerableParameters (ioJpegGH *myGH) msg = NULL; for (i = 0; i < num_vars; i++) { - if (myGH->out_every[i]) + if (myGH->out_every[i] > 0) { fullname = CCTK_FullName (i); if (! msg) @@ -342,27 +343,18 @@ static int CheckOutputVar (int vindex) for the given variable */ static void SetOutputFlag (int vindex, const char *optstring, void *arg) { - char *endptr; const ioJpegGH *myGH = (const ioJpegGH *) arg; if (CheckOutputVar (vindex) == 0) { myGH->out_every[vindex] = myGH->out_every_default; + if (optstring) { - endptr = "error"; - if (strncmp ("out_every=", optstring, 10) == 0) - { - myGH->out_every[vindex] = strtol (optstring + 10, &endptr, 10); - } - if (endptr && *endptr) - { - CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, - "SetOutputFlag: Optional string '%s' could not be parsed", - optstring); - myGH->out_every[vindex] = 0; - } + IOUtil_ParseOutputFrequency (CCTK_THORNSTRING, "IOJpeg::out_vars", + vindex, optstring, + &myGH->out_every[vindex]); } } } |