Warning patrol. No bug, r=themaid

--HG--
extra : rebase_source : 66d872e0ab56b73f1879d1aff9aba1dd3e71e9b3
This commit is contained in:
Jeff Walden 2012-02-15 17:41:59 -08:00
parent 6c9686107d
commit ed8c5375af
2 changed files with 15 additions and 1 deletions

View File

@ -29,8 +29,16 @@
#include "Platform.h"
#include "mozilla/Assertions.h"
#ifndef DEBUG
/*
* Prevent unused-variable warnings by defining the macro WTF uses to test
* for assertions taking effect.
*/
# define ASSERT_DISABLED 1
#endif
#define ASSERT(assertion) MOZ_ASSERT(assertion)
#define ASSERT_UNUSED(variable, assertion) ASSERT(assertion)
#define ASSERT_UNUSED(variable, assertion) (((void)variable), ASSERT(assertion))
#define ASSERT_NOT_REACHED() MOZ_NOT_REACHED("")
#define CRASH() MOZ_Crash()
#define COMPILE_ASSERT(exp, name) MOZ_STATIC_ASSERT(exp, #name)

View File

@ -1860,7 +1860,11 @@ INTERNED_STRING_TO_JSID(JSContext *cx, JSString *str)
jsid id;
JS_ASSERT(str);
JS_ASSERT(((size_t)str & JSID_TYPE_MASK) == 0);
#ifdef DEBUG
JS_ASSERT(JS_StringHasBeenInterned(cx, str));
#else
(void)cx;
#endif
JSID_BITS(id) = (size_t)str;
return id;
}
@ -5314,6 +5318,8 @@ JS_IsConstructing(JSContext *cx, const jsval *vp)
} else {
JS_ASSERT(JS_GetClass(callee)->construct != NULL);
}
#else
(void)cx;
#endif
return JSVAL_IS_MAGIC_IMPL(JSVAL_TO_IMPL(vp[1]));