aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-22 23:57:31 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-22 23:57:31 +0000
commite15a567081e6fbc500b91b13b3f71c298e804c05 (patch)
tree8c626b03f47632774ba6a8128e6058eae22b2349
parent3dff7b48a4c922e5606ee09d80130f7e4e4fbcf1 (diff)
downloadpaludis-e15a567081e6fbc500b91b13b3f71c298e804c05.tar.gz
paludis-e15a567081e6fbc500b91b13b3f71c298e804c05.tar.xz
Screw it. This g++-3.4 thing is going to hit us in other less obvious places too. Work around it at a higher level.
-rw-r--r--paludis/counted_ptr.hh8
-rw-r--r--paludis/dep_atom.hh4
-rw-r--r--paludis/match_sequence.cc24
3 files changed, 12 insertions, 24 deletions
diff --git a/paludis/counted_ptr.hh b/paludis/counted_ptr.hh
index 783df2d..5f5c5ad 100644
--- a/paludis/counted_ptr.hh
+++ b/paludis/counted_ptr.hh
@@ -158,22 +158,22 @@ namespace paludis
/**
* Dereference operator (const).
*/
- inline const T_ & operator* () const PALUDIS_ATTRIBUTE((pure));
+ inline const T_ & operator* () const;
/**
* Dereference to member operator (const).
*/
- inline const T_ * operator-> () const PALUDIS_ATTRIBUTE((pure));
+ inline const T_ * operator-> () const;
/**
* Dereference operator (non const).
*/
- T_ & operator* () PALUDIS_ATTRIBUTE((pure));
+ T_ & operator* ();
/**
* Dereference to member operator (non const).
*/
- T_ * operator-> () PALUDIS_ATTRIBUTE((pure));
+ T_ * operator-> ();
/**
* Not null?
diff --git a/paludis/dep_atom.hh b/paludis/dep_atom.hh
index 389bd1b..3cfedf4 100644
--- a/paludis/dep_atom.hh
+++ b/paludis/dep_atom.hh
@@ -76,7 +76,7 @@ namespace paludis
* Return us as a UseDepAtom, or 0 if we are not a
* UseDepAtom.
*/
- virtual const UseDepAtom * as_use_dep_atom() const PALUDIS_ATTRIBUTE((pure));
+ virtual const UseDepAtom * as_use_dep_atom() const;
};
/**
@@ -197,7 +197,7 @@ namespace paludis
return _inverse;
}
- virtual const UseDepAtom * as_use_dep_atom() const PALUDIS_ATTRIBUTE((pure));
+ virtual const UseDepAtom * as_use_dep_atom() const;
};
/**
diff --git a/paludis/match_sequence.cc b/paludis/match_sequence.cc
index 34ff9e9..00e8c40 100644
--- a/paludis/match_sequence.cc
+++ b/paludis/match_sequence.cc
@@ -21,18 +21,6 @@
using namespace paludis;
-/* gcc 3.4 gets things horribly wrong, and thinks that some functions will
- * never return when in fact they will. this is a nasty workaround. */
-#if defined(__GNUC__)
-# if __GNUC__ < 4
-# define BROKEN_COMPILER(x) (x).raw_pointer()
-# else
-# define BROKEN_COMPILER(x) x
-# endif
-#else
-# define BROKEN_COMPILER(x) x
-#endif
-
struct MatchRule::Rule :
InternalCounted<MatchRule::Rule>
{
@@ -75,11 +63,11 @@ struct MatchRule::SequenceRule :
std::string::size_type
local_match(const std::string & t, std::string::size_type p) const
{
- std::string::size_type l1(BROKEN_COMPILER(r1._rule)->local_match(t, p)), l2(0);
+ std::string::size_type l1(r1._rule->local_match(t, p)), l2(0);
if (std::string::npos == l1)
return l1;
- l2 = BROKEN_COMPILER(r2._rule)->local_match(t, p + l1);
+ l2 = r2._rule->local_match(t, p + l1);
return (std::string::npos == l2) ? l2 : l1 + l2;
}
};
@@ -98,10 +86,10 @@ struct MatchRule::EitherRule :
std::string::size_type
local_match(const std::string & t, std::string::size_type p) const
{
- std::string::size_type l1(BROKEN_COMPILER(r1._rule)->local_match(t, p));
+ std::string::size_type l1(r1._rule->local_match(t, p));
if (std::string::npos != l1)
return l1;
- return BROKEN_COMPILER(r2._rule)->local_match(t, p);
+ return r2._rule->local_match(t, p);
}
};
@@ -119,7 +107,7 @@ struct MatchRule::ZeroOrMoreRule :
local_match(const std::string & t, std::string::size_type p) const
{
std::string::size_type result(p), q;
- while (std::string::npos != ((q = BROKEN_COMPILER(r1._rule)->local_match(t, result))))
+ while (std::string::npos != ((q = r1._rule->local_match(t, result))))
result += q;
return result - p;
@@ -182,6 +170,6 @@ MatchRule::operator* () const
bool
MatchRule::match(const std::string & s) const
{
- return (std::string::npos != BROKEN_COMPILER(_rule)->local_match(s, 0));
+ return (std::string::npos != _rule->local_match(s, 0));
}