Closed Bug 205017 Opened 23 years ago Closed 23 years ago

Uninitialized variables in layout/html/base/src/nsPresShell.cpp

Categories

(Core :: Layout, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: tenthumbs, Assigned: timeless)

Details

Attachments

(1 file)

Taking a guess at the component. Gcc says nsPresShell.cpp:7864: warning: `PRUint8 rc' might be used uninitialized in \ this function nsPresShell.cpp:7864: warning: `PRUint8 gc' might be used uninitialized in \ this function and the code is: 7858 PRUint32 color; 7859 PRUint32 color2; 7860 if (aColor != 0) { 7861 color = aColor; 7862 color2 = NS_RGB(0,0,0); 7863 } else { 7864 PRUint8 rc,gc,bc = 0; 7865 if (counter->mCount < 5) { 7866 rc = 255; 7867 gc = 255; 7868 } else if ( counter->mCount < 11) { 7869 gc = 255; 7870 } else { 7871 rc = 255; 7872 } 7873 color = NS_RGB(rc,gc,bc); 7874 color2 = NS_RGB(rc/2,gc/2,bc/2); 7875 } and, sure enough, rc and gc aren't initialized. I have a feeling line 7864 should be PRUint8 rc = 0,gc = 0,bc = 0 but I could well be wrong.
Fortunately this is in debugging code that nobody I know of uses. That said, it's a pretty obvious fix.
If no one's using it why not remove it and reduce bloat?
Attached patch init to 0Splinter Review
Attachment #124541 - Flags: superreview?(dbaron)
Attachment #124541 - Flags: review?(dbaron)
.
Assignee: other → timeless
Attachment #124541 - Flags: superreview?(dbaron)
Attachment #124541 - Flags: superreview+
Attachment #124541 - Flags: review?(dbaron)
Attachment #124541 - Flags: review+
checked in
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: