#1538: Turn CCTK_REAL8 etc. into typedefs -------------------------+-------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: new Priority: minor | Milestone: Component: Cactus | Version: development version Keywords: | -------------------------+-------------------------------------------------- Currently, CCTK_REAL8 are #defines. This is inconvenient, since e.g. CCTK_REAL16 may be "long double", and the C++ syntax {{{ CCTK_REAL16(x) }}} is then illegal, since this expands to "long double(x)". Turning CCTK_REAL8 and friends into proper typedefs remedies this.
The attached patch also corrects two small issues in cctk_Types.h: (1) The include guard around "cctk_Config.h" should not be there, and (2) some #endifs have wrong comments.
#1538: Turn CCTK_REAL8 etc. into typedefs --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: review Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+------------------------------------------------- Changes (by eschnett):
* status: new => review
#1538: Turn CCTK_REAL8 etc. into typedefs --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: reviewed_ok Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+------------------------------------------------- Changes (by rhaas):
* status: review => reviewed_ok
Comment:
The typedefs look fine. Did you also fix an issue with the last #endif in the file not really being include guard but the one belonging to HAVE_CCTK_C_ATTRIBUTE_UNUSED? That had me initially confused reviewing the patch.
#1538: Turn CCTK_REAL8 etc. into typedefs --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: reviewed_ok Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+-------------------------------------------------
Comment (by rhaas):
Hmm. Fails to compile after I applied the patch. {{{ /mnt/data/rhaas/postdoc/gr/Zelmani/src/include/cctk_Types.h:96:1: error: unknown type name 'CCTK_INT1_TYPE' typedef CCTK_INT1_TYPE CCTK_INT1; ^ }}} I assume a -realclean will fix this but it should not be required I think since we already ask for a -reconfig.
#1538: Turn CCTK_REAL8 etc. into typedefs --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: reviewed_ok Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+-------------------------------------------------
Comment (by eschnett):
Yes, I also corrected a mixup with #endifs in cctk_Types.h.
Did you also regenerate "configure"? I didn't include this into the patch.
#1538: Turn CCTK_REAL8 etc. into typedefs --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: reviewed_ok Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+-------------------------------------------------
Comment (by rhaas):
Yes, I regenerated configure. I would not compile before (lots of errors since the types were not defined). I also found out why you had all those commits change {{{#ifdef CCTK_REAL4}}} to {{{#ifdef HAVE_CCTK_REAL4}}} :-). Since I had not put in the magic words explicitly in the previous review:
Please apply.
#1538: Turn CCTK_REAL8 etc. into typedefs --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: reviewed_ok Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+-------------------------------------------------
Comment (by eschnett):
I thought it didn't compile? Does it work for you now?
#1538: Turn CCTK_REAL8 etc. into typedefs --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: reviewed_ok Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: --------------------------+-------------------------------------------------
Comment (by rhaas):
I had to regenerate configure and updated my comment. However since editing a comment does not trigger an email I guess this was lost to the mailing list.
#1538: Turn CCTK_REAL8 etc. into typedefs --------------------------+------------------------------------------------- Reporter: eschnett | Owner: Type: enhancement | Status: closed Priority: minor | Milestone: Component: Cactus | Version: development version Resolution: fixed | Keywords: --------------------------+------------------------------------------------- Changes (by eschnett):
* status: reviewed_ok => closed * resolution: => fixed
Comment:
Applied.
trac@lists.einsteintoolkit.org