Fix warnings. rs=jorendorff
authorBlake Kaplan <mrbkap@gmail.com>
Wed, 17 Mar 2010 15:35:06 -0700
changeset 40295 d775e874fb2f9f2ef104caacb9cb328769929695
parent 40294 08f9be1e83150fbb758f8aa71e304fd1e3168ab3
child 40296 20ea2635b1c0c08080ae415d9bb15ad863a0f39d
push id12610
push userrsayre@mozilla.com
push dateMon, 05 Apr 2010 17:26:41 +0000
treeherdermozilla-central@1942c0b4e101 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
milestone1.9.3a3pre
Fix warnings. rs=jorendorff
js/src/jsapi-tests/testNewObject.cpp
--- a/js/src/jsapi-tests/testNewObject.cpp
+++ b/js/src/jsapi-tests/testNewObject.cpp
@@ -1,15 +1,15 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=4 sw=4 et tw=99:
  */
 
 #include "tests.h"
 
-const int N = 1000;
+const size_t N = 1000;
 static jsval argv[N];
 
 static JSBool
 constructHook(JSContext *cx, JSObject *thisobj, uintN argc, jsval *argv, jsval *rval)
 {
     // Check that arguments were passed properly from JS_New.
     JSObject *callee = JSVAL_TO_OBJECT(JS_ARGV_CALLEE(argv));
     if (!thisobj) {
@@ -63,17 +63,17 @@ BEGIN_TEST(testNewObject_1)
     CHECK(obj);
     rt = OBJECT_TO_JSVAL(obj);
     CHECK(JS_IsArrayObject(cx, obj));
     CHECK(JS_GetArrayLength(cx, obj, &len));
     CHECK(len == 4);
 
     // With N arguments.
     JS_ASSERT(INT_FITS_IN_JSVAL(N));
-    for (int i = 0; i < N; i++)
+    for (size_t i = 0; i < N; i++)
         argv[i] = INT_TO_JSVAL(i);
     obj = JS_New(cx, Array, N, argv);
     CHECK(obj);
     rt = OBJECT_TO_JSVAL(obj);
     CHECK(JS_IsArrayObject(cx, obj));
     CHECK(JS_GetArrayLength(cx, obj, &len));
     CHECK(len == N);
     CHECK(JS_GetElement(cx, obj, N - 1, &v));
@@ -92,10 +92,11 @@ BEGIN_TEST(testNewObject_1)
     jsvalRoot rt2(cx, OBJECT_TO_JSVAL(ctor));
     obj = JS_New(cx, ctor, 3, argv);
     CHECK(obj);
     CHECK(obj == ctor);  // constructHook returns ctor, perversely
     CHECK(JS_GetElement(cx, ctor, 0, &v));
     CHECK_SAME(v, JSVAL_ZERO);
     CHECK_SAME(argv[0], JSVAL_ZERO);  // original argv should not have been trashed
     CHECK_SAME(argv[1], JSVAL_ONE);
+    return true;
 }
 END_TEST(testNewObject_1)