From 59ca559428ff3e39429c038cdb31be9ac6324ddd Mon Sep 17 00:00:00 2001 From: allen Date: Sat, 7 Jun 2003 15:37:39 +0000 Subject: Change labelling of error messages for problems with parameter files to avoid confusion with standard warning levels. Tidied errors to handle the difference between 1 or more errors with better grammar. Fixes Cactus/1500 git-svn-id: http://svn.cactuscode.org/flesh/trunk@3236 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/main/SetParams.c | 76 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 20 deletions(-) (limited to 'src/main/SetParams.c') diff --git a/src/main/SetParams.c b/src/main/SetParams.c index 990b6763..0df71576 100644 --- a/src/main/SetParams.c +++ b/src/main/SetParams.c @@ -104,52 +104,70 @@ int CCTKi_SetParameter (const char *parameter, const char *value, int lineno) if (retval == -1) { CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", - "In parameter file '%s' line %d: Range error setting parameter " + "Major error in parameter file '%s' line %d: " + "Range error setting parameter " "'%s' to '%s'", parfile, lineno, parameter, value); num_0errors++; } else if (retval == -2) { /* Parameter not defined in thorn */ - CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", - "In parameter file '%s' line %d: Parameter '%s' not found", - parfile, lineno, parameter); if (parameter_check == CCTK_PARAMETER_RELAXED) { + CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", + "Minor error in parameter file '%s' line %d: " + "Parameter '%s' not found", + parfile, lineno, parameter); num_1errors++; } else { + CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", + "Major error in parameter file '%s' line %d: " + "Parameter '%s' not found", + parfile, lineno, parameter); num_0errors++; } } else if (retval == -4) { /* Setting parameter twice */ - CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", - "In parameter file '%s' line %d: Parameter '%s' set in two " - "different thorns", parfile, lineno, parameter); if (parameter_check == CCTK_PARAMETER_RELAXED) { + CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", + "Minor error in parameter file '%s' line %d: " + "Parameter '%s' set in two " + "different thorns", parfile, lineno, parameter); num_1errors++; } else { + CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", + "Major error in parameter file '%s' line %d: " + "Parameter '%s' set in two " + "different thorns", parfile, lineno, parameter); num_0errors++; } } else if (retval == -5) { /* Parameter not defined by any active thorn */ - CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", - "In parameter file '%s' line %d: Parameter '%s' is not " - "associated with an active thorn", parfile, lineno, parameter); if (parameter_check == CCTK_PARAMETER_STRICT) { + CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", + "Major error in parameter file '%s' line %d: " + "Parameter '%s' is not " + "associated with an active thorn", + parfile, lineno, parameter); num_0errors++; } else if (parameter_check == CCTK_PARAMETER_NORMAL) { + CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", + "Minor error in parameter file '%s' line %d: " + "Parameter '%s' is not " + "associated with an active thorn", + parfile, lineno, parameter); num_1errors++; } } @@ -157,37 +175,53 @@ int CCTKi_SetParameter (const char *parameter, const char *value, int lineno) { /* Parameter value is not a valid number */ CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", - "In parameter file '%s' line %d: Error setting parameter '%s' " - "'%s' is not a valid number", parfile, lineno, parameter, value); + "Major error in parameter file '%s' line %d: " + "Error setting parameter '%s' " + "'%s' is not a valid number", + parfile, lineno, parameter, value); num_0errors++; } else if (retval == -7) { /* Tried to set an accumulator parameter directly */ - CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", - "In parameter file '%s' line %d: Parameter '%s' is an " - "accumulator parameter; it cannot be set directly", parfile, lineno, parameter); if (parameter_check == CCTK_PARAMETER_STRICT) { + CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", + "Major error in parameter file '%s' line %d: " + "Parameter '%s' is an " + "accumulator parameter; it cannot be set directly", + parfile, lineno, parameter); num_0errors++; } else if (parameter_check == CCTK_PARAMETER_NORMAL) { + CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", + "Minor error in parameter file '%s' line %d: " + "Parameter '%s' is an " + "accumulator parameter; it cannot be set directly", + parfile, lineno, parameter); num_1errors++; } } else if (retval == -8) { /* Tried to set an array base parameter */ - CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", - "In parameter file '%s' line %d: Parameter '%s' is an " - "array base parameter; please use %s[]", parfile, lineno, parameter, parameter); if (parameter_check == CCTK_PARAMETER_STRICT) { + CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", + "Major error in parameter file '%s' line %d: " + "Parameter '%s' is an " + "array base parameter; please use %s[]", + parfile, lineno, parameter, parameter); num_0errors++; } else if (parameter_check == CCTK_PARAMETER_NORMAL) { + CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", + "Minor error in parameter file '%s' line %d: " + "Parameter '%s' is an " + "array base parameter; please use %s[]", + parfile, lineno, parameter, parameter); num_1errors++; } } @@ -195,8 +229,10 @@ int CCTKi_SetParameter (const char *parameter, const char *value, int lineno) { /* Parameter adds to an accumulator and that value would be out of range. */ CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", - "In parameter file '%s' line %d: Range error setting parameter " - "'%s' to '%s' - out of range in accumulator", parfile, lineno, parameter, value); + "Major error in parameter file '%s' line %d: " + "Range error setting parameter " + "'%s' to '%s' - out of range in accumulator", + parfile, lineno, parameter, value); num_0errors++; } -- cgit v1.2.3