Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
2. Dez 2013
Today I confused keys, because my brain is overloaded with obscure C syntax :(
Yes. But on the other hand code is written by professional, I'll try contact him.
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
2. Dez 2013
I completely don't understand what for is type casts from byte :o Variables whare are moved results can store entire data without truncating or something alse. What do you think?
Ord() is used, because AValue is string, I plan change it to TBytes.
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
2. Dez 2013
It mean if case 11 then process all, if 10 than all instead above, etc.?
And what about rest operations? Indexes are valid? 256 multiply is required?
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
2. Dez 2013
If I remember in C and similar || and && is Boolean arithmetic, but | and & is for bits. In Delphi and/or is applicateble for both (compiler decide real meaning), so "|" really mean "or" or need some additional tricks?
@DeddyH, you was first :D, thanks :)
So, my code is ok?
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
2. Dez 2013
Let's check original C and C# code:
unsigned jen_hash ( unsigned char *k, unsigned length, unsigned initval )
{
unsigned a, b;
unsigned c = initval;
unsigned len = length;
a = b = 0x9e3779b9;