Files
EWF/library/crypto/eapml/facilities/special_comparison.e
jvelilla c9343688f3 Added eel and eapml in EWF libraries.
Removed them from gitmodule
2011-10-27 08:29:01 -03:00

40 lines
730 B
Plaintext

note
description: "Summary description for {NUMBER_COMPARISON}."
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote: "No nation was ever ruined by trade. - Benjamin Franklin"
deferred class
SPECIAL_COMPARISON
feature
cmp (op1: SPECIAL [NATURAL_32]; op1_offset: INTEGER; op2: SPECIAL [NATURAL_32]; op2_offset: INTEGER; size: INTEGER): INTEGER
local
i: INTEGER
x: NATURAL_32
y: NATURAL_32
do
Result := 0
from
i := size - 1
until
i < 0 or Result /= 0
loop
x := op1 [op1_offset + i]
y := op2 [op2_offset + i]
if x /= y then
if x > y then
Result := 1
else
Result := -1
end
end
i := i - 1
variant
i + 2
end
end
end