зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1383155 - remove redundant casts of SN_TYPE; r=jimb
MozReview-Commit-ID: 8hwj36YwAxz --HG-- extra : rebase_source : f6c1537f6566b3e1aa732718103b21863f15c480
This commit is contained in:
Родитель
67db6723ce
Коммит
1ac9609130
|
@ -504,7 +504,7 @@ class SrcNoteLineScanner
|
|||
ptrdiff_t nextOffset;
|
||||
while ((nextOffset = offset + SN_DELTA(sn)) <= relpc && !SN_IS_TERMINATOR(sn)) {
|
||||
offset = nextOffset;
|
||||
SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
|
||||
SrcNoteType type = SN_TYPE(sn);
|
||||
if (type == SRC_SETLINE || type == SRC_NEWLINE) {
|
||||
if (type == SRC_SETLINE)
|
||||
lineno = GetSrcNoteOffset(sn, 0);
|
||||
|
|
|
@ -3286,7 +3286,7 @@ js::PCToLineNumber(unsigned startLine, jssrcnote* notes, jsbytecode* code, jsbyt
|
|||
if (offset > target)
|
||||
break;
|
||||
|
||||
SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
|
||||
SrcNoteType type = SN_TYPE(sn);
|
||||
if (type == SRC_SETLINE) {
|
||||
lineno = unsigned(GetSrcNoteOffset(sn, 0));
|
||||
column = 0;
|
||||
|
@ -3338,7 +3338,7 @@ js::LineNumberToPC(JSScript* script, unsigned target)
|
|||
}
|
||||
}
|
||||
offset += SN_DELTA(sn);
|
||||
SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
|
||||
SrcNoteType type = SN_TYPE(sn);
|
||||
if (type == SRC_SETLINE) {
|
||||
lineno = unsigned(GetSrcNoteOffset(sn, 0));
|
||||
} else if (type == SRC_NEWLINE) {
|
||||
|
@ -3357,7 +3357,7 @@ js::GetScriptLineExtent(JSScript* script)
|
|||
unsigned lineno = script->lineno();
|
||||
unsigned maxLineNo = lineno;
|
||||
for (jssrcnote* sn = script->notes(); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
|
||||
SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
|
||||
SrcNoteType type = SN_TYPE(sn);
|
||||
if (type == SRC_SETLINE)
|
||||
lineno = unsigned(GetSrcNoteOffset(sn, 0));
|
||||
else if (type == SRC_NEWLINE)
|
||||
|
|
|
@ -2379,7 +2379,7 @@ SrcNotes(JSContext* cx, HandleScript script, Sprinter* sp)
|
|||
for (jssrcnote* sn = notes; !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
|
||||
unsigned delta = SN_DELTA(sn);
|
||||
offset += delta;
|
||||
SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
|
||||
SrcNoteType type = SN_TYPE(sn);
|
||||
const char* name = js_SrcNoteSpec[type].name;
|
||||
if (!sp->jsprintf("%3u: %4u %5u [%4u] %-8s",
|
||||
unsigned(sn - notes), lineno, offset, delta, name))
|
||||
|
|
|
@ -189,7 +189,7 @@ LCovSource::writeScript(JSScript* script)
|
|||
if (snpc <= pc) {
|
||||
size_t oldLine = lineno;
|
||||
while (!SN_IS_TERMINATOR(sn) && snpc <= pc) {
|
||||
SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
|
||||
SrcNoteType type = SN_TYPE(sn);
|
||||
if (type == SRC_SETLINE)
|
||||
lineno = size_t(GetSrcNoteOffset(sn, 0));
|
||||
else if (type == SRC_NEWLINE)
|
||||
|
|
|
@ -5935,7 +5935,7 @@ class BytecodeRangeWithPosition : private BytecodeRange
|
|||
*/
|
||||
jsbytecode *lastLinePC = nullptr;
|
||||
while (!SN_IS_TERMINATOR(sn) && snpc <= frontPC()) {
|
||||
SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
|
||||
SrcNoteType type = SN_TYPE(sn);
|
||||
if (type == SRC_COLSPAN) {
|
||||
ptrdiff_t colspan = SN_OFFSET_TO_COLSPAN(GetSrcNoteOffset(sn, 0));
|
||||
MOZ_ASSERT(ptrdiff_t(column) + colspan >= 0);
|
||||
|
|
Загрузка…
Ссылка в новой задаче