#6 ed2k_hash 64-bit Compatibility Patch

closed-fixed
nobody
None
5
2007-10-25
2006-05-19
Adam Dunn
No

This patch should fix operation of ed2k_hash on 64-bit
machines. Most 32-bit machines use ILP32 which means
int and long are both 32 bits, but IA64 and AMD64 use
LP64 which means int is 32 bits and long is 64 bits.
For more info, see
[http://www-128.ibm.com/developerworks/linux/library/l-port64.html]

The md4.h header incorrectly made the assumption that
long is 4 bytes, which is not true on LP64 machines.
This patch makes the UINT4 type an int, which is 32
bits (4 bytes) on both ILP32 and LP64 systems. The
patch has been tested on AMD64 with gcc 4.0.3 without
error, and on x86 with gcc 4.0.4 without regression.

Further testing may be required before considering this
patch stable.

Note: This patch will fail on MIPS64 systems, as MIPS
uses ILP64. The code prior to this patch will fail on
MIPS64 as well.

Discussion

  • Adam Dunn

    Adam Dunn - 2006-05-19

    Patch for AMD64 operation

     
  • Tim-Philipp Muller

    • status: open --> closed-fixed
     
  • Tim-Philipp Muller

    Logged In: YES
    user_id=583691
    Originator: NO

    Hmm, only been 18 months - didn't know anyone still used ed2k/ed2k_hash. Didn't get notifications about the pending patches either. Oh well, fixed in CVS, sorry about that:

    2007-10-25 uberdork

    Patch by: Dominik Mierzejewski <dominik greysector net> and Adam Dunn

    * ed2k_hash/md4.c (MD4Init):
    * ed2k_hash/md4.h (PROTOTYPES, POINTER, UINT2, UINT4, UINT4):
    Fix bug in MD4 calculation on platforms where sizeof(long) != 4,
    ie. x86-64 and most other 64-bit platforms (fixes #1491834).

    * ed2k_hash/cl_ui.c:
    * ed2k_hash/options.c:
    Include <string.h> to avoid compiler warnings.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks