Martin Koeppe wrote:
yes, but I prefer a native Windows build because I need it on many different 
boxes and only occasionally on one particular box. And all of the boxes don't 
have cygwin installed.

Of course you are free to port ddrescue to windows.


Why? As I could see, one block is filled by one readblock(),

A small block, split from a larger block, is filled by a call to readblock. The result is then joined to the coreresponding larger block. Both larger blocks can have sizes larger than 32 bits. This is why the ddrescue logfile is so efficient.


However, I saw a use of -1 in the size_ field.

-1 means undefined size. It was used for devices of unknown size.


Where exactly does it break? I can make a new version, if you like.

For example where it moves "#define _FILE_OFFSET_BITS 64" to "os.h" and then includes "os.h" after cstdio. This makes ddrescue unable to read files larger than 2 GiB on 32 bit systems.

But please, don't send a new version. I do not accept patches with windows-specific code.


I think that in all loops such as
for (i=0; i<vector<>::size(); i++)
i should be of the same type as size() returns. That's not int and not unsigned 
int either, but size_t.

If the size never exceeds what an unsigned int can contain, why should I use size_t?


Every index access, i.e. anything within [] should be of type size_t, or at 
least unsigned.

Why? AFAIK, negative indices are generally valid as long as array limits are not surpassed, being p[-1] equivalent to *(p-1).


Regards,
Antonio.


_______________________________________________
Bug-ddrescue mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-ddrescue

Reply via email to