Bug 563195: Avoid triggering -Wshadow warnings in mfbt/. r=Waldo
authorNicholas Nethercote <nnethercote@mozilla.com>
Sun, 17 Feb 2013 22:56:32 -0800
changeset 132079 761d4d55680d50700e4aef7ae7419c329d9ec9c6
parent 132078 e0ffe719035b6aba48c9fa79303284a8509d1086
child 132080 43fa20226909036be7d36f1605dc70d0c47dc384
push idunknown
push userunknown
push dateunknown
reviewersWaldo
bugs563195
milestone21.0a1
Bug 563195: Avoid triggering -Wshadow warnings in mfbt/. r=Waldo
mfbt/RangedPtr.h
mfbt/Scoped.h
mfbt/WeakPtr.h
--- a/mfbt/RangedPtr.h
+++ b/mfbt/RangedPtr.h
@@ -49,22 +49,22 @@ class RangedPtr
     typedef void (RangedPtr::* ConvertibleToBool)();
     void nonNull() {}
 
     void checkSanity() {
       MOZ_ASSERT(rangeStart <= ptr);
       MOZ_ASSERT(ptr <= rangeEnd);
     }
 
-    /* Creates a new pointer for |ptr|, restricted to this pointer's range. */
-    RangedPtr<T> create(T *ptr) const {
+    /* Creates a new pointer for |p|, restricted to this pointer's range. */
+    RangedPtr<T> create(T *p) const {
 #ifdef DEBUG
-      return RangedPtr<T>(ptr, rangeStart, rangeEnd);
+      return RangedPtr<T>(p, rangeStart, rangeEnd);
 #else
-      return RangedPtr<T>(ptr, NULL, size_t(0));
+      return RangedPtr<T>(p, NULL, size_t(0));
 #endif
     }
 
     uintptr_t asUintptr() const { return uintptr_t(ptr); }
 
   public:
     RangedPtr(T* p, T* start, T* end)
       : ptr(p)
--- a/mfbt/Scoped.h
+++ b/mfbt/Scoped.h
@@ -75,19 +75,19 @@ class Scoped
   public:
     typedef typename Traits::type Resource;
 
     explicit Scoped(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)
       : value(Traits::empty())
     {
       MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     }
-    explicit Scoped(const Resource& value
+    explicit Scoped(const Resource& v
                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
-      : value(value)
+      : value(v)
     {
       MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     }
     ~Scoped() {
       Traits::release(value);
     }
 
     // Constant getter
--- a/mfbt/WeakPtr.h
+++ b/mfbt/WeakPtr.h
@@ -86,17 +86,17 @@ class SupportsWeakPtr
 
   private:
     friend class WeakPtr<T>;
 
     // This can live beyond the lifetime of the class derived from SupportsWeakPtr.
     class WeakReference : public RefCounted<WeakReference>
     {
       public:
-        explicit WeakReference(T* ptr) : ptr(ptr) {}
+        explicit WeakReference(T* p) : ptr(p) {}
         T* get() const {
           return ptr;
         }
 
       private:
         friend class WeakPtr<T>;
         friend class SupportsWeakPtr<T>;
         void detach() {