Bug 792581 - part 12: Replace LL_DIV with division operator. r=ehsan

This commit is contained in:
Andrew Quartey 2012-10-05 01:05:28 -04:00
Родитель d371ac7c39
Коммит 58aa97ec8b
13 изменённых файлов: 22 добавлений и 23 удалений

Просмотреть файл

@ -535,7 +535,7 @@ protected:
PRTime usec_per_sec;
uint32_t t_sec;
LL_I2L(usec_per_sec, PR_USEC_PER_SEC);
LL_DIV(t_usec, t_usec, usec_per_sec);
t_usec /= usec_per_sec;
LL_L2I(t_sec, t_usec);
return t_sec;
}

Просмотреть файл

@ -1238,7 +1238,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
PRTime delta, perLineDelta, lines;
LL_I2L(lines, numLines);
delta = end - start;
LL_DIV(perLineDelta, delta, lines);
perLineDelta = delta / lines;
ListTag(stdout);
char buf[400];
@ -6209,7 +6209,7 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
PRTime lines, deltaPerLine, delta;
LL_I2L(lines, numLines);
delta = end - start;
LL_DIV(deltaPerLine, delta, lines);
deltaPerLine = delta / lines;
ListTag(stdout);
char buf[400];

Просмотреть файл

@ -784,7 +784,7 @@ nsProtocolProxyService::SecondsSinceSessionStart()
// convert microseconds to seconds
PRTime ups;
LL_I2L(ups, PR_USEC_PER_SEC);
LL_DIV(diff, diff, ups);
diff /= ups;
// convert to 32 bit value
uint32_t dsec;

2
netwerk/cache/nsCache.cpp поставляемый
Просмотреть файл

@ -49,7 +49,7 @@ SecondsFromPRTime(PRTime prTime)
uint32_t seconds;
LL_I2L(microSecondsPerSecond, PR_USEC_PER_SEC);
LL_DIV(intermediateResult, prTime, microSecondsPerSecond);
intermediateResult = prTime / microSecondsPerSecond;
LL_L2UI(seconds, intermediateResult);
return seconds;
}

Просмотреть файл

@ -90,7 +90,7 @@ NowInMinutes()
{
PRTime now = PR_Now(), minutes, factor;
LL_I2L(factor, 60 * PR_USEC_PER_SEC);
LL_DIV(minutes, now, factor);
minutes = now / factor;
uint32_t result;
LL_L2UI(result, minutes);
return result;

Просмотреть файл

@ -416,7 +416,7 @@ nsCRLManager::ComputeNextAutoUpdateTime(nsICRLInfo *info,
switch (autoUpdateType) {
case TYPE_AUTOUPDATE_FREQ_BASED:
diff = now - lastUpdate; //diff is the no of micro sec between now and last update
LL_DIV(cycleCnt, diff, microsecInDayCnt); //temp is the number of full cycles from lst update
cycleCnt = diff / microsecInDayCnt; //temp is the number of full cycles from lst update
LL_MOD(temp, diff, microsecInDayCnt);
if(temp != 0) {
++cycleCnt; //no of complete cycles till next autoupdate instant

Просмотреть файл

@ -119,7 +119,7 @@ ticks2xsec(tmreader * aReader, uint32_t aTicks, uint32_t aResolution)
LL_UI2L(tmp64, aTicks);
bigone *= tmp64;
LL_UI2L(tmp64, aReader->ticksPerSec);
LL_DIV(bigone, bigone, tmp64);
bigone /= tmp64;
LL_L2UI(retval, bigone);
return retval;
}
@ -2045,7 +2045,7 @@ optionGetDataOut(PRFileDesc * inFD, STOptions * inOptions)
uint64_t mul64 = multiplier; \
uint64_t div64; \
\
LL_DIV(div64, inOptions->m##option_name##64, mul64); \
div64 = inOptions->m##option_name##64 / mul64; \
PR_fprintf(inFD, "%s%s=%llu", (0 == mark++) ? "?" : "&", #option_name, div64); \
}
@ -3876,7 +3876,7 @@ graphFootprint(STRequest * inRequest, STRun * aRun)
LL_I2L(mem64, (maxMemory - minMemory));
in64 = ydata64 * spacey64;
LL_DIV(in64, in64, mem64);
in64 /= mem64;
LL_L2I(in32, in64);
x2 = x1;
@ -4092,7 +4092,7 @@ graphTimeval(STRequest * inRequest, STRun * aRun)
LL_I2L(mem64, (maxMemory - minMemory));
in64 = ydata64 * spacey64;
LL_DIV(in64, in64, mem64);
in64 /= mem64;
LL_L2I(in32, in64);
x2 = x1;
@ -4310,7 +4310,7 @@ graphLifespan(STRequest * inRequest, STRun * aRun)
LL_I2L(mem64, (maxMemory - minMemory));
in64 = ydata64 * spacey64;
LL_DIV(in64, in64, mem64);
in64 /= mem64;
LL_L2I(in32, in64);
x2 = x1;
@ -4510,7 +4510,7 @@ graphWeight(STRequest * inRequest, STRun * aRun)
LL_UI2L(percent64, percents[traverse]);
result64 = maxWeight64 - minWeight64;
result64 *= percent64;
LL_DIV(result64, result64, hundred64);
result64 /= hundred64;
PR_snprintf(bytes[traverse], 32, "%llu", result64);
}
@ -4542,7 +4542,7 @@ graphWeight(STRequest * inRequest, STRun * aRun)
weight64 = maxWeight64 - minWeight64;
in64 = YData64[traverse] * spacey64;
LL_DIV(in64, in64, weight64);
in64 /= weight64;
LL_L2I(in32, in64);
x2 = x1;
@ -4732,7 +4732,7 @@ displayOptionInt64(STRequest * inRequest,
uint64_t mul64 = multiplier;
uint64_t div64;
LL_DIV(div64, value, mul64);
div64 = value / mul64;
PR_fprintf(inRequest->mFD,
"<input type=text name=%s value=%llu>\n",
option_name, div64);

Просмотреть файл

@ -424,7 +424,7 @@ uint32_t ticks2xsec(tmreader* aReader, uint32_t aTicks, uint32_t aResolution)
LL_UI2L(tmp64, aTicks);
bigone *= tmp64;
LL_UI2L(tmp64, aReader->ticksPerSec);
LL_DIV(bigone, bigone, tmp64);
bigone /= tmp64;
LL_L2UI(retval, bigone);
return retval;
}

Просмотреть файл

@ -540,7 +540,7 @@ uint32_t ticks2xsec(tmreader* aReader, uint32_t aTicks, uint32_t aResolution)
LL_UI2L(tmp64, aTicks);
bigone *= tmp64;
LL_UI2L(tmp64, aReader->ticksPerSec);
LL_DIV(bigone, bigone, tmp64);
bigone /= tmp64;
LL_L2UI(retval, bigone);
return retval;

Просмотреть файл

@ -60,7 +60,7 @@ PRTimeToSeconds(PRTime t_usec)
PRTime usec_per_sec;
uint32_t t_sec;
LL_I2L(usec_per_sec, PR_USEC_PER_SEC);
LL_DIV(t_usec, t_usec, usec_per_sec);
t_usec /= usec_per_sec;
LL_L2I(t_sec, t_usec);
return t_sec;
}

Просмотреть файл

@ -1716,7 +1716,7 @@ nsLocalFile::GetLastModifiedTime(PRTime *aLastModifiedTime)
// microseconds -> milliseconds
int64_t usecPerMsec;
LL_I2L(usecPerMsec, PR_USEC_PER_MSEC);
LL_DIV(*aLastModifiedTime, mFileInfo64.modifyTime, usecPerMsec);
*aLastModifiedTime = mFileInfo64.modifyTime / usecPerMsec;
return NS_OK;
}

Просмотреть файл

@ -2268,7 +2268,7 @@ nsLocalFile::GetLastModifiedTime(PRTime *aLastModifiedTime)
// microseconds -> milliseconds
int64_t usecPerMsec;
LL_I2L(usecPerMsec, PR_USEC_PER_MSEC);
LL_DIV(*aLastModifiedTime, mFileInfo64.modifyTime, usecPerMsec);
*aLastModifiedTime = mFileInfo64.modifyTime / usecPerMsec;
return NS_OK;
}
@ -2292,7 +2292,7 @@ nsLocalFile::GetLastModifiedTimeOfLink(PRTime *aLastModifiedTime)
// microseconds -> milliseconds
int64_t usecPerMsec;
LL_I2L(usecPerMsec, PR_USEC_PER_MSEC);
LL_DIV(*aLastModifiedTime, info.modifyTime, usecPerMsec);
*aLastModifiedTime = info.modifyTime / usecPerMsec;
return NS_OK;
}

Просмотреть файл

@ -78,8 +78,7 @@ int main(int argc, char** argv)
PRTime end = PR_Now();
PRTime conversion, ustoms;
LL_I2L(ustoms, 1000);
conversion = end - start;
LL_DIV(conversion, conversion, ustoms);
conversion = (end - start) / ustoms;
char buf[500];
PR_snprintf(buf, sizeof(buf),
"converting and discarding %d bytes took %lldms",