summaryrefslogtreecommitdiff
path: root/src/include/cctk_Types.h
Commit message (Collapse)AuthorAge
* support __unused__ where known. This let's e.g. gcc know that especially the ↵knarf2010-11-23
| | | | | | Cactus variables might be unused and should not be reported as such. This closes ET ticket #1 git-svn-id: http://svn.cactuscode.org/flesh/trunk@4651 17b73243-c579-4c4c-a9d2-2d5706c11dac
* This patch makes complex arithmetic in C and C++ more efficient, andschnetter2007-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | makes it much more convenient for C++, expecially when templates are used. The flesh functions for complex arithmetic are defined (not only declared) by including Complex.c from the header file cctk_Complex.h. They are declared "static inline", so the the compiler can inline them, but does not have to create an out-of-line copy for every source file. Complex.c is also compiled stand-alone without the "static inline" prefix, so that out-of-line copies exist as well. Add some new complex arithmetic functions, e.g. ComplexNeg to change the sign. Make some complex arithmetic functions more efficient by using algorithms from glibc. These algorithms are LGPL. They should be faster and/or more accurate than the existing implementations. For C++, define the usual arithmetic operators (+-*/ etc.) as inline functions calling the corresponding complex arithmetic functions. This makes it possible to use complex numbers in the same way as real numbers, which makes it possible to instantiate templates for both CCTK_REAL and CCTK_COMPLEX. This leads to much code reduction in Carpet. The patch also appends a type postfix to the names of math functions called in the inlined routines: 'f' for HAVE_CCTK_REAL4, nothing for HAVE_CCTK_REAL8, and 'l' for HAVE_CCTK_REAL16. This avoids compiler warnings about conversions from "double" to "float" which may lose significant bits. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4418 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Applies Erik's patch from 06.03.06swhite2006-05-11
| | | | | | | Define HAVE_CCTK_BYTE etc. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4294 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Define macros CCTK_{INT,REAL,COMPLEX}_PRECISION to values of 1, 2, 4, 8, 16,goodale2005-12-13
| | | | | | | | | | | or 32, depending on the definition of the default data types CCTK_{INT,REAL,COMPLEX}. These new macros make type generic code more convenient to write. Patch from Erik Schnetter. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4209 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Undo changes that prevent more unwanted warnings about unused variables.schnetter2005-09-28
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4155 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Introduce macros CCTK_DECLARE and CCTK_DECLARE_INIT which declare orschnetter2005-09-26
| | | | | | | | | | | | | | declare and initialise local variables. They also add the necessary magic to prevent compiler warnings about unused variables. If the compiler supports __attribute__((unused)), then use this. Otherwise, use the existing fallback of taking the variable's address. In Fortran, use the variable's kind as fallback. Use these macros in autogenerated code and in "cctk.h". git-svn-id: http://svn.cactuscode.org/flesh/trunk@4146 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Declare CCTK_CHAR in C a char instead of unsigned char.schnetter2005-01-30
| | | | | | | | | | | 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
* Use new HAVE_CCTK_<datatype> macro names.tradke2004-06-26
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3795 17b73243-c579-4c4c-a9d2-2d5706c11dac
* change #if CCTK_HAVE_REAL16 --> #ifdef CCTK_HAVE_REAL16jthorn2004-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and similarly for other such #if tests, to avoid warnings from icc: /afs/aei-potsdam.mpg.de/u/jthorn/cactus/Cactus/src/include/cctk_Types.h(32): rem ark #193: zero used for undefined preprocessing identifier #if CCTK_HAVE_REAL16 ^ /afs/aei-potsdam.mpg.de/u/jthorn/cactus/Cactus/src/include/cctk_Complex.h(46): r emark #193: zero used for undefined preprocessing identifier #if CCTK_HAVE_REAL16 ^ [N.b. Harbison & Steele: "C: A Reference Manual", section 3.5.1, states that #if undefined_identifier is equivalent to #if 0 , so so long as we define the symbols with nonzero values when we do define them, #if and #ifdef are equivalent here. But #ifdef is cleaner because * it avoids spurious compiler warnings such as the above * it follows the standard convention for feature-test macros (see, for example, the discussion in the first example of Harbison & Steele's section 3.5.3) and so reduces "programmer surprise" for future maintainence programmers] [Note also that this change is orthogonal to the current discussion on the developers mailing list of what the names of these feature-test macros should be.] git-svn-id: http://svn.cactuscode.org/flesh/trunk@3787 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Define CCTK_REAL{8|16|32} fortran datatypes only if the correspondingtradke2004-06-20
| | | | | | | | CCTK_HAVE_REAL{8|16|32} macros are defined. Dito for CCTK_COMPLEX* datattypes. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3776 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Define the type CCTK_FPOINTER also in Fortran.schnetter2004-03-31
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3625 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Define the type CCTK_POINTER_TO_CONST in Fortran as well.schnetter2004-01-19
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3520 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Introduce the new Cactus variable type CCTK_INT1.schnetter2003-10-13
| | | | | | | Extend routines to handle the new type. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3431 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Switch back to a typedef for CCTK_POINTER.tradke2002-11-12
| | | | | | | | Added 'typedef const void *CCTK_POINTER_TO_CONST;' which will be used for function alias arguments. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3030 17b73243-c579-4c4c-a9d2-2d5706c11dac
* As long as we don't have 'typedef const void *CCTK_CONST_POINTER;'tradke2002-11-06
| | | | | | | | | | | | we have CCTK_POINTER as a '#define void *' so that one can add a const qualifier if needed. With '#define CCTK_POINTER void *' you can define a pointer to const data, with 'typedef void *CCTK_POINTER; const CCTK_POINTER p;' you cannot. These will be needed for the declaration of function aliases. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3024 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Executive decision to change CCTK_FN_POINTER -> CCTK_FPOINTER andallen2002-04-28
| | | | | | | | | CCTK_VARIABLE_FN_POINTER -> CCTK_VARIABLE_FPOINTER Old definitions will be removed in next beta release git-svn-id: http://svn.cactuscode.org/flesh/trunk@2769 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Stuff for utility table routines, implemented by Jonathon Thornburg.goodale2001-11-13
| | | | | | | | | Documentation should follow shortly... Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2462 17b73243-c579-4c4c-a9d2-2d5706c11dac
* New Cactus datatype CCTK_BYTE which is an unsigned char in C and an ↵allen2001-02-25
| | | | | | | | | integer*1 in fortran. This replaces CCTK_CHAR which is now deprecated git-svn-id: http://svn.cactuscode.org/flesh/trunk@2064 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Adding a CCTK_STRING data type to be a const char * in Callen2001-02-24
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@2054 17b73243-c579-4c4c-a9d2-2d5706c11dac
* All include files for thorns now have cctk_ then a capital letter (!)allen2000-01-16
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1262 17b73243-c579-4c4c-a9d2-2d5706c11dac