diff --git a/mozilla/js/js2/debugger.cpp b/mozilla/js/js2/debugger.cpp index 3717778ca6e..b33f8bafc2e 100644 --- a/mozilla/js/js2/debugger.cpp +++ b/mozilla/js/js2/debugger.cpp @@ -158,7 +158,7 @@ namespace Debugger { /*NOT_REACHED ("Instruction map is empty, waah.");*/ InstructionMap::iterator pos_iter = - iCode->mInstructionMap->upper_bound (pc - iCode->its_iCode->begin()); + iCode->mInstructionMap->upper_bound (static_cast(pc - iCode->its_iCode->begin())); if (pos_iter != iCode->mInstructionMap->begin()) --pos_iter; diff --git a/mozilla/js/js2/js2.cpp b/mozilla/js/js2/js2.cpp index dfe62f20907..287bf454823 100644 --- a/mozilla/js/js2/js2.cpp +++ b/mozilla/js/js2/js2.cpp @@ -114,7 +114,7 @@ JavaScript::Debugger::Shell jsd(world, stdin, JavaScript::stdOut, JavaScript::stdOut, &ResolveFile); #endif -static JSValue print(Context *cx, const JSValues &argv) +static JSValue print(Context *, const JSValues &argv) { size_t n = argv.size(); if (n > 1) { // the 'this' parameter is un-interesting @@ -126,7 +126,7 @@ static JSValue print(Context *cx, const JSValues &argv) return kUndefinedValue; } -static JSValue dump(Context *cx, const JSValues &argv) +static JSValue dump(Context *, const JSValues &argv) { size_t n = argv.size(); if (n > 1) { // the 'this' parameter is un-interesting diff --git a/mozilla/js/js2/jsclasses.h b/mozilla/js/js2/jsclasses.h index 3aa8edfe300..d10fe44ca2e 100644 --- a/mozilla/js/js2/jsclasses.h +++ b/mozilla/js/js2/jsclasses.h @@ -231,7 +231,7 @@ namespace JSClasses { JSMethods::iterator end = mMethods.end(); for (JSMethods::iterator i = mMethods.begin(); i != end; i++) { if (i->first == name) { - index = i - mMethods.begin(); + index = static_cast(i - mMethods.begin()); return true; } } diff --git a/mozilla/js/js2/jsmath.cpp b/mozilla/js/js2/jsmath.cpp index dd31f362dcb..f624aa4a38f 100644 --- a/mozilla/js/js2/jsmath.cpp +++ b/mozilla/js/js2/jsmath.cpp @@ -99,7 +99,7 @@ using namespace JSTypes; #endif -JSValue math_abs(Context *cx, const JSValues& argv) +static JSValue math_abs(Context *, const JSValues& argv) { if (argv.size() > 0) { JSValue num = argv[1].toNumber(); @@ -112,7 +112,7 @@ JSValue math_abs(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue math_acos(Context *cx, const JSValues& argv) +static JSValue math_acos(Context *, const JSValues& argv) { if (argv.size() > 0) { JSValue num = argv[1].toNumber(); @@ -121,7 +121,7 @@ JSValue math_acos(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue math_asin(Context *cx, const JSValues& argv) +static JSValue math_asin(Context *, const JSValues& argv) { if (argv.size() > 0) { JSValue num = argv[1].toNumber(); @@ -130,7 +130,7 @@ JSValue math_asin(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue math_atan(Context *cx, const JSValues& argv) +static JSValue math_atan(Context *, const JSValues& argv) { if (argv.size() > 0) { JSValue num = argv[1].toNumber(); @@ -139,7 +139,7 @@ JSValue math_atan(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue math_atan2(Context *cx, const JSValues& argv) +static JSValue math_atan2(Context *, const JSValues& argv) { if (argv.size() > 1) { JSValue num1 = argv[1].toNumber(); @@ -149,7 +149,7 @@ JSValue math_atan2(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue math_ceil(Context *cx, const JSValues& argv) +static JSValue math_ceil(Context *, const JSValues& argv) { if (argv.size() > 0) { JSValue num = argv[1].toNumber(); @@ -167,7 +167,7 @@ struct MathFunctionEntry { { "asin", math_asin }, { "atan", math_atan }, { "atan2", math_atan2 }, - { "ceil", math_acos }, + { "ceil", math_ceil }, { "acos", math_acos }, { "acos", math_acos } }; diff --git a/mozilla/js/js2/jstypes.cpp b/mozilla/js/js2/jstypes.cpp index 318d51ab4e2..8a9b99dd6c3 100644 --- a/mozilla/js/js2/jstypes.cpp +++ b/mozilla/js/js2/jstypes.cpp @@ -45,7 +45,7 @@ using namespace Interpreter; /********** Object Object Stuff **************************/ -JSValue object_toString(Context *cx, const JSValues& argv) +static JSValue object_toString(Context *, const JSValues& argv) { if (argv.size() > 0) { JSString *s = new JSString("[object "); @@ -58,7 +58,7 @@ JSValue object_toString(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue objectConstructor(Context *cx, const JSValues& argv) +static JSValue objectConstructor(Context *, const JSValues& argv) { ASSERT(argv.size() > 0); JSValue theThis = argv[0]; @@ -108,13 +108,13 @@ void JSObject::initObjectObject(JSScope *g) /********** Function Object Stuff **************************/ // An empty function that returns undefined -JSValue functionPrototypeFunction(Context *cx, const JSValues& argv) +static JSValue functionPrototypeFunction(Context *, const JSValues &) { return kUndefinedValue; } -JSValue function_constructor(Context *cx, const JSValues& argv) +static JSValue function_constructor(Context *cx, const JSValues& argv) { // build a function from the arguments into the this. ASSERT(argv.size() > 0); @@ -129,16 +129,16 @@ JSValue function_constructor(Context *cx, const JSValues& argv) return theThis; } -JSValue function_toString(Context *cx, const JSValues& argv) +static JSValue function_toString(Context *, const JSValues &) { return JSValue(new JSString("function XXX() { }" )); } -JSValue function_apply(Context *cx, const JSValues& argv) +static JSValue function_apply(Context *, const JSValues &) { // XXX return kUndefinedValue; } -JSValue function_call(Context *cx, const JSValues& argv) +static JSValue function_call(Context *, const JSValues &) { // XXX return kUndefinedValue; diff --git a/mozilla/js/js2/jstypes.h b/mozilla/js/js2/jstypes.h index b14c9a68c39..798b46fc01d 100644 --- a/mozilla/js/js2/jstypes.h +++ b/mozilla/js/js2/jstypes.h @@ -420,7 +420,7 @@ namespace JSTypes { typedef gc_allocator allocator; public: - static void JSFunction::initFunctionObject(JSScope *g); + static void initFunctionObject(JSScope *g); JSFunction(ICodeModule* iCode) : JSObject(FunctionPrototypeObject), diff --git a/mozilla/js2/src/debugger.cpp b/mozilla/js2/src/debugger.cpp index 3717778ca6e..b33f8bafc2e 100644 --- a/mozilla/js2/src/debugger.cpp +++ b/mozilla/js2/src/debugger.cpp @@ -158,7 +158,7 @@ namespace Debugger { /*NOT_REACHED ("Instruction map is empty, waah.");*/ InstructionMap::iterator pos_iter = - iCode->mInstructionMap->upper_bound (pc - iCode->its_iCode->begin()); + iCode->mInstructionMap->upper_bound (static_cast(pc - iCode->its_iCode->begin())); if (pos_iter != iCode->mInstructionMap->begin()) --pos_iter; diff --git a/mozilla/js2/src/jsclasses.h b/mozilla/js2/src/jsclasses.h index 3aa8edfe300..d10fe44ca2e 100644 --- a/mozilla/js2/src/jsclasses.h +++ b/mozilla/js2/src/jsclasses.h @@ -231,7 +231,7 @@ namespace JSClasses { JSMethods::iterator end = mMethods.end(); for (JSMethods::iterator i = mMethods.begin(); i != end; i++) { if (i->first == name) { - index = i - mMethods.begin(); + index = static_cast(i - mMethods.begin()); return true; } } diff --git a/mozilla/js2/src/jsmath.cpp b/mozilla/js2/src/jsmath.cpp index dd31f362dcb..f624aa4a38f 100644 --- a/mozilla/js2/src/jsmath.cpp +++ b/mozilla/js2/src/jsmath.cpp @@ -99,7 +99,7 @@ using namespace JSTypes; #endif -JSValue math_abs(Context *cx, const JSValues& argv) +static JSValue math_abs(Context *, const JSValues& argv) { if (argv.size() > 0) { JSValue num = argv[1].toNumber(); @@ -112,7 +112,7 @@ JSValue math_abs(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue math_acos(Context *cx, const JSValues& argv) +static JSValue math_acos(Context *, const JSValues& argv) { if (argv.size() > 0) { JSValue num = argv[1].toNumber(); @@ -121,7 +121,7 @@ JSValue math_acos(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue math_asin(Context *cx, const JSValues& argv) +static JSValue math_asin(Context *, const JSValues& argv) { if (argv.size() > 0) { JSValue num = argv[1].toNumber(); @@ -130,7 +130,7 @@ JSValue math_asin(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue math_atan(Context *cx, const JSValues& argv) +static JSValue math_atan(Context *, const JSValues& argv) { if (argv.size() > 0) { JSValue num = argv[1].toNumber(); @@ -139,7 +139,7 @@ JSValue math_atan(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue math_atan2(Context *cx, const JSValues& argv) +static JSValue math_atan2(Context *, const JSValues& argv) { if (argv.size() > 1) { JSValue num1 = argv[1].toNumber(); @@ -149,7 +149,7 @@ JSValue math_atan2(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue math_ceil(Context *cx, const JSValues& argv) +static JSValue math_ceil(Context *, const JSValues& argv) { if (argv.size() > 0) { JSValue num = argv[1].toNumber(); @@ -167,7 +167,7 @@ struct MathFunctionEntry { { "asin", math_asin }, { "atan", math_atan }, { "atan2", math_atan2 }, - { "ceil", math_acos }, + { "ceil", math_ceil }, { "acos", math_acos }, { "acos", math_acos } }; diff --git a/mozilla/js2/src/jstypes.cpp b/mozilla/js2/src/jstypes.cpp index 318d51ab4e2..8a9b99dd6c3 100644 --- a/mozilla/js2/src/jstypes.cpp +++ b/mozilla/js2/src/jstypes.cpp @@ -45,7 +45,7 @@ using namespace Interpreter; /********** Object Object Stuff **************************/ -JSValue object_toString(Context *cx, const JSValues& argv) +static JSValue object_toString(Context *, const JSValues& argv) { if (argv.size() > 0) { JSString *s = new JSString("[object "); @@ -58,7 +58,7 @@ JSValue object_toString(Context *cx, const JSValues& argv) return kUndefinedValue; } -JSValue objectConstructor(Context *cx, const JSValues& argv) +static JSValue objectConstructor(Context *, const JSValues& argv) { ASSERT(argv.size() > 0); JSValue theThis = argv[0]; @@ -108,13 +108,13 @@ void JSObject::initObjectObject(JSScope *g) /********** Function Object Stuff **************************/ // An empty function that returns undefined -JSValue functionPrototypeFunction(Context *cx, const JSValues& argv) +static JSValue functionPrototypeFunction(Context *, const JSValues &) { return kUndefinedValue; } -JSValue function_constructor(Context *cx, const JSValues& argv) +static JSValue function_constructor(Context *cx, const JSValues& argv) { // build a function from the arguments into the this. ASSERT(argv.size() > 0); @@ -129,16 +129,16 @@ JSValue function_constructor(Context *cx, const JSValues& argv) return theThis; } -JSValue function_toString(Context *cx, const JSValues& argv) +static JSValue function_toString(Context *, const JSValues &) { return JSValue(new JSString("function XXX() { }" )); } -JSValue function_apply(Context *cx, const JSValues& argv) +static JSValue function_apply(Context *, const JSValues &) { // XXX return kUndefinedValue; } -JSValue function_call(Context *cx, const JSValues& argv) +static JSValue function_call(Context *, const JSValues &) { // XXX return kUndefinedValue; diff --git a/mozilla/js2/src/jstypes.h b/mozilla/js2/src/jstypes.h index b14c9a68c39..798b46fc01d 100644 --- a/mozilla/js2/src/jstypes.h +++ b/mozilla/js2/src/jstypes.h @@ -420,7 +420,7 @@ namespace JSTypes { typedef gc_allocator allocator; public: - static void JSFunction::initFunctionObject(JSScope *g); + static void initFunctionObject(JSScope *g); JSFunction(ICodeModule* iCode) : JSObject(FunctionPrototypeObject), diff --git a/mozilla/js2/tests/cpp/js2_shell.cpp b/mozilla/js2/tests/cpp/js2_shell.cpp index dfe62f20907..287bf454823 100644 --- a/mozilla/js2/tests/cpp/js2_shell.cpp +++ b/mozilla/js2/tests/cpp/js2_shell.cpp @@ -114,7 +114,7 @@ JavaScript::Debugger::Shell jsd(world, stdin, JavaScript::stdOut, JavaScript::stdOut, &ResolveFile); #endif -static JSValue print(Context *cx, const JSValues &argv) +static JSValue print(Context *, const JSValues &argv) { size_t n = argv.size(); if (n > 1) { // the 'this' parameter is un-interesting @@ -126,7 +126,7 @@ static JSValue print(Context *cx, const JSValues &argv) return kUndefinedValue; } -static JSValue dump(Context *cx, const JSValues &argv) +static JSValue dump(Context *, const JSValues &argv) { size_t n = argv.size(); if (n > 1) { // the 'this' parameter is un-interesting