Bug 1144366 followup - Stop declaring multiple pointers on a single line. r=jorendorff

This commit is contained in:
Jan de Mooij 2015-04-02 11:22:21 +02:00
parent 23750aee85
commit da0b42dad7
55 changed files with 261 additions and 161 deletions

View File

@ -98,7 +98,8 @@ class Logging
}
void formatObject(bool incoming, bool local, ObjectId id, nsCString& out) {
const char* side, *objDesc;
const char* side;
const char* objDesc;
void* ptr;
if (local == incoming) {

View File

@ -870,7 +870,8 @@ class HashTable : private AllocPolicy
++cur;
}
Entry* cur, *end;
Entry* cur;
Entry* end;
#ifdef JS_DEBUG
const HashTable* table_;
uint64_t mutationCount;
@ -1090,7 +1091,8 @@ class HashTable : private AllocPolicy
static void destroyTable(AllocPolicy& alloc, Entry* oldTable, uint32_t capacity)
{
for (Entry* e = oldTable, *end = e + capacity; e < end; ++e)
Entry* end = oldTable + capacity;
for (Entry* e = oldTable; e < end; ++e)
e->destroyIfLive();
alloc.free_(oldTable);
}
@ -1346,7 +1348,8 @@ class HashTable : private AllocPolicy
table = newTable;
// Copy only live entries, leaving removed ones behind.
for (Entry* src = oldTable, *end = src + oldCap; src < end; ++src) {
Entry* end = oldTable + oldCap;
for (Entry* src = oldTable; src < end; ++src) {
if (src->isLive()) {
HashNumber hn = src->getKeyHash();
findFreeEntry(hn).setLive(
@ -1480,7 +1483,8 @@ class HashTable : private AllocPolicy
memset(table, 0, sizeof(*table) * capacity());
} else {
uint32_t tableCapacity = capacity();
for (Entry* e = table, *end = table + tableCapacity; e < end; ++e)
Entry* end = table + tableCapacity;
for (Entry* e = table; e < end; ++e)
e->clear();
}
removedCount = 0;

View File

@ -795,7 +795,8 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
* example, Rooted<JSObject> and Rooted<JSFunction>, which use the same
* stack head pointer for different classes.
*/
Rooted<void*>** stack, *prev;
Rooted<void*>** stack;
Rooted<void*>* prev;
/*
* |ptr| must be the last field in Rooted because the analysis treats all

View File

@ -6363,7 +6363,8 @@ CheckConditional(FunctionCompiler& f, ParseNode* ternary, MDefinition** def, Typ
if (!condType.isInt())
return f.failf(cond, "%s is not a subtype of int", condType.toChars());
MBasicBlock* thenBlock = nullptr, *elseBlock = nullptr;
MBasicBlock* thenBlock = nullptr;
MBasicBlock* elseBlock = nullptr;
if (!f.branchAndStartThen(condDef, &thenBlock, &elseBlock, thenExpr, elseExpr))
return false;
@ -6482,7 +6483,8 @@ CheckAddOrSub(FunctionCompiler& f, ParseNode* expr, MDefinition** def, Type* typ
ParseNode* lhs = AddSubLeft(expr);
ParseNode* rhs = AddSubRight(expr);
MDefinition* lhsDef, *rhsDef;
MDefinition* lhsDef;
MDefinition* rhsDef;
Type lhsType, rhsType;
unsigned lhsNumAddOrSub, rhsNumAddOrSub;
@ -6545,7 +6547,8 @@ CheckDivOrMod(FunctionCompiler& f, ParseNode* expr, MDefinition** def, Type* typ
ParseNode* lhs = DivOrModLeft(expr);
ParseNode* rhs = DivOrModRight(expr);
MDefinition* lhsDef, *rhsDef;
MDefinition* lhsDef;
MDefinition* rhsDef;
Type lhsType, rhsType;
if (!CheckExpr(f, lhs, &lhsDef, &lhsType))
return false;
@ -6600,7 +6603,8 @@ CheckComparison(FunctionCompiler& f, ParseNode* comp, MDefinition** def, Type* t
ParseNode* lhs = ComparisonLeft(comp);
ParseNode* rhs = ComparisonRight(comp);
MDefinition* lhsDef, *rhsDef;
MDefinition* lhsDef;
MDefinition* rhsDef;
Type lhsType, rhsType;
if (!CheckExpr(f, lhs, &lhsDef, &lhsType))
return false;
@ -6947,9 +6951,12 @@ CheckIfConditional(FunctionCompiler& f, ParseNode* conditional, ParseNode* thenS
ParseNode* lhs = TernaryKid2(conditional);
ParseNode* rhs = TernaryKid3(conditional);
MBasicBlock* maybeAndTest = nullptr, *maybeOrTest = nullptr;
MBasicBlock** ifTrueBlock = &maybeAndTest, **ifFalseBlock = &maybeOrTest;
ParseNode* ifTrueBlockNode = lhs, *ifFalseBlockNode = rhs;
MBasicBlock* maybeAndTest = nullptr;
MBasicBlock* maybeOrTest = nullptr;
MBasicBlock** ifTrueBlock = &maybeAndTest;
MBasicBlock** ifFalseBlock = &maybeOrTest;
ParseNode* ifTrueBlockNode = lhs;
ParseNode* ifFalseBlockNode = rhs;
// Try to spot opportunities for short-circuiting in the AND subpart
uint32_t andTestLiteral = 0;
@ -7071,7 +7078,8 @@ CheckIf(FunctionCompiler& f, ParseNode* ifStmt)
ParseNode* thenStmt = TernaryKid2(ifStmt);
ParseNode* elseStmt = TernaryKid3(ifStmt);
MBasicBlock* thenBlock = nullptr, *elseBlock = nullptr;
MBasicBlock* thenBlock = nullptr;
MBasicBlock* elseBlock = nullptr;
ParseNode* elseOrJoinStmt = elseStmt ? elseStmt : nextStmt;
if (!CheckIfCondition(f, cond, thenStmt, elseOrJoinStmt, &thenBlock, &elseBlock))

View File

@ -137,9 +137,10 @@ class OrderedHashTable
}
~OrderedHashTable() {
for (Range* r = ranges, *next; r; r = next) {
next = r->next;
for (Range* r = ranges; r; ) {
Range* next = r->next;
r->onTableDestroyed();
r = next;
}
alloc.free_(hashTable);
freeData(data, dataLength);
@ -593,7 +594,8 @@ class OrderedHashTable
void rehashInPlace() {
for (uint32_t i = 0, N = hashBuckets(); i < N; i++)
hashTable[i] = nullptr;
Data* wp = data, *end = data + dataLength;
Data* wp = data;
Data* end = data + dataLength;
for (Data* rp = data; rp != end; rp++) {
if (!Ops::isEmpty(Ops::getKey(rp->element))) {
HashNumber h = prepareHash(Ops::getKey(rp->element)) >> hashShift;
@ -642,7 +644,8 @@ class OrderedHashTable
}
Data* wp = newData;
for (Data* p = data, *end = data + dataLength; p != end; p++) {
Data* end = data + dataLength;
for (Data* p = data; p != end; p++) {
if (!Ops::isEmpty(Ops::getKey(p->element))) {
HashNumber h = prepareHash(Ops::getKey(p->element)) >> newHashShift;
new (wp) Data(Move(p->element), newHashTable[h]);

View File

@ -60,7 +60,8 @@ class InlineMap
MOZ_ASSERT(map.initialized());
}
for (InlineElem* it = inl, *end = inl + inlNext; it != end; ++it) {
InlineElem* end = inl + inlNext;
for (InlineElem* it = inl; it != end; ++it) {
if (it->key && !map.putNew(it->key, it->value))
return false;
}
@ -211,7 +212,8 @@ class InlineMap
if (usingMap())
return Ptr(map.lookup(key));
for (InlineElem* it = inl, *end = inl + inlNext; it != end; ++it) {
InlineElem* end = inl + inlNext;
for (InlineElem* it = inl; it != end; ++it) {
if (it->key == key)
return Ptr(it);
}
@ -224,7 +226,8 @@ class InlineMap
if (usingMap())
return AddPtr(map.lookupForAdd(key));
for (InlineElem* it = inl, *end = inl + inlNext; it != end; ++it) {
InlineElem* end = inl + inlNext;
for (InlineElem* it = inl; it != end; ++it) {
if (it->key == key)
return AddPtr(it, true);
}

View File

@ -25,7 +25,9 @@ class SplayTree
{
struct Node {
T item;
Node* left, *right, *parent;
Node* left;
Node* right;
Node* parent;
explicit Node(const T& item)
: item(item), left(nullptr), right(nullptr), parent(nullptr)
@ -33,7 +35,8 @@ class SplayTree
};
LifoAlloc* alloc;
Node* root, *freeList;
Node* root;
Node* freeList;
#ifdef DEBUG
bool enableCheckCoherency;
@ -124,7 +127,8 @@ class SplayTree
// Find another node which can be swapped in for the root: either the
// rightmost child of the root's left, or the leftmost child of the
// root's right.
Node* swap, *swapChild;
Node* swap;
Node* swapChild;
if (root->left) {
swap = root->left;
while (swap->right)
@ -167,7 +171,8 @@ class SplayTree
Node* lookup(const T& v)
{
MOZ_ASSERT(root);
Node* node = root, *parent;
Node* node = root;
Node* parent;
do {
parent = node;
int c = C::compare(v, node->item);

View File

@ -2280,7 +2280,8 @@ BytecodeEmitter::emitPropLHS(ParseNode* pn, JSOp op)
*/
if (pn2->isKind(PNK_DOT)) {
ParseNode* pndot = pn2;
ParseNode* pnup = nullptr, *pndown;
ParseNode* pnup = nullptr;
ParseNode* pndown;
ptrdiff_t top = offset();
for (;;) {
/* Reverse pndot->pn_expr to point up, not down. */
@ -6673,8 +6674,8 @@ BytecodeEmitter::emitDefaults(ParseNode* pn)
{
MOZ_ASSERT(pn->isKind(PNK_ARGSBODY));
ParseNode* arg, *pnlast = pn->last();
for (arg = pn->pn_head; arg != pnlast; arg = arg->pn_next) {
ParseNode* pnlast = pn->last();
for (ParseNode* arg = pn->pn_head; arg != pnlast; arg = arg->pn_next) {
if (!(arg->pn_dflags & PND_DEFAULT))
continue;
if (!bindNameToSlot(arg))

View File

@ -617,7 +617,9 @@ Fold(ExclusiveContext* cx, ParseNode** pnp,
bool inGenexpLambda, SyntacticContext sc)
{
ParseNode* pn = *pnp;
ParseNode* pn1 = nullptr, *pn2 = nullptr, *pn3 = nullptr;
ParseNode* pn1 = nullptr;
ParseNode* pn2 = nullptr;
ParseNode* pn3 = nullptr;
JS_CHECK_RECURSION(cx, return false);

View File

@ -35,7 +35,8 @@ ParseMapPool::checkInvariants()
void
ParseMapPool::purgeAll()
{
for (void** it = all.begin(), **end = all.end(); it != end; ++it)
void** end = all.end();
for (void** it = all.begin(); it != end; ++it)
js_delete<AtomMapT>(asAtomMap(*it));
all.clearAndFree();
@ -121,8 +122,8 @@ frontend::InitAtomMap(frontend::AtomIndexMap* indices, HeapPtrAtom* atoms)
atoms[index].init(atom);
}
} else {
for (const AtomIndexMap::InlineElem* it = indices->asInline(), *end = indices->inlineEnd();
it != end; ++it) {
const AtomIndexMap::InlineElem* end = indices->inlineEnd();
for (const AtomIndexMap::InlineElem* it = indices->asInline(); it != end; ++it) {
JSAtom* atom = it->key;
if (!atom)
continue;

View File

@ -60,14 +60,14 @@ class ParseMapPool
#ifdef DEBUG
bool ok = false;
/* Make sure the map is in |all| but not already in |recyclable|. */
for (void** it = all.begin(), **end = all.end(); it != end; ++it) {
for (void** it = all.begin(); it != all.end(); ++it) {
if (*it == map) {
ok = true;
break;
}
}
MOZ_ASSERT(ok);
for (void** it = recyclable.begin(), **end = recyclable.end(); it != end; ++it)
for (void** it = recyclable.begin(); it != recyclable.end(); ++it)
MOZ_ASSERT(*it != map);
#endif
MOZ_ASSERT(recyclable.length() < all.length());

View File

@ -23,9 +23,14 @@ ParseNode::checkListConsistency()
ParseNode** tail;
uint32_t count = 0;
if (pn_head) {
ParseNode* pn, *last;
for (pn = last = pn_head; pn; last = pn, pn = pn->pn_next, count++)
;
ParseNode* last = pn_head;
ParseNode* pn = last;
while (pn) {
last = pn;
pn = pn->pn_next;
count++;
}
tail = &last->pn_next;
} else {
tail = &pn_head;

View File

@ -4745,7 +4745,8 @@ Parser<FullParseHandler>::forStatement()
* pc->parsingForInit.
*/
StmtInfoPC letStmt(context); /* used if blockObj != nullptr. */
ParseNode* pn2, *pn3; /* forHead->pn_kid2 and pn_kid3. */
ParseNode* pn2; /* forHead->pn_kid2 */
ParseNode* pn3; /* forHead->pn_kid3 */
ParseNodeKind headKind = PNK_FORHEAD;
if (pn1) {
bool isForIn, isForOf;
@ -6903,7 +6904,9 @@ Parser<FullParseHandler>::legacyComprehensionTail(ParseNode* bodyExpr, unsigned
}
unsigned adjust;
ParseNode* pn, *pn3, **pnp;
ParseNode* pn;
ParseNode* pn3;
ParseNode** pnp;
StmtInfoPC stmtInfo(context);
BindData<FullParseHandler> data(context);
TokenKind tt;

View File

@ -1743,7 +1743,8 @@ GCMarker::processMarkStackOther(uintptr_t tag, uintptr_t addr)
} else if (tag == SavedValueArrayTag) {
MOZ_ASSERT(!(addr & CellMask));
NativeObject* obj = reinterpret_cast<NativeObject*>(addr);
HeapValue* vp, *end;
HeapValue* vp;
HeapValue* end;
if (restoreValueArray(obj, (void**)&vp, (void**)&end))
pushValueArray(obj, vp, end);
else
@ -1783,7 +1784,8 @@ GCMarker::processMarkStackTop(SliceBudget& budget)
* object directly. It allows to eliminate the tail recursion and
* significantly improve the marking performance, see bug 641025.
*/
HeapSlot* vp, *end;
HeapSlot* vp;
HeapSlot* end;
JSObject* obj;
const int32_t* unboxedTraceList;

View File

@ -611,7 +611,10 @@ js::Nursery::traceObject(MinorCollectionTracer* trc, JSObject* obj)
if (!nobj->hasEmptyElements() && !nobj->denseElementsAreCopyOnWrite())
markSlots(trc, nobj->getDenseElements(), nobj->getDenseInitializedLength());
HeapSlot* fixedStart, *fixedEnd, *dynStart, *dynEnd;
HeapSlot* fixedStart;
HeapSlot* fixedEnd;
HeapSlot* dynStart;
HeapSlot* dynEnd;
nobj->getSlotRange(0, nobj->slotSpan(), &fixedStart, &fixedEnd, &dynStart, &dynEnd);
markSlots(trc, fixedStart, fixedEnd);
markSlots(trc, dynStart, dynEnd);
@ -690,7 +693,8 @@ js::Nursery::moveObjectToTenured(MinorCollectionTracer* trc,
js_memcpy(dst, src, srcSize);
if (src->isNative()) {
NativeObject* ndst = &dst->as<NativeObject>(), *nsrc = &src->as<NativeObject>();
NativeObject* ndst = &dst->as<NativeObject>();
NativeObject* nsrc = &src->as<NativeObject>();
tenuredSize += moveSlotsToTenured(ndst, nsrc, dstKind);
tenuredSize += moveElementsToTenured(ndst, nsrc, dstKind);

View File

@ -329,7 +329,8 @@ enum ZoneSelector {
class ZonesIter
{
gc::AutoEnterIteration iterMarker;
JS::Zone** it, **end;
JS::Zone** it;
JS::Zone** end;
public:
ZonesIter(JSRuntime* rt, ZoneSelector selector) : iterMarker(&rt->gc) {

View File

@ -282,7 +282,8 @@ class RegExpParser
frontend::TokenStream& ts;
LifoAlloc* alloc;
RegExpCaptureVector* captures_;
const CharT* next_pos_, *end_;
const CharT* next_pos_;
const CharT* end_;
widechar current_;
// The capture count is only valid after we have scanned for captures.
int capture_count_;

View File

@ -141,7 +141,8 @@ LifetimesOverlap(BacktrackingVirtualRegister* reg0, BacktrackingVirtualRegister*
// In such cases, only consider the first interval.
MOZ_ASSERT(reg0->numIntervals() <= 2 && reg1->numIntervals() <= 2);
LiveInterval* interval0 = reg0->getInterval(0), *interval1 = reg1->getInterval(0);
LiveInterval* interval0 = reg0->getInterval(0);
LiveInterval* interval1 = reg1->getInterval(0);
// Interval ranges are sorted in reverse order. The lifetimes overlap if
// any of their ranges overlap.
@ -190,7 +191,8 @@ BacktrackingAllocator::tryGroupRegisters(uint32_t vreg0, uint32_t vreg1)
// See if reg0 and reg1 can be placed in the same group, following the
// restrictions imposed by VirtualRegisterGroup and any other registers
// already grouped with reg0 or reg1.
BacktrackingVirtualRegister* reg0 = &vregs[vreg0], *reg1 = &vregs[vreg1];
BacktrackingVirtualRegister* reg0 = &vregs[vreg0];
BacktrackingVirtualRegister* reg1 = &vregs[vreg1];
if (!reg0->isCompatibleVReg(*reg1))
return true;
@ -215,7 +217,8 @@ BacktrackingAllocator::tryGroupRegisters(uint32_t vreg0, uint32_t vreg1)
}
}
VirtualRegisterGroup* group0 = reg0->group(), *group1 = reg1->group();
VirtualRegisterGroup* group0 = reg0->group();
VirtualRegisterGroup* group1 = reg1->group();
if (!group0 && group1)
return tryGroupRegisters(vreg1, vreg0);
@ -262,7 +265,8 @@ BacktrackingAllocator::tryGroupRegisters(uint32_t vreg0, uint32_t vreg1)
bool
BacktrackingAllocator::tryGroupReusedRegister(uint32_t def, uint32_t use)
{
BacktrackingVirtualRegister& reg = vregs[def], &usedReg = vregs[use];
BacktrackingVirtualRegister& reg = vregs[def];
BacktrackingVirtualRegister& usedReg = vregs[use];
// reg is a vreg which reuses its input usedReg for its output physical
// register. Try to group reg with usedReg if at all possible, as avoiding
@ -1914,7 +1918,8 @@ BacktrackingAllocator::trySplitAcrossHotcode(LiveInterval* interval, bool* succe
}
LiveInterval* hotInterval = LiveInterval::New(alloc(), interval->vreg(), 0);
LiveInterval* preInterval = nullptr, *postInterval = nullptr;
LiveInterval* preInterval = nullptr;
LiveInterval* postInterval = nullptr;
// Accumulate the ranges of hot and cold code in the interval. Note that
// we are only comparing with the single hot range found, so the cold code

View File

@ -75,7 +75,8 @@ class DebugModeOSRVolatileStub
//
class DebugModeOSRVolatileJitFrameIterator : public JitFrameIterator
{
DebugModeOSRVolatileJitFrameIterator** stack, *prev;
DebugModeOSRVolatileJitFrameIterator** stack;
DebugModeOSRVolatileJitFrameIterator* prev;
public:
explicit DebugModeOSRVolatileJitFrameIterator(JSContext* cx)

View File

@ -256,7 +256,8 @@ CanUseInt32Compare(ICStub::Kind kind)
MCompare::CompareType
BaselineInspector::expectedCompareType(jsbytecode* pc)
{
ICStub* first = monomorphicStub(pc), *second = nullptr;
ICStub* first = monomorphicStub(pc);
ICStub* second = nullptr;
if (!first && !dimorphicStub(pc, &first, &second))
return MCompare::Compare_Unknown;

View File

@ -186,7 +186,8 @@ CodeGenerator::visitValueToInt32(LValueToInt32* lir)
// We can only handle strings in truncation contexts, like bitwise
// operations.
Label* stringEntry, *stringRejoin;
Label* stringEntry;
Label* stringRejoin;
Register stringReg;
if (input->mightBeType(MIRType_String)) {
stringReg = ToRegister(lir->temp());
@ -8958,7 +8959,8 @@ CodeGenerator::visitClampVToUint8(LClampVToUint8* lir)
Register output = ToRegister(lir->output());
MDefinition* input = lir->mir()->input();
Label* stringEntry, *stringRejoin;
Label* stringEntry;
Label* stringRejoin;
if (input->mightBeType(MIRType_String)) {
OutOfLineCode* oolString = oolCallVM(StringToNumberInfo, lir, (ArgList(), output),
StoreFloatRegisterTo(tempFloat));

View File

@ -1041,10 +1041,8 @@ IonScript::getSafepointIndex(uint32_t disp) const
const OsiIndex*
IonScript::getOsiIndex(uint32_t disp) const
{
for (const OsiIndex* it = osiIndices(), *end = osiIndices() + osiIndexEntries_;
it != end;
++it)
{
const OsiIndex* end = osiIndices() + osiIndexEntries_;
for (const OsiIndex* it = osiIndices(); it != end; ++it) {
if (it->returnPointDisplacement() == disp)
return it;
}

View File

@ -595,7 +595,8 @@ IonBuilder::analyzeNewLoopTypes(MBasicBlock* entry, jsbytecode* start, jsbytecod
}
loopHeaders_.append(LoopHeader(start, entry));
jsbytecode* last = nullptr, *earlier = nullptr;
jsbytecode* last = nullptr;
jsbytecode* earlier = nullptr;
for (jsbytecode* pc = start; pc != end; earlier = last, last = pc, pc += GetBytecodeLength(pc)) {
uint32_t slot;
if (*pc == JSOP_SETLOCAL)
@ -2577,7 +2578,8 @@ IonBuilder::processForUpdateEnd(CFGState& state)
IonBuilder::DeferredEdge*
IonBuilder::filterDeadDeferredEdges(DeferredEdge* edge)
{
DeferredEdge* head = edge, *prev = nullptr;
DeferredEdge* head = edge;
DeferredEdge* prev = nullptr;
while (edge) {
if (edge->block->isDead()) {
@ -7931,7 +7933,8 @@ IonBuilder::pushScalarLoadFromTypedObject(MDefinition* obj,
MOZ_ASSERT(size == ScalarTypeDescr::alignment(elemType));
// Find location within the owner object.
MDefinition* elements, *scaledOffset;
MDefinition* elements;
MDefinition* scaledOffset;
int32_t adjustment;
loadTypedObjectElements(obj, byteOffset, size, &elements, &scaledOffset, &adjustment);
@ -7970,7 +7973,8 @@ IonBuilder::pushReferenceLoadFromTypedObject(MDefinition* typedObj,
PropertyName* name)
{
// Find location within the owner object.
MDefinition* elements, *scaledOffset;
MDefinition* elements;
MDefinition* scaledOffset;
int32_t adjustment;
size_t alignment = ReferenceTypeDescr::alignment(type);
loadTypedObjectElements(typedObj, byteOffset, alignment, &elements, &scaledOffset, &adjustment);
@ -12748,7 +12752,8 @@ IonBuilder::storeScalarTypedObjectValue(MDefinition* typedObj,
MDefinition* value)
{
// Find location within the owner object.
MDefinition* elements, *scaledOffset;
MDefinition* elements;
MDefinition* scaledOffset;
int32_t adjustment;
size_t alignment = ScalarTypeDescr::alignment(type);
loadTypedObjectElements(typedObj, byteOffset, alignment, &elements, &scaledOffset, &adjustment);
@ -12792,7 +12797,8 @@ IonBuilder::storeReferenceTypedObjectValue(MDefinition* typedObj,
}
// Find location within the owner object.
MDefinition* elements, *scaledOffset;
MDefinition* elements;
MDefinition* scaledOffset;
int32_t adjustment;
size_t alignment = ReferenceTypeDescr::alignment(type);
loadTypedObjectElements(typedObj, byteOffset, alignment, &elements, &scaledOffset, &adjustment);

View File

@ -1030,7 +1030,9 @@ class IonBuilder
return analysis_;
}
TemporaryTypeSet* thisTypes, *argTypes, *typeArray;
TemporaryTypeSet* thisTypes;
TemporaryTypeSet* argTypes;
TemporaryTypeSet* typeArray;
uint32_t typeArrayHint;
uint32_t* bytecodeTypeMap;

View File

@ -28,15 +28,18 @@ struct LoopUnroller
TempAllocator& alloc;
// Header and body of the original loop.
MBasicBlock* header, *backedge;
MBasicBlock* header;
MBasicBlock* backedge;
// Header and body of the unrolled loop.
MBasicBlock* unrolledHeader, *unrolledBackedge;
MBasicBlock* unrolledHeader;
MBasicBlock* unrolledBackedge;
// Old and new preheaders. The old preheader starts out associated with the
// original loop, but becomes the preheader of the new loop. The new
// preheader will be given to the original loop.
MBasicBlock* oldPreheader, *newPreheader;
MBasicBlock* oldPreheader;
MBasicBlock* newPreheader;
// Map terms in the original loop to terms in the current unrolled iteration.
DefinitionMap unrolledDefinitions;

View File

@ -1553,8 +1553,8 @@ MPhi::removeOperand(size_t index)
void
MPhi::removeAllOperands()
{
for (MUse* p = inputs_.begin(), *e = inputs_.end(); p < e; ++p)
p->producer()->removeUse(p);
for (MUse& p : inputs_)
p.producer()->removeUse(&p);
inputs_.clear();
}
@ -2779,7 +2779,8 @@ MustBeUInt32(MDefinition* def, MDefinition** pwrapped)
bool
MBinaryInstruction::tryUseUnsignedOperands()
{
MDefinition* newlhs, *newrhs;
MDefinition* newlhs;
MDefinition* newrhs;
if (MustBeUInt32(getOperand(0), &newlhs) && MustBeUInt32(getOperand(1), &newrhs)) {
if (newlhs->type() != MIRType_Int32 || newrhs->type() != MIRType_Int32)
return false;

View File

@ -990,8 +990,8 @@ MBasicBlock::discardPhi(MPhi* phi)
phis_.remove(phi);
if (phis_.empty()) {
for (MBasicBlock** pred = predecessors_.begin(), **end = predecessors_.end(); pred < end; ++pred)
(*pred)->clearSuccessorWithPhis();
for (MBasicBlock* pred : predecessors_)
pred->clearSuccessorWithPhis();
}
}

View File

@ -602,7 +602,8 @@ GetDynamicName(JSContext* cx, JSObject* scopeChain, JSString* str, Value* vp)
}
Shape* shape = nullptr;
JSObject* scope = nullptr, *pobj = nullptr;
JSObject* scope = nullptr;
JSObject* pobj = nullptr;
if (LookupNameNoGC(cx, atom->asPropertyName(), scopeChain, &scope, &pobj, &shape)) {
if (FetchNameNoGC(pobj, shape, MutableHandleValue::fromMarkedLocation(vp)))
return;

View File

@ -342,7 +342,8 @@ CodeGeneratorShared::encodeAllocation(LSnapshot* snapshot, MDefinition* mir,
MOZ_ASSERT(mir->isRecoveredOnBailout());
uint32_t index = 0;
LRecoverInfo* recoverInfo = snapshot->recoverInfo();
MNode** it = recoverInfo->begin(), **end = recoverInfo->end();
MNode** it = recoverInfo->begin();
MNode** end = recoverInfo->end();
while (it != end && mir != *it) {
++it;
++index;
@ -487,8 +488,8 @@ CodeGeneratorShared::encode(LRecoverInfo* recover)
RecoverOffset offset = recovers_.startRecover(numInstructions, resumeAfter);
for (MNode** it = recover->begin(), **end = recover->end(); it != end; ++it)
recovers_.writeInstruction(*it);
for (MNode* insn : *recover)
recovers_.writeInstruction(insn);
recovers_.endRecover();
recover->setRecoverOffset(offset);
@ -572,18 +573,15 @@ CodeGeneratorShared::assignBailoutId(LSnapshot* snapshot)
void
CodeGeneratorShared::encodeSafepoints()
{
for (SafepointIndex* it = safepointIndices_.begin(), *end = safepointIndices_.end();
it != end;
++it)
{
LSafepoint* safepoint = it->safepoint();
for (SafepointIndex& index : safepointIndices_) {
LSafepoint* safepoint = index.safepoint();
if (!safepoint->encoded()) {
safepoint->fixupOffset(&masm);
safepoints_.encode(safepoint);
}
it->resolve();
index.resolve();
}
}

View File

@ -620,7 +620,9 @@ js::ExpandErrorArgumentsVA(ExclusiveContext* cx, JSErrorCallback callback,
*/
if (argCount > 0) {
if (efs->format) {
char16_t* buffer, *fmt, *out;
char16_t* buffer;
char16_t* fmt;
char16_t* out;
int expandedArgs = 0;
size_t expandedLength;
size_t len = strlen(efs->format);

View File

@ -248,7 +248,8 @@ static uint32_t quorem2(Bigint* b, int32_t k)
{
ULong mask;
ULong result;
ULong* bx, *bxe;
ULong* bx;
ULong* bxe;
int32_t w;
int32_t n = k >> 5;
k &= 0x1F;
@ -365,9 +366,10 @@ js_dtobasestr(DtoaState* state, int base, double dinput)
/* We have a fraction. */
int e, bbits;
int32_t s2, done;
Bigint* b, *s, *mlo, *mhi;
b = s = mlo = mhi = nullptr;
Bigint* b = nullptr;
Bigint* s = nullptr;
Bigint* mlo = nullptr;
Bigint* mhi = nullptr;
*p++ = '.';
b = d2b(PASS_STATE df, &e, &bbits);

View File

@ -2599,8 +2599,8 @@ GCRuntime::updatePointersToRelocatedCells(Zone* zone)
void
GCRuntime::protectRelocatedArenas()
{
for (ArenaHeader* arena = relocatedArenasToRelease, *next; arena; arena = next) {
next = arena->next;
for (ArenaHeader* arena = relocatedArenasToRelease; arena; ) {
ArenaHeader* next = arena->next;
#if defined(XP_WIN)
DWORD oldProtect;
if (!VirtualProtect(arena, ArenaSize, PAGE_NOACCESS, &oldProtect))
@ -2609,6 +2609,7 @@ GCRuntime::protectRelocatedArenas()
if (mprotect(arena, ArenaSize, PROT_NONE))
MOZ_CRASH();
#endif
arena = next;
}
}

View File

@ -1058,7 +1058,9 @@ js::InitRuntimeNumberState(JSRuntime* rt)
// change its return type.
#if !EXPOSE_INTL_API
/* Copy locale-specific separators into the runtime strings. */
const char* thousandsSeparator, *decimalPoint, *grouping;
const char* thousandsSeparator;
const char* decimalPoint;
const char* grouping;
#ifdef HAVE_LOCALECONV
struct lconv* locale = localeconv();
thousandsSeparator = locale->thousands_sep;

View File

@ -726,9 +726,6 @@ DisassembleAtPC(JSContext* cx, JSScript* scriptArg, bool lines,
RootedScript script(cx, scriptArg);
BytecodeParser parser(cx, script);
jsbytecode* next, *end;
unsigned len;
if (showAll && !parser.parse())
return false;
@ -753,8 +750,8 @@ DisassembleAtPC(JSContext* cx, JSScript* scriptArg, bool lines,
sp->put("----");
sp->put(" --\n");
next = script->code();
end = script->codeEnd();
jsbytecode* next = script->code();
jsbytecode* end = script->codeEnd();
while (next < end) {
if (next == script->main())
sp->put("main:\n");
@ -783,7 +780,7 @@ DisassembleAtPC(JSContext* cx, JSScript* scriptArg, bool lines,
else
Sprint(sp, " ");
}
len = Disassemble1(cx, script, next, script->pcToOffset(next), lines, sp);
unsigned len = Disassemble1(cx, script, next, script->pcToOffset(next), lines, sp);
if (!len)
return false;
next += len;

View File

@ -111,7 +111,8 @@ class BytecodeRange {
private:
RootedScript script;
jsbytecode* pc, *end;
jsbytecode* pc;
jsbytecode* end;
};
}

View File

@ -320,8 +320,8 @@ Bindings::trace(JSTracer* trc)
if (bindingArrayUsingTemporaryStorage())
return;
for (Binding* b = bindingArray(), *end = b + count(); b != end; b++) {
PropertyName* name = b->name();
for (const Binding& b : *this) {
PropertyName* name = b.name();
MarkStringUnbarriered(trc, &name, "bindingArray");
}
}

View File

@ -314,6 +314,9 @@ class Bindings
return !callObjShape_->isEmptyShape();
}
Binding* begin() const { return bindingArray(); }
Binding* end() const { return bindingArray() + count(); }
static js::ThingRootKind rootKind() { return js::THING_ROOT_BINDINGS; }
void trace(JSTracer* trc);
};
@ -1781,7 +1784,9 @@ class BindingIter
*/
class AliasedFormalIter
{
const Binding* begin_, *p_, *end_;
const Binding* begin_;
const Binding* p_;
const Binding* end_;
unsigned slot_;
void settle() {
@ -1809,7 +1814,7 @@ class LazyScript : public gc::TenuredCell
public:
class FreeVariable
{
// Free variable names are possible tagged JSAtom* s.
// Variable name is stored as a tagged JSAtom pointer.
uintptr_t bits_;
static const uintptr_t HOISTED_USE_BIT = 0x1;

View File

@ -1239,7 +1239,8 @@ StringMatch(const TextChar* text, uint32_t textLen, const PatChar* pat, uint32_t
*/
if (patLen == 1) {
const PatChar p0 = *pat;
for (const TextChar* c = text, *end = text + textLen; c != end; ++c) {
const TextChar* end = text + textLen;
for (const TextChar* c = text; c != end; ++c) {
if (*c == p0)
return c - text;
}

View File

@ -169,10 +169,10 @@
** Macros to get the number of elements and the pointer to one past the
** last element of a C array. Use them like this:
**
** char16_t buf[10], *s;
** char16_t buf[10];
** JSString* str;
** ...
** for (s = buf; s != JS_ARRAY_END(buf); ++s) *s = ...;
** for (char16_t* s = buf; s != JS_ARRAY_END(buf); ++s) *s = ...;
** ...
** str = JS_NewStringCopyN(cx, buf, JS_ARRAY_LENGTH(buf));
** ...

View File

@ -110,8 +110,8 @@ void
WeakMapBase::sweepCompartment(JSCompartment* c)
{
WeakMapBase** tailPtr = &c->gcWeakMapList;
for (WeakMapBase* m = c->gcWeakMapList, *next; m; m = next) {
next = m->next;
for (WeakMapBase* m = c->gcWeakMapList; m; ) {
WeakMapBase* next = m->next;
if (m->marked) {
m->sweep();
*tailPtr = m;
@ -121,6 +121,7 @@ WeakMapBase::sweepCompartment(JSCompartment* c)
m->finish();
m->next = WeakMapNotInList;
}
m = next;
}
*tailPtr = nullptr;

View File

@ -580,10 +580,8 @@ js::RemapAllWrappersForObject(JSContext* cx, JSObject* oldTargetArg,
}
}
for (WrapperValue* begin = toTransplant.begin(), *end = toTransplant.end();
begin != end; ++begin)
{
if (!RemapWrapper(cx, &begin->toObject(), newTarget))
for (const WrapperValue& v : toTransplant) {
if (!RemapWrapper(cx, &v.toObject(), newTarget))
MOZ_CRASH();
}
@ -619,9 +617,8 @@ js::RecomputeWrappers(JSContext* cx, const CompartmentFilter& sourceFilter,
}
// Recompute all the wrappers in the list.
for (WrapperValue* begin = toRecompute.begin(), *end = toRecompute.end(); begin != end; ++begin)
{
JSObject* wrapper = &begin->toObject();
for (const WrapperValue& v : toRecompute) {
JSObject* wrapper = &v.toObject();
JSObject* wrapped = Wrapper::wrappedObject(wrapper);
if (!RemapWrapper(cx, wrapper, wrapped))
MOZ_CRASH();

View File

@ -2189,13 +2189,11 @@ static const char* const TryNoteNames[] = { "catch", "finally", "for-in", "for-o
static bool
TryNotes(JSContext* cx, HandleScript script, Sprinter* sp)
{
JSTryNote* tn, *tnlimit;
if (!script->hasTrynotes())
return true;
tn = script->trynotes()->vector;
tnlimit = tn + script->trynotes()->length;
JSTryNote* tn = script->trynotes()->vector;
JSTryNote* tnlimit = tn + script->trynotes()->length;
Sprint(sp, "\nException table:\nkind stack start end\n");
do {
MOZ_ASSERT(tn->kind < ArrayLength(TryNoteNames));
@ -2407,7 +2405,6 @@ DisassWithSrc(JSContext* cx, unsigned argc, jsval* vp)
unsigned len, line1, line2, bupline;
FILE* file;
char linebuf[LINE_BUF_LEN];
jsbytecode* pc, *end;
static const char sep[] = ";-------------------------";
bool ok = true;
@ -2431,8 +2428,8 @@ DisassWithSrc(JSContext* cx, unsigned argc, jsval* vp)
return false;
}
pc = script->code();
end = script->codeEnd();
jsbytecode* pc = script->code();
jsbytecode* end = script->codeEnd();
Sprinter sprinter(cx);
if (!sprinter.init()) {

View File

@ -194,11 +194,10 @@ OptionParser::printHelp(const char* progname)
static const char fmt[] = " %s ";
size_t fmtChars = sizeof(fmt) - 2;
size_t lhsLen = 0;
for (Option** it = arguments.begin(), **end = arguments.end(); it != end; ++it)
lhsLen = Max(lhsLen, strlen((*it)->longflag) + fmtChars);
for (Option* arg : arguments)
lhsLen = Max(lhsLen, strlen(arg->longflag) + fmtChars);
for (Option** it = arguments.begin(), **end = arguments.end(); it != end; ++it) {
Option* arg = *it;
for (Option* arg : arguments) {
size_t chars = printf(fmt, arg->longflag);
for (; chars < lhsLen; ++chars)
putchar(' ');
@ -213,8 +212,7 @@ OptionParser::printHelp(const char* progname)
/* Calculate sizes for column alignment. */
size_t lhsLen = 0;
for (Option** it = options.begin(), **end = options.end(); it != end; ++it) {
Option* opt = *it;
for (Option* opt : options) {
size_t longflagLen = strlen(opt->longflag);
size_t fmtLen;
@ -227,8 +225,7 @@ OptionParser::printHelp(const char* progname)
}
/* Print option help text. */
for (Option** it = options.begin(), **end = options.end(); it != end; ++it) {
Option* opt = *it;
for (Option* opt : options) {
size_t fmtLen;
const char* fmt = OptionFlagsToFormatInfo(opt->shortflag, opt->isValued(), &fmtLen);
size_t chars;
@ -469,18 +466,18 @@ OptionParser::getMultiStringOption(const char* longflag) const
OptionParser::~OptionParser()
{
for (Option** it = options.begin(), **end = options.end(); it != end; ++it)
js_delete<Option>(*it);
for (Option** it = arguments.begin(), **end = arguments.end(); it != end; ++it)
js_delete<Option>(*it);
for (Option* opt : options)
js_delete<Option>(opt);
for (Option* arg : arguments)
js_delete<Option>(arg);
}
Option*
OptionParser::findOption(char shortflag)
{
for (Option** it = options.begin(), **end = options.end(); it != end; ++it) {
if ((*it)->shortflag == shortflag)
return *it;
for (Option* opt : options) {
if (opt->shortflag == shortflag)
return opt;
}
if (versionOption.shortflag == shortflag)
@ -498,9 +495,9 @@ OptionParser::findOption(char shortflag) const
Option*
OptionParser::findOption(const char* longflag)
{
for (Option** it = options.begin(), **end = options.end(); it != end; ++it) {
const char* target = (*it)->longflag;
if ((*it)->isValued()) {
for (Option* opt : options) {
const char* target = opt->longflag;
if (opt->isValued()) {
size_t targetLen = strlen(target);
/* Permit a trailing equals sign on the longflag argument. */
for (size_t i = 0; i < targetLen; ++i) {
@ -508,10 +505,10 @@ OptionParser::findOption(const char* longflag)
goto no_match;
}
if (longflag[targetLen] == '\0' || longflag[targetLen] == '=')
return *it;
return opt;
} else {
if (strcmp(target, longflag) == 0)
return *it;
return opt;
}
no_match:;
}

View File

@ -137,7 +137,8 @@ struct CopyScriptFrameIterArgs
MOZ_ASSERT(Max(numActuals, numFormals) == totalArgs);
if (numActuals < numFormals) {
HeapValue* dst = dstBase + numActuals, *dstEnd = dstBase + totalArgs;
HeapValue* dst = dstBase + numActuals;
HeapValue* dstEnd = dstBase + totalArgs;
while (dst != dstEnd)
(dst++)->init(UndefinedValue());
}

View File

@ -4164,7 +4164,9 @@ Debugger::drainTraceLoggerScriptCalls(JSContext* cx, unsigned argc, Value* vp)
return false;
if (textId != TraceLogger_Stop) {
const char* filename, *lineno, *colno;
const char* filename;
const char* lineno;
const char* colno;
size_t filename_len, lineno_len, colno_len;
logger->extractScriptDetails(textId, &filename, &filename_len, &lineno, &lineno_len,
&colno, &colno_len);

View File

@ -687,7 +687,8 @@ ProcessCallSiteObjOperation(JSContext* cx, RootedObject& cso, RootedObject& raw,
if (!ToPrimitive(cx, JSTYPE_NUMBER, rhs)) \
return false; \
if (lhs.isString() && rhs.isString()) { \
JSString* l = lhs.toString(), *r = rhs.toString(); \
JSString* l = lhs.toString(); \
JSString* r = rhs.toString(); \
int32_t result; \
if (!CompareStrings(cx, l, r, &result)) \
return false; \

View File

@ -300,7 +300,8 @@ GetNameOperation(JSContext* cx, InterpreterFrame* fp, jsbytecode* pc, MutableHan
obj = &obj->global();
Shape* shape = nullptr;
JSObject* scope = nullptr, *pobj = nullptr;
JSObject* scope = nullptr;
JSObject* pobj = nullptr;
if (LookupNameNoGC(cx, name, obj, &scope, &pobj, &shape)) {
if (FetchNameNoGC(pobj, shape, vp))
return CheckUninitializedLexical(cx, name, vp);
@ -1504,7 +1505,7 @@ AddOperation(JSContext* cx, MutableHandleValue lhs, MutableHandleValue rhs, Muta
bool lIsString, rIsString;
if ((lIsString = lhs.isString()) | (rIsString = rhs.isString())) {
JSString* lstr, *rstr;
JSString* lstr;
if (lIsString) {
lstr = lhs.toString();
} else {
@ -1512,6 +1513,8 @@ AddOperation(JSContext* cx, MutableHandleValue lhs, MutableHandleValue rhs, Muta
if (!lstr)
return false;
}
JSString* rstr;
if (rIsString) {
rstr = rhs.toString();
} else {
@ -2448,7 +2451,8 @@ END_CASE(JSOP_ADD)
CASE(JSOP_SUB)
{
RootedValue& lval = rootValue0, &rval = rootValue1;
RootedValue& lval = rootValue0;
RootedValue& rval = rootValue1;
lval = REGS.sp[-2];
rval = REGS.sp[-1];
MutableHandleValue res = REGS.stackHandleAt(-2);
@ -2460,7 +2464,8 @@ END_CASE(JSOP_SUB)
CASE(JSOP_MUL)
{
RootedValue& lval = rootValue0, &rval = rootValue1;
RootedValue& lval = rootValue0;
RootedValue& rval = rootValue1;
lval = REGS.sp[-2];
rval = REGS.sp[-1];
MutableHandleValue res = REGS.stackHandleAt(-2);
@ -2472,7 +2477,8 @@ END_CASE(JSOP_MUL)
CASE(JSOP_DIV)
{
RootedValue& lval = rootValue0, &rval = rootValue1;
RootedValue& lval = rootValue0;
RootedValue& rval = rootValue1;
lval = REGS.sp[-2];
rval = REGS.sp[-1];
MutableHandleValue res = REGS.stackHandleAt(-2);
@ -2484,7 +2490,8 @@ END_CASE(JSOP_DIV)
CASE(JSOP_MOD)
{
RootedValue& lval = rootValue0, &rval = rootValue1;
RootedValue& lval = rootValue0;
RootedValue& rval = rootValue1;
lval = REGS.sp[-2];
rval = REGS.sp[-1];
MutableHandleValue res = REGS.stackHandleAt(-2);
@ -2601,7 +2608,8 @@ CASE(JSOP_TOID)
* but we need to avoid the observable stringification the second time.
* There must be an object value below the id, which will not be popped.
*/
RootedValue& objval = rootValue0, &idval = rootValue1;
RootedValue& objval = rootValue0;
RootedValue& idval = rootValue1;
objval = REGS.sp[-2];
idval = REGS.sp[-1];

View File

@ -270,7 +270,8 @@ class TryNoteIter
const InterpreterRegs& regs;
RootedScript script; /* TryNotIter is always stack allocated. */
uint32_t pcOffset;
JSTryNote* tn, *tnEnd;
JSTryNote* tn;
JSTryNote* tnEnd;
void settle();

View File

@ -163,7 +163,10 @@ js::NativeObject::initializeSlotRange(uint32_t start, uint32_t length)
* No bounds check, as this is used when the object's shape does not
* reflect its allocated slots (updateSlotsForSpan).
*/
HeapSlot* fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
HeapSlot* fixedStart;
HeapSlot* fixedEnd;
HeapSlot* slotsStart;
HeapSlot* slotsEnd;
getSlotRangeUnchecked(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
uint32_t offset = start;
@ -176,7 +179,10 @@ js::NativeObject::initializeSlotRange(uint32_t start, uint32_t length)
void
js::NativeObject::initSlotRange(uint32_t start, const Value* vector, uint32_t length)
{
HeapSlot* fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
HeapSlot* fixedStart;
HeapSlot* fixedEnd;
HeapSlot* slotsStart;
HeapSlot* slotsEnd;
getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
for (HeapSlot* sp = fixedStart; sp < fixedEnd; sp++)
sp->init(this, HeapSlot::Slot, start++, *vector++);
@ -188,7 +194,10 @@ void
js::NativeObject::copySlotRange(uint32_t start, const Value* vector, uint32_t length)
{
JS::Zone* zone = this->zone();
HeapSlot* fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
HeapSlot* fixedStart;
HeapSlot* fixedEnd;
HeapSlot* slotsStart;
HeapSlot* slotsEnd;
getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
for (HeapSlot* sp = fixedStart; sp < fixedEnd; sp++)
sp->set(zone, this, HeapSlot::Slot, start++, *vector++);

View File

@ -506,7 +506,10 @@ class NativeObject : public JSObject
void invalidateSlotRange(uint32_t start, uint32_t length) {
#ifdef DEBUG
HeapSlot* fixedStart, *fixedEnd, *slotsStart, *slotsEnd;
HeapSlot* fixedStart;
HeapSlot* fixedEnd;
HeapSlot* slotsStart;
HeapSlot* slotsEnd;
getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd);
Debug_SetSlotRangeToCrashOnTouch(fixedStart, fixedEnd);
Debug_SetSlotRangeToCrashOnTouch(slotsStart, slotsEnd);

View File

@ -676,7 +676,9 @@ JSRuntime::getDefaultLocale()
if (defaultLocale)
return defaultLocale;
char* locale, *lang, *p;
char* locale;
char* lang;
char* p;
#ifdef HAVE_SETLOCALE
locale = setlocale(LC_ALL, nullptr);
#else

View File

@ -790,7 +790,10 @@ NativeObject::putProperty(ExclusiveContext* cx, HandleNativeObject obj, HandleId
if (!updateLast && !obj->generateOwnShape(cx))
return nullptr;
/* FIXME bug 593129 -- slot allocation and JSObject* this must move out of here! */
/*
* FIXME bug 593129 -- slot allocation and NativeObject *this must move
* out of here!
*/
if (slot == SHAPE_INVALID_SLOT && !(attrs & JSPROP_SHARED)) {
if (!allocSlot(cx, obj, &slot))
return nullptr;

View File

@ -109,7 +109,8 @@ SandboxDump(JSContext* cx, unsigned argc, jsval* vp)
#if defined(XP_MACOSX)
// Be nice and convert all \r to \n.
char* c = cstr, *cEnd = cstr + strlen(cstr);
char* c = cstr;
char* cEnd = cstr + strlen(cstr);
while (c < cEnd) {
if (*c == '\r')
*c = '\n';

View File

@ -3231,7 +3231,8 @@ ReadSourceFromFilename(JSContext* cx, const char* filename, char16_t** src, size
if (!buf)
return NS_ERROR_OUT_OF_MEMORY;
unsigned char* ptr = buf, *end = ptr + rawLen;
unsigned char* ptr = buf;
unsigned char* end = ptr + rawLen;
while (ptr < end) {
uint32_t bytesRead;
rv = scriptStream->Read(reinterpret_cast<char*>(ptr), end - ptr, &bytesRead);

View File

@ -712,7 +712,9 @@ static bool
env_enumerate(JSContext* cx, HandleObject obj)
{
static bool reflected;
char** evp, *name, *value;
char** evp;
char* name;
char* value;
RootedString valstr(cx);
bool ok;