diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-01-30 11:39:40 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-01-30 11:39:40 +0000 |
commit | 7e35bc81fd1ee761f6f3afde4c72763fc81af82d (patch) | |
tree | 590cc5c2891a0c27f986a47ea8ceec661ec9a4a1 | |
parent | c4b6e6e612c0764a71c2e78beaabb48763f6f813 (diff) |
Declare CCTK_CHAR in C a char instead of unsigned char.
Turn CCTK_STRING from a #define into a typedef.
Do not declare CCTK_CHAR in Fortran, as it does not make sense.
Add some comments.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3975 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r-- | src/include/cctk_Types.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/include/cctk_Types.h b/src/include/cctk_Types.h index af8247fe..8405b3f3 100644 --- a/src/include/cctk_Types.h +++ b/src/include/cctk_Types.h @@ -25,7 +25,9 @@ typedef void *CCTK_POINTER; typedef const void *CCTK_POINTER_TO_CONST; typedef void (*CCTK_FPOINTER)(void); -#define CCTK_STRING const char * +/* Character types */ +typedef char CCTK_CHAR; +typedef const char * CCTK_STRING; /* Structures for complex types */ @@ -56,10 +58,7 @@ typedef struct } CCTK_COMPLEX8; #endif -/* Character type */ -/* DEPRECATED IN BETA 10 */ -typedef unsigned char CCTK_CHAR; - +/* Small positive integer type */ typedef unsigned char CCTK_BYTE; #endif /* CCODE */ @@ -72,7 +71,12 @@ typedef unsigned char CCTK_BYTE; /* TODO: add autoconf for determining the size of function pointers */ #define CCTK_FPOINTER integer*SIZEOF_CHAR_P -#define CCTK_STRING CCTK_POINTER +/* Character types */ +/* A single character does not exist in Fortran; in Fortran, all + character types are strings. Hence we do not define CCTK_CHAR. */ +/* #define CCTK_CHAR CHARACTER */ +/* This is a C-string, i.e., only a pointer */ +#define CCTK_STRING CCTK_POINTER_TO_CONST #ifdef HAVE_CCTK_INT8 #define CCTK_INT8 INTEGER*8 @@ -105,9 +109,7 @@ typedef unsigned char CCTK_BYTE; #define CCTK_COMPLEX8 COMPLEX*8 #endif -/* DEPRECATED IN BETA 10 */ -#define CCTK_CHAR CHARACTER - +/* Should be unsigned, but Fortran doesn't have that */ #define CCTK_BYTE INTEGER*1 #endif /*FCODE */ |