Downcast for integral types under int #96

Closed
ochafik opened this Issue Sep 1, 2011 · 2 comments

Projects

None yet

1 participant

@ochafik
Member
ochafik commented Sep 1, 2011

For the following C declaration:

#define MAXBYTE ((BYTE) 0xff)

jnaerator 0.9.6 is writing:

public static final byte MAXBYTE = (255);

which causes a java syntax error, since the int 255 should be downcast to fit a byte. The following output fixes the problem:

public static final byte MAXBYTE = (byte) (255);

Please note that any integral type under int (char, byte, short) will suffer the same issue.

Google Code Info:
Issue #: 80
Author: rsle...@gmail.com
Created On: 2011-02-18T14:56:32.000Z
Closed On:

@ochafik ochafik was assigned Sep 1, 2011
@ochafik
Member
ochafik commented Sep 1, 2011

Hi again,

Thanks for this new report (hehe, nastier than the previous one ;-)).
Will investigate ASAP

Cheers

zOlive

Google Code Info:
Author: olivier.chafik
Created On: 2011-02-18T17:18:12.000Z

@ochafik
Member
ochafik commented Apr 14, 2012

Fixed in 0.9.10-SNAPSHOT

@ochafik ochafik closed this Apr 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment