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

Everything else that doesn't fall into one of the other PB categories.
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

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

Post 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...
Last edited by Rescator on Wed Mar 30, 2005 1:37 am, edited 1 time in total.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post 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 .
SPAMINATOR NR.1
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post 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.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post 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
SPAMINATOR NR.1
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post 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?
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post 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
SPAMINATOR NR.1
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2148
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post 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:
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

Post 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
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post 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:
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post 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
SPAMINATOR NR.1
Post Reply