[Bug 198829] Review Request: wfmath - WorldForge math libraries

bugzilla at redhat.com bugzilla at redhat.com
Wed Jul 19 07:50:06 UTC 2006


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug report.

Summary: Review Request: wfmath - WorldForge math libraries
Alias: wfmath

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=198829


j.w.r.degoede at hhs.nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |j.w.r.degoede at hhs.nl




------- Additional Comments From j.w.r.degoede at hhs.nl  2006-07-19 03:41 EST -------
I saw the long list of review request for worldforge, so I thought I would give
a hand. But as usual you guys (Chris this time) have beaten my to it.

So I saw this 64bit problem and I thought I would/could give a hand. The test
fails because of 2 problems

1) wfmath/MersenneTwister.h, line 77 says:
 typedef unsigned long uint32;  // unsigned integer type, at least 32 bits
 Which is strange, because you would expect a uint32 to be 32 bits period,
 I've reviewed the rest of the code and it seems to assume 32bits everywhere/
 never return random values larger then 32 bit, so I believe this should be 
 changed to:
 typedef unsigned int uint32;
 This makes things work out as the name suggests and will also be faster since
 32 bit values are faster then 64 bit (even on x86_64).
2) wfmath/intstring_test.cpp, second test uses a long to restore the unsigned
 long value of the random function. The idea here is to cause negative numbers
 for 2^31 unsigned long numbers to test negative conversion however > 2 ^ 31 
 will fit fine in the long on 64 bits, without becoming a negative number.
 Next this long is passed to IntToString, who correctly converts this to a
 string holding a large (> 2 ^ 31) positive number, after which the string
 gets passed to atoi. However atoi returns an int which cannot represent this
 bug a positive number > caboom!

 Fix use (unsigned) int 's in the test instead of long's.


-- 
Configure bugmail: https://bugzilla.redhat.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.




More information about the Fedora-package-review mailing list