diff options
Diffstat (limited to 'src/WriteGF.c')
-rw-r--r-- | src/WriteGF.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/WriteGF.c b/src/WriteGF.c index e498422..8c7ed8c 100644 --- a/src/WriteGF.c +++ b/src/WriteGF.c @@ -50,14 +50,12 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias) /* first, check if variable has storage assigned */ if (! CCTK_QueryGroupStorageI (GH, CCTK_GroupIndexFromVarI (index))) { - char *msg, *fullname; + char *fullname; fullname = CCTK_FullName (index); - msg = (char *) malloc (200 * sizeof (char) + strlen (fullname)); - sprintf (msg, "No 0D output for '%s' (no storage)", fullname); - CCTK_WARN (2, msg); + CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, + "No 0D output for '%s' (no storage)", fullname); free (fullname); - free (msg); return; } @@ -79,11 +77,8 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias) /* get the reduction handle from the reduction operator */ reduction_handle = CCTK_ReductionHandle (reductions [i].operator); if (reduction_handle < 0) { - char *msg = (char *) malloc (100 + strlen (reductions [i].operator)); - - sprintf (msg, "Invalid reduction operator '%s'", reductions [i].operator); - CCTK_WARN (3, msg); - free (msg); + CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, + "Invalid reduction operator '%s'", reductions [i].operator); continue; } @@ -106,11 +101,8 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias) file = fopen (filename, openmode); if (file == NULL) { - char *msg = (char *) malloc (100 + strlen (filename)); - - sprintf (msg, "Could not open output file '%s'", filename); - CCTK_WARN (3, msg); - free (msg); + CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, + "Could not open output file '%s'", filename); continue; } @@ -130,8 +122,4 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias) } free (filename); - - - } - |