AeroEng43 / shedskin

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

int/double conversion when initializing an array #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The attached program gives different output when run from python and when
run under shedskin.

An array of doubles is initialized with an integer, and the type conversion
doesn't work correctly.

It appears to be a problem with variadic functions and type conversions (in
the list constructor).  See the attached vatest.cpp file.

One possible solution is to add explicit casts in the constructor call, eg
  charges = (new list<double>(1,(double)6));

Original issue reported on code.google.com by markdew...@gmail.com on 7 Feb 2008 at 1:18

Attachments:

GoogleCodeExporter commented 8 years ago
hi mark,

thanks for noting this problem, and the proper solution. I will go over all 
variadic
functions and add casts where necessary before the next release :)

note that the code you comment out with 'this (correctly) doesn't compile' 
could be
made to compile, too, by converting the integer list to a double list at 
run-time..

Original comment by mark.duf...@gmail.com on 8 Feb 2008 at 11:31

GoogleCodeExporter commented 8 years ago
I commited a fix for this to SVN. can you please verify this works for you?

Original comment by mark.duf...@gmail.com on 9 Feb 2008 at 5:40

GoogleCodeExporter commented 8 years ago
The fix in SVN works for me.

Original comment by markdew...@gmail.com on 10 Feb 2008 at 3:23

GoogleCodeExporter commented 8 years ago
great, thanks. closing this issue.

Original comment by mark.duf...@gmail.com on 10 Feb 2008 at 5:11