Closed
Bug 305278
Opened 20 years ago
Closed 19 years ago
plevent.h gives bad advice
Categories
(Core :: XPCOM, defect, P2)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: dbaron, Assigned: dbaron)
Details
(Whiteboard: [patch])
Attachments
(2 files)
1.81 KB,
patch
|
dougt
:
review+
|
Details | Diff | Splinter Review |
56.11 KB,
patch
|
dougt
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
The comment in plevent.h gives bad advice in two ways:
* it recommends using casts when none should be needed, and the habit of using
them can cover up real bugs
* it omits PR_CALLBACK in the example handlers, which would break any build
that defines it to something interesting (e.g., the OS/2 VisualAge build)
I'm more concerned about the first, really.
Assignee | ||
Updated•20 years ago
|
Severity: normal → trivial
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: [patch]
Target Milestone: --- → mozilla1.9alpha
Assignee | ||
Comment 1•20 years ago
|
||
Attachment #193237 -
Flags: review?(dougt)
Comment 2•20 years ago
|
||
Comment on attachment 193237 [details] [diff] [review]
patch
the change to the example is that you are now droping the |static| keyword
(that is what PR_STATIC_CALLBACK gave you).
Do you want to run through the tree and try to remove the casts?
Attachment #193237 -
Flags: review?(dougt) → review+
Comment 3•20 years ago
|
||
Actually, I'm more concerned that the example never had the static keyword.
I'll remove some of the casts and see what it does to the OS/2 build.
Note we don't build VisualAge Mozilla anymore - we are GCC only.
Assignee | ||
Comment 4•20 years ago
|
||
Having static is nice, but not important -- it just makes the function have
internal linkage, so the name isn't exposed to anything outside the file in
which it lives.
Assignee | ||
Comment 5•19 years ago
|
||
Comment on attachment 193237 [details] [diff] [review]
patch
Checked in to trunk.
Assignee | ||
Comment 6•19 years ago
|
||
So I missed one thing in the comment -- the argument type. I still think it's far better this way. Note the number of callers who passed a function returning void in place of one returning void* (not harmful in this case, but a very bad habit).
Attachment #202839 -
Flags: superreview?(darin)
Attachment #202839 -
Flags: review?(dougt)
Comment 7•19 years ago
|
||
Comment on attachment 202839 [details] [diff] [review]
patch to correct callers (and re-correct comment)
sr=darin
Attachment #202839 -
Flags: superreview?(darin) → superreview+
Updated•19 years ago
|
Attachment #202839 -
Flags: review?(dougt) → review+
Assignee | ||
Comment 8•19 years ago
|
||
Fix checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•