Bug 693469 - Implement mozilla::ArrayLength and mozilla::ArrayEnd, and replace uses of NS_ARRAY_LENGTH whenever possible. (Exceptions: assigning to static initializers, use in static assertions, as template parameters, etc. These will go away when the relevant compilers have C++11 constexpr support.) r=cjones

This commit is contained in:
Jeff Walden
2011-10-10 22:50:08 -07:00
parent 8ce2dc6ecd
commit 7d613942b0
253 changed files with 1546 additions and 733 deletions

View File

@@ -42,6 +42,9 @@
#include "base/basictypes.h"
/* This must occur *after* layers/PLayers.h to avoid typedefs conflicts. */
#include "mozilla/Util.h"
#include "prtypes.h"
#include "prmem.h"
#include "prenv.h"
@@ -1622,7 +1625,7 @@ _evaluate(NPP npp, NPObject* npobj, NPString *script, NPVariant *result)
// Root obj and the rval (below).
jsval vec[] = { OBJECT_TO_JSVAL(obj), JSVAL_NULL };
js::AutoArrayRooter tvr(cx, NS_ARRAY_LENGTH(vec), vec);
js::AutoArrayRooter tvr(cx, ArrayLength(vec), vec);
jsval *rval = &vec[1];
if (result) {