bodensx / jnaerator

Automatically exported from code.google.com/p/jnaerator
0 stars 0 forks source link

Downcast for integral types under int #80

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by rsle...@gmail.com on 18 Feb 2011 at 2:56

GoogleCodeExporter commented 8 years ago
Hi again,

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

Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 18 Feb 2011 at 5:18

GoogleCodeExporter commented 8 years ago
Hi,
This issue moved to Github :
https://github.com/ochafik/nativelibs4java/issues/96

Thanks for not updating this page anymore and adding further comments on Github.
Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 1 Sep 2011 at 7:20