New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace use of Cardinal with other types where necessary #10
Comments
I'm not sure if So some code like the following in {$IF not Declared(NativeUInt) }
type
NativeUInt = Cardinal;
{$IFEND} Will need to check the above syntax because I'm rusty on it and away don't have Delphi available to check. |
Check original C code to check where |
This could get very buggy very quickly. Maybe leave the programs as 32 bit for now? |
Examination of the original C source code suggests that all bdiff/Src/BDiff/UBlockSort.pas Line 20 in 464fe21
were substituted for |
All Line 28 in 464fe21
would seem to be But the type of the |
The Line 16 in 464fe21
needs to be |
All bdiff/Src/BDiff/UPatchWriters.pas Line 10 in 464fe21
replaced bdiff/Src/BDiff/UPatchWriters.pas Line 46 in 464fe21
|
Should bdiff/Src/BPatch/UBPatchUtils.pas Line 30 in 464fe21
have its |
Maybe This is because the binary file header stores file sizes in 4 bytes. In BPatch, file sizes are stored in ❓ Should BDiff and BPatch refuse to handle files larger than |
To be consistent with BDiff, Line 19 in 464fe21
should possibly have its Furthermore the type of the method's |
All length related variables in Line 60 in 464fe21
are |
There's a similar inconsistency with the Line 31 in 464fe21
|
Consideration of Delphi XE now irrelevant since updated to Delphi 11. (Issue #12) |
Some uses of I'm choosing |
This is the approach I'm taking. Reviewing all used of Cardinal and deciding to replace with either |
Implemented by merge commit aa57c8d |
BDiff uses
Cardinal
wherever the original C code usedsize_t
.This is fine for 32 bit code, where both types are 32 bit, but
size_t
is 64 bit on 64 bit compilers whereasCardinal
remains 32 bit.So it could be a good idea to replace
Cardinal
withNativeUInt
, which changes size likesize_t
depending on the native word size.This isn't necessary if BDiff is to remain 32 bit, and is not sufficient if BDiff moves to 64 bit, but it will help to smooth the transition if it is made.
The text was updated successfully, but these errors were encountered: