Fix warnings and Clang compile errors, bug 707049. r=waldo

This commit is contained in:
Brian Hackett 2011-12-31 12:39:05 -07:00
parent a15d982fcf
commit 2f65561f2b
4 changed files with 9 additions and 11 deletions

View File

@ -1479,9 +1479,6 @@ class AutoGCRooter {
* fix than when relying on a separate rooting analysis.
*/
template <typename T>
struct RootMethods { };
template <> struct RootMethods<const jsid>
{
static jsid initial() { return JSID_VOID; }

View File

@ -295,6 +295,9 @@ enum ThingRootKind
template <typename T> class Root;
template <typename T> class RootedVar;
template <typename T>
struct RootMethods { };
/*
* Reference to a stack location rooted for GC. See "Moving GC Stack Rooting"
* comment in jscntxt.h.
@ -325,8 +328,8 @@ class Handle
template <typename S>
void testAssign() {
#ifdef DEBUG
T a;
S b;
T a = RootMethods<T>::initial();
S b = RootMethods<S>::initial();
a = b;
#endif
}

View File

@ -1273,8 +1273,8 @@ StackBaseShape::match(UnownedBaseShape *key, const StackBaseShape *lookup)
return key->flags == lookup->flags
&& key->clasp == lookup->clasp
&& key->parent == lookup->parent
&& (void *) key->rawGetter == lookup->rawGetter
&& (void *) key->rawSetter == lookup->rawSetter;
&& key->rawGetter == lookup->rawGetter
&& key->rawSetter == lookup->rawSetter;
}
/* Root for stack allocated base shapes. */

View File

@ -57,6 +57,7 @@
#include "jspropertytree.h"
#include "js/HashTable.h"
#include "mozilla/Attributes.h"
#ifdef _MSC_VER
#pragma warning(push)
@ -708,10 +709,7 @@ struct Shape : public js::gc::Cell
Shape(UnownedBaseShape *base, uint32_t nfixed);
/* Copy constructor disabled, to avoid misuse of the above form. */
Shape(const Shape &other);
/* Not defined: Shapes must not be stack allocated. */
~Shape();
Shape(const Shape &other) MOZ_DELETE;
/*
* Whether this shape has a valid slot value. This may be true even if