Closed Bug 341287 Opened 18 years ago Closed 12 years ago

LOG_SCOPE macro in ImageLogging.h doesn't do what it looks like

Categories

(Core :: Graphics: ImageLib, defect)

1.8 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: dbaron, Assigned: jrmuizel)

Details

Attachments

(1 file)

the LOG_SCOPE and LOG_SCOPE_WITH_PARAM macros don't actually use __LINE__ the way they look like they do; thus builds with -Wshadow produce warnings:

/builds/1.8/mozilla/modules/libpr0n/src/imgLoader.cpp:409: warning: declaration of ‘LOG_SCOPE_TMP_VAR__LINE__’ shadows a previous local
/builds/1.8/mozilla/modules/libpr0n/src/imgLoader.cpp:266: warning: shadowed declaration is here
/builds/1.8/mozilla/modules/libpr0n/src/imgLoader.cpp:480: warning: declaration of ‘LOG_SCOPE_TMP_VAR__LINE__’ shadows a previous local
/builds/1.8/mozilla/modules/libpr0n/src/imgLoader.cpp:266: warning: shadowed declaration is here


or

/builds/1.8/mozilla/modules/libpr0n/src/imgRequest.cpp:809: warning: declaration of ‘LOG_SCOPE_TMP_VAR__LINE__’ shadows a previous local
/builds/1.8/mozilla/modules/libpr0n/src/imgRequest.cpp:804: warning: shadowed declaration is here
/builds/1.8/mozilla/modules/libpr0n/src/imgRequest.cpp:825: warning: declaration of ‘LOG_SCOPE_TMP_VAR__LINE__’ shadows a previous local
/builds/1.8/mozilla/modules/libpr0n/src/imgRequest.cpp:809: warning: shadowed declaration is here

and would presumably produce an error if two were used in the same scope.  If that's not actually ever needed, the __LINE__ stuff should be removed; otherwise it should use the nested macros that are needed to make this work, such as those in AUTO_MARK_JSVAL and AUTO_MARK_JSVAL_HELPER* in:
http://lxr.mozilla.org/seamonkey/source/js/src/xpconnect/src/xpcprivate.h#3454
Assignee: pavlov → nobody
QA Contact: imagelib
Attachment #592248 - Flags: review?(justin.lebar+bug)
Comment on attachment 592248 [details] [diff] [review]
expand __LINE__ before pasting

r=me, but please undef the new APPEND_LINE_NUMBER* macros.
Attachment #592248 - Flags: review?(justin.lebar+bug) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/006eebde1259
Assignee: nobody → jmuizelaar
Target Milestone: --- → mozilla13
https://hg.mozilla.org/mozilla-central/rev/006eebde1259
Status: NEW → RESOLVED
Closed: 12 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: