diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-11-05 15:45:53 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-11-05 15:45:53 +0000 |
commit | 570aca970ee267cab8f59553b38a066aa2d948d6 (patch) | |
tree | 82c78a302e0c26360530201df00ad66e05521729 /src/patch | |
parent | fce52ffe3b32b17e99a26e5984912621f2425def (diff) |
change to the "enum hack" for in-class static constants
because some systems don't grok them properly (linker errors )
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@885 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/patch')
-rw-r--r-- | src/patch/coords.hh | 15 | ||||
-rw-r--r-- | src/patch/ghost_zone.hh | 8 | ||||
-rw-r--r-- | src/patch/grid.hh | 12 | ||||
-rw-r--r-- | src/patch/patch.hh | 5 |
4 files changed, 24 insertions, 16 deletions
diff --git a/src/patch/coords.hh b/src/patch/coords.hh index f3fd94a..8c16f5b 100644 --- a/src/patch/coords.hh +++ b/src/patch/coords.hh @@ -221,13 +221,14 @@ namespace local_coords typedef int coords_set; -static const int coords_set_mu = 0x1; -static const int coords_set_nu = 0x2; -static const int coords_set_phi = 0x4; - -static const int coords_set_empty = 0x0; -static const int coords_set_all - = coords_set_mu | coords_set_nu | coords_set_phi; +enum { + coords_set_mu = 0x1, + coords_set_nu = 0x2, + coords_set_phi = 0x4, + + coords_set_empty = 0x0, + coords_set_all = coords_set_mu | coords_set_nu | coords_set_phi // no comma + }; // human-readable coordinate names for debugging etc const char* name_of_coords_set(coords_set S); diff --git a/src/patch/ghost_zone.hh b/src/patch/ghost_zone.hh index ba641de..6402a4b 100644 --- a/src/patch/ghost_zone.hh +++ b/src/patch/ghost_zone.hh @@ -392,8 +392,12 @@ public: // protected: // ... values for is_interpatch_in constructor argument - static const bool ghost_zone_is_symmetry = false; - static const bool ghost_zone_is_interpatch = true; + // FIXME: these should really be bool, but then we couldn't + // use the "enum hack" for in-class constants + enum { + ghost_zone_is_symmetry = false, + ghost_zone_is_interpatch = true // no comma + }; // constructor // ... only used in implementing our derived classes; diff --git a/src/patch/grid.hh b/src/patch/grid.hh index d6d1e4b..eebfbd5 100644 --- a/src/patch/grid.hh +++ b/src/patch/grid.hh @@ -83,17 +83,19 @@ public: // in this class. Is there a cleaner solution? // there are precisely this many possible sides - static const int N_sides = 4; + enum { N_sides = 4 }; // we specify {min,max} with a Boolean want_min // ... values for want_min - static const bool side_is_min = true; - static const bool side_is_max = false; + // FIXME: these should really be bool, but then we couldn't + // use the "enum hack" for in-class constants + enum { side_is_min = true, side_is_max = false }; // we specify {rho,sigma} with a Boolean want_rho // ... values for wanr_rho - static const bool side_is_rho = true; - static const bool side_is_sigma = false; + // FIXME: these should really be bool, but then we couldn't + // use the "enum hack" for in-class constants + enum { side_is_rho = true, side_is_sigma = false }; // human-readable names for the sides (for debugging) static const char* minmax_name(bool minmax) diff --git a/src/patch/patch.hh b/src/patch/patch.hh index 07958eb..25a71a8 100644 --- a/src/patch/patch.hh +++ b/src/patch/patch.hh @@ -151,8 +151,9 @@ public: // are we a +[xyz] or -[xyz] patch? bool is_plus() const { return is_plus_; } // ... values for the is_plus_in constructor argument - static const bool patch_is_plus = true; - static const bool patch_is_minus = false; + // FIXME: these should really be bool, but then we couldn't + // use the "enum hack" for in-class constants + enum { patch_is_plus = true, patch_is_minus = false }; // are we a (+/-) x or y or z patch? // ... n.b. type is `char' because this is handy for both |