From 7cb1a39a6b61b5b0b2a0ef137b28496324713e1f Mon Sep 17 00:00:00 2001 From: schnetter Date: Mon, 27 Oct 2003 14:30:19 +0000 Subject: Use different numerical values for the #defined enum-like constants. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3438 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/include/ParameterBindings.h | 16 +++++++++------- src/include/cctk_Groups.h | 22 +++++++++++----------- src/include/cctk_Parameter.h | 35 +++++++++++++++++++---------------- src/main/CommandLine.c | 4 ++-- 4 files changed, 41 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/include/ParameterBindings.h b/src/include/ParameterBindings.h index d0a6d10a..939c6828 100644 --- a/src/include/ParameterBindings.h +++ b/src/include/ParameterBindings.h @@ -44,12 +44,14 @@ void CCTKi_ParameterAccumulatorBase(const char *thorn, } #endif -#define PARAMETER_KEYWORD 1 -#define PARAMETER_STRING 2 -#define PARAMETER_SENTENCE 3 -#define PARAMETER_INT 4 -#define PARAMETER_INTEGER 4 -#define PARAMETER_REAL 5 -#define PARAMETER_BOOLEAN 6 +/* These definitions must be identical to the ones in cctk_Parameter.h */ +#define PARAMETER_FIRST 701 +#define PARAMETER_KEYWORD 701 +#define PARAMETER_STRING 702 +#define PARAMETER_SENTENCE 703 +#define PARAMETER_INT 704 +#define PARAMETER_INTEGER 704 +#define PARAMETER_REAL 705 +#define PARAMETER_BOOLEAN 706 #endif diff --git a/src/include/cctk_Groups.h b/src/include/cctk_Groups.h index 6def107c..2e822a98 100644 --- a/src/include/cctk_Groups.h +++ b/src/include/cctk_Groups.h @@ -111,20 +111,20 @@ int CCTK_GroupTagsTableI(int group); /* Group Types */ -#define CCTK_DISTRIB_CONSTANT 1 -#define CCTK_DISTRIB_DEFAULT 2 +#define CCTK_DISTRIB_CONSTANT 301 +#define CCTK_DISTRIB_DEFAULT 302 -#define CCTK_SCALAR 1 -#define CCTK_GF 2 -#define CCTK_ARRAY 3 +#define CCTK_SCALAR 401 +#define CCTK_GF 402 +#define CCTK_ARRAY 403 -#define CCTK_PRIVATE 1 -#define CCTK_PROTECTED 2 -#define CCTK_PUBLIC 3 +#define CCTK_PRIVATE 501 +#define CCTK_PROTECTED 502 +#define CCTK_PUBLIC 503 /* constants for CCTK_TraverseString() */ -#define CCTK_VAR 1 -#define CCTK_GROUP 2 -#define CCTK_GROUP_OR_VAR 3 +#define CCTK_VAR 601 +#define CCTK_GROUP 602 +#define CCTK_GROUP_OR_VAR 603 #endif /* _CCTK_GROUPS_H_ */ diff --git a/src/include/cctk_Parameter.h b/src/include/cctk_Parameter.h index a380ad95..acc7bfc8 100644 --- a/src/include/cctk_Parameter.h +++ b/src/include/cctk_Parameter.h @@ -20,17 +20,18 @@ */ /* Parameter checking levels */ -#define CCTK_PARAMETER_STRICT 0 -#define CCTK_PARAMETER_NORMAL 1 -#define CCTK_PARAMETER_RELAXED 2 +#define CCTK_PARAMETER_STRICT 800 +#define CCTK_PARAMETER_NORMAL 801 +#define CCTK_PARAMETER_RELAXED 802 -/* these SCOPE* defines are used as flags fo parameter scopes. */ +/* these SCOPE* defines are used as flags for parameter scopes. */ -#define SCOPE_GLOBAL 1 /* parameter is visible everywhere */ -#define SCOPE_RESTRICTED 2 /* parameter is visible for friend thorns only */ -#define SCOPE_PRIVATE 3 /* parameter is visible for parent thorn only */ -#define SCOPE_NOT_GLOBAL 4 /* parameter is not visible everywhere */ -#define SCOPE_ANY 5 /* parameter scope is undefined/arbitrary */ +#define SCOPE_FIRST 901 /* must be the lowest value */ +#define SCOPE_GLOBAL 901 /* parameter is visible everywhere */ +#define SCOPE_RESTRICTED 902 /* parameter is visible for friend thorns only */ +#define SCOPE_PRIVATE 903 /* parameter is visible for parent thorn only */ +#define SCOPE_NOT_GLOBAL 904 /* parameter is not visible everywhere */ +#define SCOPE_ANY 905 /* parameter scope is undefined/arbitrary */ #ifdef NEED_PARAMETER_SCOPE_STRINGS static const char *cctk_parameter_scopes[] = {"GLOBAL", @@ -42,13 +43,15 @@ static const char *cctk_parameter_scopes[] = {"GLOBAL", /* parameter types */ -#define PARAMETER_KEYWORD 1 /* parameter is keyword */ -#define PARAMETER_STRING 2 /* parameter is string */ -#define PARAMETER_SENTENCE 3 /* parameter is sentence */ -#define PARAMETER_INT 4 /* parameter is integer */ -#define PARAMETER_INTEGER 4 /* parameter is integer */ -#define PARAMETER_REAL 5 /* parameter is float */ -#define PARAMETER_BOOLEAN 6 /* parameter is bool */ +/* These definitions must be identical to the ones in ParameterBindings.h */ +#define PARAMETER_FIRST 701 /* must be the lowest value */ +#define PARAMETER_KEYWORD 701 /* parameter is keyword */ +#define PARAMETER_STRING 702 /* parameter is string */ +#define PARAMETER_SENTENCE 703 /* parameter is sentence */ +#define PARAMETER_INT 704 /* parameter is integer */ +#define PARAMETER_INTEGER 704 /* parameter is integer */ +#define PARAMETER_REAL 705 /* parameter is float */ +#define PARAMETER_BOOLEAN 706 /* parameter is bool */ #ifdef NEED_PARAMETER_TYPE_STRINGS static const char *cctk_parameter_type_names[] = {"KEYWORD", diff --git a/src/main/CommandLine.c b/src/main/CommandLine.c index ab3591b5..6436f88c 100644 --- a/src/main/CommandLine.c +++ b/src/main/CommandLine.c @@ -610,9 +610,9 @@ static void CommandLinePrintParameter (const cParamData *properties) } printf ("\n"); printf ("Description: \"%s\"\n", properties->description); - printf ("Type: %s\n", cctk_parameter_type_names[properties->type-1]); + printf ("Type: %s\n", cctk_parameter_type_names[properties->type-PARAMETER_FIRST]); printf ("Default: %s\n", properties->defval); - printf ("Scope: %s\n", cctk_parameter_scopes[properties->scope-1]); + printf ("Scope: %s\n", cctk_parameter_scopes[properties->scope-SCOPE_FIRST]); for (range = properties->range; range; range = range->next) { -- cgit v1.2.3