X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=int64.c;h=7997114aefde667a2e58ce3535feff1b1d487eda;hb=382ffaf0262c8b552cf5bd32dbf922ceacbf921d;hp=da7b4c3b2ae0e28f669217bd8fb67f47cf63e40a;hpb=3730ada5ce457468441b32d7e84157e481b8ba75;p=PuTTY.git diff --git a/int64.c b/int64.c index da7b4c3b..7997114a 100644 --- a/int64.c +++ b/int64.c @@ -5,10 +5,9 @@ */ #include +#include -typedef struct { - unsigned long hi, lo; -} uint64, int64; +#include "int64.h" uint64 uint64_div10(uint64 x, int *remainder) { @@ -69,3 +68,12 @@ uint64 uint64_add32(uint64 x, unsigned long y) yy.lo = y; return uint64_add(x, yy); } + +int uint64_compare(uint64 x, uint64 y) +{ + if (x.hi != y.hi) + return x.hi < y.hi ? -1 : +1; + if (x.lo != y.lo) + return x.lo < y.lo ? -1 : +1; + return 0; +}