Closed
Bug 777074
Opened 14 years ago
Closed 14 years ago
dictionary_helper_gen.py doesn't handle 'unsigned long' types
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
People
(Reporter: mikeh, Assigned: smaug)
References
Details
Attachments
(2 files, 4 obsolete files)
|
1.46 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
|
4.71 KB,
patch
|
Details | Diff | Splinter Review |
Steps to reproduce:
1. edit an IDL to include a dictionary with 'unsigned long' types, e.g.:
dictionary Foo {
unsigned long bar;
};
2. modify dictionary_helper_gen.conf to include your IDL;
3. make
Expected behaviour: should handle unsigned long types.
Observed behaviour:
Traceback (most recent call last):
File "/home/mikeh/dev/mozilla/btg011/gecko/config/pythonpath.py", line 56, in <module>
main(sys.argv[1:])
File "/home/mikeh/dev/mozilla/btg011/gecko/config/pythonpath.py", line 48, in main
execfile(script, frozenglobals)
File "/home/mikeh/dev/mozilla/btg011/gecko/js/xpconnect/src/dictionary_helper_gen.py", line 464, in <module>
print_cpp_file(outfd, conf)
File "/home/mikeh/dev/mozilla/btg011/gecko/js/xpconnect/src/dictionary_helper_gen.py", line 247, in print_cpp_file
print_cpp(idl, fd, conf, d[0], dicts)
File "/home/mikeh/dev/mozilla/btg011/gecko/js/xpconnect/src/dictionary_helper_gen.py", line 188, in print_cpp
write_cpp(p, fd)
File "/home/mikeh/dev/mozilla/btg011/gecko/js/xpconnect/src/dictionary_helper_gen.py", line 401, in write_cpp
write_getter(a, iface, fd)
File "/home/mikeh/dev/mozilla/btg011/gecko/js/xpconnect/src/dictionary_helper_gen.py", line 341, in write_getter
raise BaseException("Unsupported type %s found in dictionary %s" % (realtype, iface.name))
BaseException: Unsupported type PRUint32 found in dictionary Dimensions
make[7]: *** [DictionaryHelpers.cpp] Error 1
make[7]: *** Deleting file `DictionaryHelpers.cpp'
make[6]: *** [libs] Error 2
make[5]: *** [libs_tier_platform] Error 2
make[4]: *** [tier_platform] Error 2
make[3]: *** [default] Error 2
make[2]: *** [realbuild] Error 2
make[1]: *** [build] Error 2
Note: signed 'long' works fine.
| Assignee | ||
Comment 1•14 years ago
|
||
| Assignee | ||
Comment 2•14 years ago
|
||
| Assignee | ||
Updated•14 years ago
|
Attachment #645502 -
Attachment is obsolete: true
| Assignee | ||
Comment 3•14 years ago
|
||
Btw, this stuff used to work when dictionaries used XPCOM stuff.
| Assignee | ||
Comment 4•14 years ago
|
||
At least it compiles :)
Assignee: nobody → bugs
Attachment #645513 -
Flags: review?(khuey)
| Reporter | ||
Comment 5•14 years ago
|
||
Compiles and runs as expected.
Comment 6•14 years ago
|
||
> + elif realtype.count("PRUint32"):
> + fd.write(" uint32_t u;\n")
> + fd.write(" NS_ENSURE_STATE(JS_ValueToECMAUint32(aCx, v, &u));\n")
> + fd.write(" aDict.%s = u;\n" % a.name)
You can pass |aDict.%s| directly to JS_ValueToECMAUint32 instead of using a temporary variable.
https://mxr.mozilla.org/mozilla-central/source/js/xpconnect/src/XPCConvert.cpp?rev=0581a34dde2a#412
| Assignee | ||
Comment 7•14 years ago
|
||
emk, want to upload such patch? I could review it immediately ;)
Comment 8•14 years ago
|
||
Sorry, I'm about to go out. Plaese create a patch yourself.
| Assignee | ||
Comment 9•14 years ago
|
||
Attachment #645508 -
Attachment is obsolete: true
Attachment #645513 -
Attachment is obsolete: true
Attachment #645513 -
Flags: review?(khuey)
Attachment #645561 -
Flags: review?(khuey)
| Assignee | ||
Comment 10•14 years ago
|
||
Comment on attachment 645561 [details] [diff] [review]
patch
too hard to get this 2 line patch right :/
Attachment #645561 -
Attachment is obsolete: true
Attachment #645561 -
Flags: review?(khuey)
| Assignee | ||
Comment 11•14 years ago
|
||
Attachment #645562 -
Flags: review?(khuey)
Attachment #645562 -
Flags: review?(khuey) → review+
| Assignee | ||
Comment 12•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 13•14 years ago
|
||
Attachment #645936 -
Flags: feedback?(khuey)
Attachment #645936 -
Flags: feedback?(bzbarsky)
| Assignee | ||
Comment 14•14 years ago
|
||
Comment on attachment 645936 [details] [diff] [review]
idl file using dictionaries
Wrong bug?
Comment 15•14 years ago
|
||
Comment on attachment 645936 [details] [diff] [review]
idl file using dictionaries
interns :)
Attachment #645936 -
Flags: feedback?(khuey)
Attachment #645936 -
Flags: feedback?(bzbarsky)
Comment 16•14 years ago
|
||
wrong bug, sorry about that
You need to log in
before you can comment on or make changes to this bug.
Description
•