Page 1 of 1

Uint64 v1.1 lib! (was: bug in UInt64 lib)

Posted: Mon Mar 28, 2005 1:11 pm
by Rescator
In the archiver I'm making I had to do this trick:

Code: Select all

Procedure.s int64tostr(*int64val.LARGE_INTEGER) ; 64bit to string
 temp64.LARGE_INTEGER ;this "hack" is needed cause Unint64 function is bugged
 temp64\LowPart=*int64val\LowPart ;it "eats" up the referenced int64, leaving it 0 sometimes.
 temp64\HighPart=*int64val\HighPart
ProcedureReturn UInt64_str(temp64)
EndProcedure
any clue why I have to do this Rings?
My only guess is that the libs UInt64_str() routine has a bug,
I did some more tests and it seems that it eat up the value given in the argument, leaving it zero.
This especially becomes apparent if it is used multiple times.

I'm pretty sure it's not my own archiver code,
as simply replacing the direct use of UInt64_str() with my wrapper above
fixes the issue,
but if you could find out what causes it that would be great,
as I'd prefer to not have to use a wrapper.
The library is fine otherwise (though I miss the syntax useage hints hehe...

Posted: Tue Mar 29, 2005 9:21 am
by Rings
have you ever tooked a look into the source of the uint lib ?
its free and i'm not the orginal autor of it.
So feel free to debug it and fix the error your found.
Sorry to say that, but i cannot investigate more time in this.
You can change and compile the lib with PellesC (Free one).
And as far as i know, the UNIT is only a wrap from the original C-runtinelib for UINTS .

Posted: Tue Mar 29, 2005 12:46 pm
by Rescator
PellesC hmm. Yeah I might do that!
I haven't studied your C code that much, but at a glance
I don't see whats wrong or not.
But if I'm able to fix it I'll post my findings obviously so you can release a update if needed :)

Any special compile flags needed?
Or rather, what is the compile flags you used for it.

Posted: Tue Mar 29, 2005 2:25 pm
by Rings
Rescator wrote: Any special compile flags needed?
Or rather, what is the compile flags you used for it.
there is a pellesC project file, everything included

Posted: Wed Mar 30, 2005 1:36 am
by Rescator
Hey Rings, I'm done with the updated/new v1.1 of UInt64 lib.
v1.0 - Rings

Initial release.

------------------------------------
v1.1 - Rescator

Minor update!

"Example\UInt64_Test.pb"
- Changed the example to use the standard LARGE_INTEGER instead.

"C_Source\"
- New project files!

"C_Source\UInt64.Desc"
- Added usage hints!

"C_Source\UInt64.c"
- Remade the UInt64_str() with alternative code,
smaller and hopefully faster, and should fix a potential bug
where the referenced uint64 val could end up set to 0

"PureLibraries\"
- v1.1 build.
Rings, could you look it over (if you want to, if so let me know how to send it to you) and give it a thumbs up hopefully,
and then um... how do one submit stuff to Purearea?

Posted: Wed Mar 30, 2005 7:45 am
by Rings
I'm out of house today, but maybe you can contact me on irc the evening.
I would include your work for a new release.
thx

Posted: Wed Mar 30, 2005 1:55 pm
by Andre
Rescator wrote:...and then um... how do one submit stuff to Purearea?
Hehe :lol:

Hm, beside the Showcase on http://www.PureArea.net, where you can release your PB work yourself:

I'm usually scanning the forum myself for new user-library updates. But if you want to make my life easier send me a mail (not a PM, because I'm sometimes for more than 1 week not on the forum!) to andre -at- purebasic.com with a description + download link or attachment.
That's all :wink:

Posted: Wed Mar 30, 2005 2:03 pm
by Rescator
I'll wait to see what Rings says first, this is a derivative work of his code after all.
So I'm kinda using him as the Uint64 co-ordinator :P

Posted: Wed Mar 30, 2005 7:36 pm
by jack
Rings wrote:have you ever tooked a look into the source of the uint lib ?
its free and i'm not the orginal autor of it.
So feel free to debug it and fix the error your found.
Actually the author is Tim Tuvell aka upnorth :wink:

Posted: Wed Mar 30, 2005 8:04 pm
by Rings
jack wrote:
Rings wrote:have you ever tooked a look into the source of the uint lib ?
its free and i'm not the orginal autor of it.
So feel free to debug it and fix the error your found.
Actually the author is Tim Tuvell aka upnorth :wink:
i put a notice in the credits for sure :)
.....
done