Bug 837002 - Fix two clang warnings in SpiderMonkey. r=luke.
authorNicholas Nethercote <nnethercote@mozilla.com>
Sun, 03 Feb 2013 19:55:23 -0800
changeset 130589 c966159d269920d0cfb08666b95e9d7337448e74
parent 130588 f24b93663ea95a4252e38be6e4f0cdf7ebe5c211
child 130590 091c55c7215c9b1034594fa2c6b383479f9673d4
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs837002
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 837002 - Fix two clang warnings in SpiderMonkey. r=luke.
js/src/jsfriendapi.cpp
js/src/jsfriendapi.h
js/src/vm/Monitor.h
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -987,15 +987,15 @@ js::SetCTypesActivityCallback(JSRuntime 
 {
     rt->ctypesActivityCallback = cb;
 }
 
 js::AutoCTypesActivityCallback::AutoCTypesActivityCallback(JSContext *cx,
                                                            js::CTypesActivityType beginType,
                                                            js::CTypesActivityType endType
                                                            MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
-  : cx(cx), callback(cx->runtime->ctypesActivityCallback), beginType(beginType), endType(endType)
+  : cx(cx), callback(cx->runtime->ctypesActivityCallback), endType(endType)
 {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 
     if (callback)
         callback(cx, beginType);
 }
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -1383,17 +1383,16 @@ typedef void
  */
 JS_FRIEND_API(void)
 SetCTypesActivityCallback(JSRuntime *rt, CTypesActivityCallback cb);
 
 class JS_FRIEND_API(AutoCTypesActivityCallback) {
   private:
     JSContext *cx;
     CTypesActivityCallback callback;
-    CTypesActivityType beginType;
     CTypesActivityType endType;
     MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
 
   public:
     AutoCTypesActivityCallback(JSContext *cx, CTypesActivityType beginType,
                                CTypesActivityType endType
                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
     ~AutoCTypesActivityCallback() {
--- a/js/src/vm/Monitor.h
+++ b/js/src/vm/Monitor.h
@@ -47,26 +47,30 @@ class Monitor
     }
 
     bool init();
 };
 
 class AutoLockMonitor
 {
   private:
+#ifdef JS_THREADSAFE
     Monitor &monitor;
+#endif
 
   public:
     AutoLockMonitor(Monitor &monitor)
+#ifdef JS_THREADSAFE
       : monitor(monitor)
     {
-#ifdef JS_THREADSAFE
         PR_Lock(monitor.lock_);
+    }
+#else
+    {}
 #endif
-    }
 
     ~AutoLockMonitor() {
 #ifdef JS_THREADSAFE
         PR_Unlock(monitor.lock_);
 #endif
     }
 
     void wait() {
@@ -88,26 +92,30 @@ class AutoLockMonitor
         PR_NotifyAllCondVar(monitor.condVar_);
 #endif
     }
 };
 
 class AutoUnlockMonitor
 {
   private:
+#ifdef JS_THREADSAFE
     Monitor &monitor;
+#endif
 
   public:
     AutoUnlockMonitor(Monitor &monitor)
+#ifdef JS_THREADSAFE
       : monitor(monitor)
     {
-#ifdef JS_THREADSAFE
         PR_Unlock(monitor.lock_);
+    }
+#else
+    {}
 #endif
-    }
 
     ~AutoUnlockMonitor() {
 #ifdef JS_THREADSAFE
         PR_Lock(monitor.lock_);
 #endif
     }
 };