summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-12-17 09:06:59 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-12-17 09:06:59 +0000
commite55496f1061138ab6f815eff167a28885dc989ca (patch)
treebf57ef67fb3b53fa63b7e427eb6702c813c03c52 /src
parentcf4d073ce0678a98105f40c538c36f56ef7dc0e9 (diff)
Stop if a parameter is given a value not in the range. This needs to
be tidied so that it can be over riden, and so that all the out of range parameters are given before the code stops. git-svn-id: http://svn.cactuscode.org/flesh/trunk@1204 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src')
-rw-r--r--src/main/Parameters.c57
1 files changed, 39 insertions, 18 deletions
diff --git a/src/main/Parameters.c b/src/main/Parameters.c
index a3cff1d6..14e04a22 100644
--- a/src/main/Parameters.c
+++ b/src/main/Parameters.c
@@ -1415,11 +1415,14 @@ static int ParameterSetKeyword(t_param *param, const char *value)
if(retval == -1)
{
- fprintf(stderr,
- "Unable to set keyword %s::%s - %s not in any active range\n",
- param->props->thorn,
+ char *msg;
+ msg = (char *)malloc( 200*sizeof(char) );
+ sprintf(msg,"Unable to set keyword %s::%s - %s not in any active range",
+ param->props->thorn,
param->props->name,
value);
+ CCTK_Warn(0,__LINE__,__FILE__,"Cactus",msg);
+ free(msg);
if(*((char **)param->data) == NULL)
{
fprintf(stderr, "Since this was the default value, setting anyway - please fix!\n");
@@ -1455,11 +1458,14 @@ static int ParameterSetString(t_param *param, const char *value)
if(retval == -1)
{
- fprintf(stderr,
- "Unable to set string %s::%s - %s not in any active range\n",
- param->props->thorn,
+ char *msg;
+ msg = (char *)malloc( 200*sizeof(char) );
+ sprintf(msg,"Unable to set string %s::%s - %s not in any active range",
+ param->props->thorn,
param->props->name,
value);
+ CCTK_Warn(0,__LINE__,__FILE__,"Cactus",msg);
+ free(msg);
if(*((char **)param->data) == NULL)
{
@@ -1497,11 +1503,15 @@ static int ParameterSetSentence(t_param *param, const char *value)
if(retval == -1)
{
- fprintf(stderr,
- "Unable to set sentence %s::%s - %s not in any active range\n",
- param->props->thorn,
+
+ char *msg;
+ msg = (char *)malloc( 200*sizeof(char) );
+ sprintf(msg,"Unable to set sentance %s::%s - %s not in any active range",
+ param->props->thorn,
param->props->name,
value);
+ CCTK_Warn(0,__LINE__,__FILE__,"Cactus",msg);
+ free(msg);
if(*((char **)param->data) == NULL)
{
@@ -1543,11 +1553,15 @@ static int ParameterSetInteger(t_param *param, const char *value)
if(retval == -1)
{
- fprintf(stderr,
- "Unable to set integer %s::%s - %s not in any active range\n",
- param->props->thorn,
+ char *msg;
+ msg = (char *)malloc( 200*sizeof(char) );
+ sprintf(msg,"Unable to set integer %s::%s - %s not in any active range",
+ param->props->thorn,
param->props->name,
value);
+ CCTK_Warn(0,__LINE__,__FILE__,"Cactus",msg);
+ free(msg);
+
}
return retval;
@@ -1598,11 +1612,15 @@ static int ParameterSetReal(t_param *param, const char *value)
if(retval == -1)
{
- fprintf(stderr,
- "Unable to set real %s::%s - %s not in any active range\n",
- param->props->thorn,
+ char *msg;
+ msg = (char *)malloc( 200*sizeof(char) );
+ sprintf(msg,"Unable to set real %s::%s - %s not in any active range",
+ param->props->thorn,
param->props->name,
value);
+ CCTK_Warn(0,__LINE__,__FILE__,"Cactus",msg);
+ free(msg);
+
}
return retval;
@@ -1617,11 +1635,14 @@ static int ParameterSetBoolean(t_param *param, const char *value)
if(retval == -1)
{
- fprintf(stderr,
- "Unable to set boolean %s::%s - %s not recognised\n",
- param->props->thorn,
+ char *msg;
+ msg = (char *)malloc( 200*sizeof(char) );
+ sprintf(msg,"Unable to set boolean %s::%s - %s not recognised",
+ param->props->thorn,
param->props->name,
value);
+ CCTK_Warn(0,__LINE__,__FILE__,"Cactus",msg);
+ free(msg);
}
return retval;