Closed
Bug 156902
Opened 23 years ago
Closed 23 years ago
Extremely unreadable code
Categories
(Core :: CSS Parsing and Computation, defect, P4)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla1.2alpha
People
(Reporter: moz, Assigned: dbaron)
Details
(Whiteboard: [patch][whitebox])
Attachments
(1 file)
|
2.53 KB,
patch
|
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
Below is a piece of code from nsRuleNode.h that I stumbled upon and had a hard
time to read: Typecasting "this" to char* and adding an offset for accessing
members is very evil. At the very least a better documentation would be in
order. The best thing is the NOTE: guess what the note says in
nsStyleContext::SetStyle!
nsStyleStruct* CachedStyleData::GetStyleData(const nsStyleStructID& aSID) {
// NOTE: nsStyleContext::SetStyle works roughly the same way.
const StyleStructInfo& info = gInfo[aSID];
char* resetOrInheritSlot = NS_REINTERPRET_CAST(char*, this) +
info.mCachedStyleDataOffset;
char* resetOrInherit = NS_REINTERPRET_CAST(char*,
*NS_REINTERPRET_CAST(void**, resetOrInheritSlot));
[...]
| Assignee | ||
Updated•23 years ago
|
Target Milestone: --- → Future
| Assignee | ||
Updated•23 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P4
Whiteboard: [patch]
Target Milestone: Future → mozilla1.2alpha
| Assignee | ||
Comment 1•23 years ago
|
||
Comment 2•23 years ago
|
||
Do you need review and approval to check in a comment only patch? I was under
the impression that mozilla.org was in desperate need of documentation and there
was blanket permission. (I could be wrong.)
Also, there is a typo at the end where "for" is spelled "fore". Other than that
it looks good to me.
Keywords: review
Comment 3•23 years ago
|
||
Comment on attachment 90967 [details] [diff] [review]
patch to add comments explaining the code
Ah, yes... this code.. ;)
s/fore/for/ as Mike said, and sr=bzbarsky.
Attachment #90967 -
Flags: superreview+
| Assignee | ||
Comment 4•23 years ago
|
||
Fix checked into trunk, 2002-08-06 06:46 PDT.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 5•22 years ago
|
||
this does look like a code level verification
Whiteboard: [patch] → [patch][whitebox]
You need to log in
before you can comment on or make changes to this bug.
Description
•