From f660f12a91a5708c383594dd84d66e2e09d37350 Mon Sep 17 00:00:00 2001 From: "rogerl%netscape.com" Date: Fri, 11 Jul 2003 21:23:39 +0000 Subject: [PATCH] Linux build.. git-svn-id: svn://10.0.0.236/trunk@144737 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js2/src/js2engine.cpp | 6 +++--- mozilla/js2/src/js2eval.cpp | 7 ++++--- mozilla/js2/src/js2op_arithmetic.cpp | 10 ++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/mozilla/js2/src/js2engine.cpp b/mozilla/js2/src/js2engine.cpp index e6121e1eec5..7de236e5715 100644 --- a/mozilla/js2/src/js2engine.cpp +++ b/mozilla/js2/src/js2engine.cpp @@ -258,7 +258,7 @@ namespace MetaData { String *p = (String *)(meta->alloc(sizeof(String), PondScum::StringFlag)); size_t len = strlen(s); String *result = new (p) String(len, uni::null); - for (int i = 0; i < len; i++) { + for (size_t i = 0; i < len; i++) { (*result)[i] = widen(s[i]); } // std::transform(s, s+len, result->begin(), widen); @@ -512,11 +512,11 @@ namespace MetaData { toString_StringAtom(world.identifiers["toString"]), valueOf_StringAtom(world.identifiers["valueOf"]), packageFrame(NULL), + localFrame(NULL), parameterFrame(NULL), + parameterSlots(NULL), parameterCount(0), superConstructorCalled(false), - localFrame(NULL), - parameterSlots(NULL), traceInstructions(false) { for (int i = 0; i < 256; i++) diff --git a/mozilla/js2/src/js2eval.cpp b/mozilla/js2/src/js2eval.cpp index 32718df70a1..217088a187d 100644 --- a/mozilla/js2/src/js2eval.cpp +++ b/mozilla/js2/src/js2eval.cpp @@ -336,7 +336,6 @@ namespace MetaData { fWrap->env->addFrame(runtimeFrame); ParameterFrame *oldPFrame = engine->parameterFrame; js2val *oldPSlots = engine->parameterSlots; - uint32 oldPCount = engine->parameterCount; try { savePC = engine->pc; engine->pc = NULL; @@ -1160,8 +1159,10 @@ VariableMemberCommon: str = a->mValue; } int32 i = JS2VAL_TO_INT(indexVal); - if ((i >= 0) && (i < str->length())) - *rval = meta->engine->allocString(&(*str)[i], 1); + if ((i >= 0) && ((uint32)(i) < str->length())) { + jschar c = (*str)[i]; + *rval = meta->engine->allocString(&c, 1); + } else *rval = JS2VAL_UNDEFINED; return true; diff --git a/mozilla/js2/src/js2op_arithmetic.cpp b/mozilla/js2/src/js2op_arithmetic.cpp index 4125f655202..e27355876f9 100644 --- a/mozilla/js2/src/js2op_arithmetic.cpp +++ b/mozilla/js2/src/js2op_arithmetic.cpp @@ -1174,9 +1174,8 @@ pc += sizeof(short); ASSERT(slotIndex < localFrame->frameSlots->size()); a = (*localFrame->frameSlots)[slotIndex]; - int32 i; - if (JS2VAL_IS_INT(a) && ((i = JS2VAL_TO_INT(a)) < JS2VAL_INT_MAX)) { - (*localFrame->frameSlots)[slotIndex] = INT_TO_JS2VAL(i + 1); + if (JS2VAL_IS_INT(a) && (a != INT_TO_JS2VAL(JS2VAL_INT_MAX))) { + (*localFrame->frameSlots)[slotIndex] += 2; // pre-shifted INT as JS2VAL push(a); } else { @@ -1192,9 +1191,8 @@ pc += sizeof(short); ASSERT(slotIndex < localFrame->frameSlots->size()); a = (*localFrame->frameSlots)[slotIndex]; - int32 i; - if (JS2VAL_IS_INT(a) && ((i = JS2VAL_TO_INT(a)) > JS2VAL_INT_MIN)) { - (*localFrame->frameSlots)[slotIndex] = INT_TO_JS2VAL(i - 1); + if (JS2VAL_IS_INT(a) && (a != INT_TO_JS2VAL(JS2VAL_INT_MIN))) { + (*localFrame->frameSlots)[slotIndex] -= 2; push(a); } else {