Closed
Bug 552999
Opened 16 years ago
Closed 16 years ago
PointerType.prototype.isNull
Categories
(Core :: js-ctypes, defect, P1)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jorendorff, Assigned: jdm)
Details
Attachments
(1 file, 1 obsolete file)
|
5.98 KB,
patch
|
dwitte
:
review+
|
Details | Diff | Splinter Review |
<jorendorff> dwitte: what's the easiest way to find out if the value of
a pointer CData object is null?
<dwitte> ctypes.cast(obj, ctypes.uintptr_t).value.toString() == "0"
<dwitte> we should probably do .isNull() :)
Comment 1•16 years ago
|
||
P1, need this for 1.9.3. Trivial API addition and should be quite useful for devs.
Priority: -- → P1
| Assignee | ||
Updated•16 years ago
|
Attachment #435453 -
Flags: review?(dwitte)
Comment 3•16 years ago
|
||
Comment on attachment 435453 [details] [diff] [review]
isNull implementation + tests
Looks good, but I think we want isNull() to be a function, not a property.
You'll need to add an sPointerInstanceFunctions, and then add that to the appropriate bits through the code. Should be trivial.
(Don't forget to add isNull() to the type ctor tests at http://mxr.mozilla.org/mozilla-central/source/js/ctypes/tests/unit/test_jsctypes.js.in#1570.)
| Assignee | ||
Comment 4•16 years ago
|
||
All comments addressed.
Attachment #435453 -
Attachment is obsolete: true
Attachment #435500 -
Flags: review?(dwitte)
Attachment #435453 -
Flags: review?(dwitte)
Comment 5•16 years ago
|
||
Comment on attachment 435500 [details] [diff] [review]
isNull implementation + tests v1.1
Cool beans!
Attachment #435500 -
Flags: review?(dwitte) → review+
| Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Comment 7•16 years ago
|
||
Comment on attachment 435500 [details] [diff] [review]
isNull implementation + tests v1.1
http://hg.mozilla.org/mozilla-central/rev/8c0fdd9ca7dd
Updated•16 years ago
|
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•