Closed GoogleCodeExporter closed 8 years ago
Hello,
Thanks a lot for your detailed report and investigation, this is much
appreciated !
I'll look into this asap... In the meanwhile, have you tried some of the
command line options that affect parsing, such as -parseInOneChunk
(http://code.google.com/p/jnaerator/wiki/CommandLineOptionsAndEnvironmentVariabl
es) ?
Cheers
--
zOlive
Original comment by olivier.chafik@gmail.com
on 30 Aug 2011 at 1:12
I did more debugging on this.
For issue 1 the problem is the anonymous/unnamed enum.
It seems like we store the enums in a Hash as enumsByName in Result.java:
public Map<Identifier, Enum> enumsByName = new HashMap<Identifier, Enum>();
Then we check if the enum already exists:
Identifier name = e.getTag();
Enum oldEnum = enumsByName.get(name);
if (oldEnum == null || oldEnum.isForwardDeclaration() || (!(oldEnum.getParentElement() instanceof TypeDef) && oldEnum.getParentElement() instanceof TypeDef)) {
before we add the enum to the list. In the case of my enums the name is 'null'
and there are multiple in the file. This means only the first 'null' named enum
makes it into enumByName and enumByLibrary.
In a pinch I moved this:
getList(enumsByLibrary, lib).add(e);
Outside of the 'if' statement to make sure it's added to the enums list even if
it exists in the hash.
This works for me.
Original comment by crobe...@bongle.co.uk
on 30 Aug 2011 at 1:14
Okay, this worked to get all the enums built with my parsed copy. But the cast
still doesn't work:
((cpresult)(_code))
Original comment by crobe...@bongle.co.uk
on 30 Aug 2011 at 6:44
Hello,
Thanks for your continued input !
I've committed a fix (deployed as 0.9.9-SNAPSHOT on Maven) for the anonymous
enums inspired by your suggestion, along with fixes in the way enum items refer
to other items with the BridJ runtime target :
https://github.com/ochafik/nativelibs4java/commit/0212fdde787b58ad3912950939fd42
6b20a09c9c
I'll now look into the other problems you've reported :-)
Cheers
--
zOlive
Original comment by olivier.chafik@gmail.com
on 31 Aug 2011 at 8:52
Hi again,
Problem 2) was indeed fixed in 0.9.8
(https://github.com/ochafik/nativelibs4java/commit/f54523bb35d8a41262842eca17944
1491c62a32d), and I've just deployed a fix for problem 3) :
https://github.com/ochafik/nativelibs4java/commit/6a1d485bcad138d854aaf09c62c2e2
ada1f0a61b
Thanks again for your help !
Cheers
--
zOlive
Original comment by olivier.chafik@gmail.com
on 31 Aug 2011 at 11:12
Original issue reported on code.google.com by
crobe...@bongle.co.uk
on 30 Aug 2011 at 6:16