Fix compiler warnings in js/src (no bug,r=themaid)
authorLuke Wagner <luke@mozilla.com>
Wed, 15 Aug 2012 18:23:05 -0700
changeset 108510 36a8ff6ae00354fe4758e8cbd5a56230651f63f5
parent 108509 abc8c217f0322a277430e02f5746836505206df8
child 108511 bc01b7e45d032dd61cd749a401bdd9ea19f7396a
push id214
push userakeybl@mozilla.com
push dateWed, 14 Nov 2012 20:38:59 +0000
treeherdermozilla-release@c8b08ec8e1aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersthemaid
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Fix compiler warnings in js/src (no bug,r=themaid)
js/src/jsapi-tests/testOps.cpp
js/src/vm/SPSProfiler.cpp
--- a/js/src/jsapi-tests/testOps.cpp
+++ b/js/src/jsapi-tests/testOps.cpp
@@ -39,18 +39,18 @@ createMyObject(JSContext* context, unsig
 
     JS_EndRequest(context);
 
     return JS_TRUE;
 }
 
 static JSFunctionSpec s_functions[] =
 {
-    { "createMyObject", createMyObject, 0 },
-    { 0,0,0,0 }
+    JS_FN("createMyObject", createMyObject, 0, 0),
+    JS_FS_END
 };
 
 BEGIN_TEST(testOps_bug559006)
 {
     CHECK(JS_DefineFunctions(cx, global, s_functions));
 
     EXEC("function main() { while(1) return 0 + createMyObject(); }");
 
--- a/js/src/vm/SPSProfiler.cpp
+++ b/js/src/vm/SPSProfiler.cpp
@@ -224,24 +224,24 @@ SPSProfiler::ipToPC(JSScript *script, si
 {
     JS_ASSERT(jminfo.initialized());
     JITInfoMap::Ptr ptr = jminfo.lookup(script);
     if (!ptr)
         return NULL;
     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;
     }
 
     return NULL;
 }
 
@@ -291,17 +291,17 @@ SPSProfiler::registerMJITCode(mjit::JITC
      *
      *    [ outerFrame info ] [ inline frame 1 ] [ inline frame 2 ] ...
      *
      * This local pcLengths pointer tracks the position of each inline frame's
      * pcLengths array. Each section of the array has length script->length for
      * 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;
         /*
          * When JM tells us about new code, each inline ActiveFrame only has the
          * start/end listed relative to the start of the main instruction
          * streams. This is corrected here so the addresses listed on the
          * JMChunkInfo structure are absolute and can be tested directly.
@@ -356,28 +356,28 @@ SPSProfiler::registerICCode(mjit::JITChu
 void
 SPSProfiler::discardMJITCode(mjit::JITScript *jscr,
                              mjit::JITChunk *chunk, void* address)
 {
     if (!jminfo.initialized())
         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);
 }
 
 void
 SPSProfiler::unregisterScript(JSScript *script, mjit::JITChunk *chunk)
 {
     JITInfoMap::Ptr ptr = jminfo.lookup(script);
     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;
         }
     }
     if (info->chunks.length() == 0) {
         jminfo.remove(ptr);
         rt->delete_(info);