diff options
author | dholland <dholland> | 2011-09-12 06:33:11 +0000 |
---|---|---|
committer | dholland <dholland> | 2011-09-12 06:33:11 +0000 |
commit | 7b43df17dc64de36a1d23310eed8d8ae96888185 (patch) | |
tree | 13a3255c5bf87f1cb6503589457f5af8a0afb55d /audio/mp3check/patches | |
parent | 6c36aec056227c77d41e7a5052a828bb096e87a1 (diff) | |
download | pkgsrc-7b43df17dc64de36a1d23310eed8d8ae96888185.tar.gz |
Tweak the C++ to hopefully appease clang.
Diffstat (limited to 'audio/mp3check/patches')
-rw-r--r-- | audio/mp3check/patches/patch-tmap_h | 15 | ||||
-rw-r--r-- | audio/mp3check/patches/patch-tvector_h | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/audio/mp3check/patches/patch-tmap_h b/audio/mp3check/patches/patch-tmap_h new file mode 100644 index 00000000000..99d62e4dcc8 --- /dev/null +++ b/audio/mp3check/patches/patch-tmap_h @@ -0,0 +1,15 @@ +$NetBSD: patch-tmap_h,v 1.1 2011/09/12 06:33:11 dholland Exp $ + +- C++ tweaks to appease clang + +--- tmap.h~ 2006-09-21 21:17:07.000000000 +0000 ++++ tmap.h +@@ -54,7 +54,7 @@ class tmap: public tmap_base<K,T> { + // new functionality + + /// return whether an element with key is contained or not +- bool contains(const K& key) const { return find(key) != tmap_base<K,T>::end(); } ++ bool contains(const K& key) const { return tmap_base<K,T>::find(key) != tmap_base<K,T>::end(); } + /// access element read only (const) + // g++ 2.95.2 does not allow this: + // const T& operator[](const K& key) const { const_iterator i = find(key); if(i != end()) return i->second; else throw TNotFoundException(); } // throw(TNotFoundException) diff --git a/audio/mp3check/patches/patch-tvector_h b/audio/mp3check/patches/patch-tvector_h new file mode 100644 index 00000000000..5797a35c8d9 --- /dev/null +++ b/audio/mp3check/patches/patch-tvector_h @@ -0,0 +1,15 @@ +$NetBSD: patch-tvector_h,v 1.1 2011/09/12 06:33:11 dholland Exp $ + +- C++ tweaks to appease clang + +--- tvector.h~ 2006-09-21 21:17:07.000000000 +0000 ++++ tvector.h +@@ -60,7 +60,7 @@ class tvector: public tvector_base<T> { + /// append an element to the end + const tvector& operator += (const T& a) { push_back(a); return *this; } + /// append another tvector to the end +- const tvector& operator += (const tvector& a) { insert(tvector_base<T>::end(), a.tvector_base<T>::begin(), a.tvector_base<T>::end()); return *this; } ++ const tvector& operator += (const tvector& a) { tvector_base<T>::insert(tvector_base<T>::end(), a.tvector_base<T>::begin(), a.tvector_base<T>::end()); return *this; } + /// direct read only access, safe + const T& operator[](size_t i) const { if(i < tvector_base<T>::size()) return tvector_base<T>::operator[](i); else throw TZeroBasedIndexOutOfRangeException(i, tvector_base<T>::size()); } // throw(TZeroBasedIndexOutOfRangeException); + /// direct read/write access, automatically create new elements |