Closed Bug 571059 Opened 15 years ago Closed 15 years ago

build warnings about %08x and 'long long unsigned int', now that nsFrameState is 64-bit

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: dholbert)

References

()

Details

(Whiteboard: [build_warning])

Attachments

(1 file, 1 obsolete file)

There are at least 8 places in frame code where we have e.g. > fprintf(out, " [state=%08x]", mState); Now that mState is a 64-bit value (due to bug 570837), these printf/fprintf lines spam build warnings about type mismatch. We just need a s/x/llx/ on those lines, so that (f)printf will be expecting a long-long to print as hex. The instances of this that I found are: { > layout/generic/nsBlockFrame.cpp:401: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 3 has type ‘long long unsigned int’ > layout/generic/nsContainerFrame.cpp:1544: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 3 has type ‘long long unsigned int’ > layout/generic/nsFrame.cpp:4144: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 3 has type ‘long long unsigned int’ > layout/generic/nsImageFrame.cpp:1595: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 3 has type ‘long long unsigned int’ > layout/generic/nsPlaceholderFrame.cpp:243: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 3 has type ‘long long unsigned int’ > layout/generic/nsTextFrameThebes.cpp:6939: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 3 has type ‘long long unsigned int’ > layout/generic/nsTextFrameThebes.cpp:6941: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 3 has type ‘long long unsigned int’ > layout/xul/base/src/nsPopupSetFrame.cpp:210: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 3 has type ‘long long unsigned int’ } Attaching patch in a minute.
Attached patch fix (obsolete) — Splinter Review
This just does a s/%08x/%016llx/ on the affected lines. (16 --> padding to the full 16-character potential width of the now-64-bit value, so that everything will still line up nicely in debug output)
Attachment #450185 - Flags: review?(dbaron)
Ah, just noticed one more instance of this problem with a slightly different warning message: > layout/generic/nsFrame.cpp:4361: warning: format '%d' expects type 'int', but argument 3 has type 'nsFrameState' I'll post a new patch that covers that one, too. (there aren't any other instances of that particular warning -- that's the only line in a full debug buildlog to mention nsFrameState)
Attached patch fix v2Splinter Review
Attachment #450185 - Attachment is obsolete: true
Attachment #450185 - Flags: review?(dbaron)
Attachment #450285 - Flags: review?(dbaron)
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: