From 8f5728f325f260303072c8c97ec4b35f6bf07aa1 Mon Sep 17 00:00:00 2001
From: Luke Wagner <luke@mozilla.com>
Date: Wed, 15 Aug 2012 18:23:05 -0700
Subject: [PATCH] Fix compiler warnings in js/src (no bug,r=themaid)

--HG--
extra : rebase_source : bce94f0cc69b5eb7e5289688d720c6f65e742ac9
---
 js/src/jsapi-tests/testOps.cpp |  4 ++--
 js/src/vm/SPSProfiler.cpp      | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/js/src/jsapi-tests/testOps.cpp b/js/src/jsapi-tests/testOps.cpp
index 63d57c0be4496..648493be1df08 100644
--- a/js/src/jsapi-tests/testOps.cpp
+++ b/js/src/jsapi-tests/testOps.cpp
@@ -44,8 +44,8 @@ createMyObject(JSContext* context, unsigned argc, jsval *vp)
 
 static JSFunctionSpec s_functions[] =
 {
-    { "createMyObject", createMyObject, 0 },
-    { 0,0,0,0 }
+    JS_FN("createMyObject", createMyObject, 0, 0),
+    JS_FS_END
 };
 
 BEGIN_TEST(testOps_bug559006)
diff --git a/js/src/vm/SPSProfiler.cpp b/js/src/vm/SPSProfiler.cpp
index b000edd0b20d8..28004564b38af 100644
--- a/js/src/vm/SPSProfiler.cpp
+++ b/js/src/vm/SPSProfiler.cpp
@@ -229,14 +229,14 @@ SPSProfiler::ipToPC(JSScript *script, size_t ip)
     JMScriptInfo *info = ptr->value;
 
     /* First check if this ip is in any of the ICs compiled for the script */
-    for (int i = 0; i < info->ics.length(); i++) {
+    for (unsigned i = 0; i < info->ics.length(); i++) {
         ICInfo &ic = info->ics[i];
         if (ic.base <= ip && ip < ic.base + ic.size)
             return ic.pc;
     }
 
     /* Otherwise if it's not in any of the chunks, then we can't find it */
-    for (int i = 0; i < info->chunks.length(); i++) {
+    for (unsigned i = 0; i < info->chunks.length(); i++) {
         jsbytecode *pc = info->chunks[i].convert(script, ip);
         if (pc != NULL)
             return pc;
@@ -296,7 +296,7 @@ SPSProfiler::registerMJITCode(mjit::JITChunk *chunk,
      * the corresponding script for that frame.
      */
     mjit::PCLengthEntry *pcLengths = chunk->pcLengths + outerFrame->script->length;
-    for (int i = 0; i < chunk->nInlineFrames; i++) {
+    for (unsigned i = 0; i < chunk->nInlineFrames; i++) {
         JMChunkInfo *child = registerScript(inlineFrames[i], pcLengths, chunk);
         if (!child)
             return false;
@@ -361,7 +361,7 @@ SPSProfiler::discardMJITCode(mjit::JITScript *jscr,
         return;
 
     unregisterScript(jscr->script, chunk);
-    for (int i = 0; i < chunk->nInlineFrames; i++)
+    for (unsigned i = 0; i < chunk->nInlineFrames; i++)
         unregisterScript(chunk->inlineFrames()[i].fun->script(), chunk);
 }
 
@@ -372,7 +372,7 @@ SPSProfiler::unregisterScript(JSScript *script, mjit::JITChunk *chunk)
     if (!ptr)
         return;
     JMScriptInfo *info = ptr->value;
-    for (int i = 0; i < info->chunks.length(); i++) {
+    for (unsigned i = 0; i < info->chunks.length(); i++) {
         if (info->chunks[i].chunk == chunk) {
             info->chunks.erase(&info->chunks[i]);
             break;
-- 
GitLab