Skip to content

Commit

Permalink
Fix loophole warning on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
demoitem committed Nov 20, 2020
1 parent 9fb432d commit 2c6780b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions m3-libs/libm3/src/hash/MD5.m3
Original file line number Diff line number Diff line change
Expand Up @@ -270,18 +270,15 @@ PROCEDURE Update(ctrl: RefMD5Control; bufLen : CARDINAL; buf : RefBlock) =

PROCEDURE LengthBlock(ctrl : RefMD5Control) : RefBlock =
VAR
length : LONGINT;
len64 : Int64On32;
buf : RefBlock;
BEGIN
buf := NEW(RefBlock,8);
length := VAL(ctrl.length + ctrl.bufLen,LONGINT) * 8L;
len64 := LOOPHOLE(VAL(ctrl.length + ctrl.bufLen,LONGINT) * 8L,Int64On32);
IF endian = Endian.Big THEN
len64 := LOOPHOLE(length,Int64On32);
len64 := Swap8(len64);
length := LOOPHOLE(len64,LONGINT);
END;
buf^ := LOOPHOLE(length,ARRAY[0..7] OF Byte);
buf^ := LOOPHOLE(len64,ARRAY[0..7] OF Byte);
RETURN buf;
END LengthBlock;

Expand Down Expand Up @@ -387,4 +384,4 @@ PROCEDURE DC(a,b,c,d : Uint32) =

BEGIN
endian := GetEndian();
END MD5.
END MD5.

0 comments on commit 2c6780b

Please sign in to comment.