Closed Bug 773782 Opened 12 years ago Closed 12 years ago

LL_* macros are deprecated

Categories

(MailNews Core :: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 17.0

People

(Reporter: jcranmer, Assigned: jcranmer)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Kill all the macros (obsolete) — Splinter Review
So let's remove them.

Hey, we can also clean up a lot of logic now that we don't need to make every binary operation a separate statement. Or being able to compare values other than 0.
Attachment #642019 - Flags: review?(neil)
Comment on attachment 642019 [details] [diff] [review]
Kill all the macros

>+    PRUint32 percentage = (PRUint32)(mCurrentProgress * 100 / mMaxProgress));
Did you compile this? Looks like you have too many )s.

>+#define PR_USEC_PER_DAY ((PRTime)PR_USEC_PER_SEC * 60 * 60 * 24)
PRTime(PR_USEC_PER_SEC) ?

> void PRTime2Seconds(PRTime prTime, PRUint32 *seconds)
> {
>-  PRInt64 microSecondsPerSecond, intermediateResult;
>-
>-  LL_I2L(microSecondsPerSecond, PR_USEC_PER_SEC);
>-  LL_DIV(intermediateResult, prTime, microSecondsPerSecond);
>-  LL_L2UI((*seconds), intermediateResult);
>+  *seconds = (PRUint32)(prTime / PR_USEC_PER_SEC);
> }
> 
> void PRTime2Seconds(PRTime prTime, PRInt32 *seconds)
> {
>-  PRInt64 microSecondsPerSecond, intermediateResult;
>-
>-  LL_I2L(microSecondsPerSecond, PR_USEC_PER_SEC);
>-  LL_DIV(intermediateResult, prTime, microSecondsPerSecond);
>-  LL_L2I((*seconds), intermediateResult);
>+  *seconds = (PRInt32)(prTime / PR_USEC_PER_SEC);
> }
> 
> void Seconds2PRTime(PRUint32 seconds, PRTime *prTime)
> {
>-  PRInt64 microSecondsPerSecond, intermediateResult;
>-
>-  LL_I2L(microSecondsPerSecond, PR_USEC_PER_SEC);
>-  LL_UI2L(intermediateResult, seconds);
>-  LL_MUL((*prTime), intermediateResult, microSecondsPerSecond);
>+  *prTime = (PRTime)seconds * PR_USEC_PER_SEC;
> }
[Followup to make these inline?]

> NS_MSG_BASE PRTime MsgConvertAgeInDaysToCutoffDate(PRInt32 ageInDays)
> {
>-  PRInt64 secondsInDays, microSecondsInDay;
>   PRTime now = PR_Now();
> 
>-  secondsInDays = 60 * 60 * 24 * ageInDays;
>-  microSecondsInDay = secondsInDays * PR_USEC_PER_SEC;
>-  return now - microSecondsInDay;
>+  return now - PR_USEC_PER_DAY;
> }
ageInDays got lost :-(

>-      PRInt64 fileSize;
>-      LL_I2L(fileSize, mTotalWritten);
>-      mLocalFile->SetFileSize(fileSize);
>+      mLocalFile->SetFileSize(mTotalWritten);
Nice fix :-)

> PRUint32 TimeInSecondsFromPRTime(PRTime prTime)
> {
>-  PRUint32 retTimeInSeconds;
>-
>-  PRInt64 microSecondsPerSecond, intermediateResult;
>-  LL_I2L(microSecondsPerSecond, PR_USEC_PER_SEC);
>-  LL_DIV(intermediateResult, prTime, microSecondsPerSecond);
>-  LL_L2UI(retTimeInSeconds, intermediateResult);
>-  return retTimeInSeconds;
>+  return (PRUint32)(prTime / PR_USEC_PER_SEC);
> }
[Another one. Sigh...]

>+    PRTime cacheTimeoutLimits = 170 * PR_USEC_PER_SEC;
> 
>     PRTime lastActiveTimeStamp;
>     rv = aConnection->GetLastActiveTimeStamp(&lastActiveTimeStamp);
> 
>+    if (PR_Now() - lastActiveTimeStamp >= (PRTime)170 * PR_USEC_PER_SEC)
cacheTimeoutLimits is unused. (Probably lost in the other warnings...)
Attachment #642019 - Flags: review?(neil) → review-
Attached patch It's a patch!Splinter Review
This one compiles for me on tip-of-trunk, and it should fix all of the previous comments.
Attachment #642019 - Attachment is obsolete: true
Attachment #642570 - Flags: review?(neil)
Attachment #642570 - Flags: review?(neil) → review+
https://hg.mozilla.org/comm-central/rev/31da1d3a11c3
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 17.0
Blocks: 960097
Regressions: 1580480
Regressions: 1649553
No longer regressions: 1649553
You need to log in before you can comment on or make changes to this bug.