GP-2931 remove UnsignedDataUtils

This commit is contained in:
dev747368 2022-12-16 16:59:47 +00:00
parent b707c2ea6b
commit 79875e0014
5 changed files with 18 additions and 579 deletions

View file

@ -18,7 +18,6 @@ package db;
import java.io.IOException;
import db.buffers.DataBuffer;
import generic.util.UnsignedDataUtils;
import ghidra.util.BigEndianDataConverter;
/**
@ -102,26 +101,22 @@ public class FixedField10 extends FixedField {
throw new UnsupportedOperationException("may only compare similar Field types");
}
FixedField10 f = (FixedField10) o;
if (hi8 != f.hi8) {
return UnsignedDataUtils.unsignedLessThan(hi8, f.hi8) ? -1 : 1;
int result = Long.compareUnsigned(hi8, f.hi8);
if (result == 0) {
result = Short.compareUnsigned(lo2, f.lo2);
}
if (lo2 != f.lo2) {
return UnsignedDataUtils.unsignedLessThan(lo2, f.lo2) ? -1 : 1;
}
return 0;
return result;
}
@Override
int compareTo(DataBuffer buffer, int offset) {
long otherHi8 = buffer.getLong(offset);
if (hi8 != otherHi8) {
return UnsignedDataUtils.unsignedLessThan(hi8, otherHi8) ? -1 : 1;
int result = Long.compareUnsigned(hi8, otherHi8);
if (result == 0) {
short otherLo2 = buffer.getShort(offset + 8);
result = Short.compareUnsigned(lo2, otherLo2);
}
short otherLo2 = buffer.getShort(offset + 8);
if (lo2 != otherLo2) {
return UnsignedDataUtils.unsignedLessThan(lo2, otherLo2) ? -1 : 1;
}
return 0;
return result;
}
@Override