Skip to content

Commit

Permalink
Add 32bit casts
Browse files Browse the repository at this point in the history
  • Loading branch information
DieKautz committed Feb 9, 2024
1 parent 6eae7fc commit 0a657e2
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ private long fetchIntegerofObject(final long fieldIndex, final long objectPointe
}

private long fetchLong32ofObject(final long fieldIndex, final long oop) {
return fetchIntegerofObject(fieldIndex, oop);
return (int) fetchIntegerofObject(fieldIndex, oop);
}

private long fetchPointerofObject(final long index, final long oop) {
Expand Down Expand Up @@ -598,21 +598,15 @@ private long popthenPush(final long nItems, final long oop) {
}

private long positive32BitIntegerFor(final long integerValue) {
/* TODO */
LogUtils.PRIMITIVES.warning(() -> "Missing implementation for positive32BitIntegerFor: " + integerValue);
return returnVoid();
return integerObjectOf(integerValue & Integer.MAX_VALUE);
}

private long positive32BitValueOf(final long oop) {
/* TODO */
LogUtils.PRIMITIVES.warning(() -> "Missing implementation for positive32BitValueOf: " + oop);
return returnVoid();
return integerValueOf(oop) & Integer.MAX_VALUE;
}

private long positive64BitValueOf(final long oop) {
/* TODO */
LogUtils.PRIMITIVES.warning(() -> "Missing implementation for positive64BitValueOf: " + oop);
return returnVoid();
return Math.abs(integerValueOf(oop));
}

private long primitiveFail() {
Expand Down Expand Up @@ -649,11 +643,11 @@ private long showDisplayBitsLeftTopRightBottom(final long aFormOop, final long l
}

private long signed32BitIntegerFor(final long integerValue) {
return integerObjectOf(integerValue);
return integerObjectOf((int) integerValue);
}

private long signed32BitValueOf(final long oop) {
return integerValueOf(oop);
return (int) integerValueOf(oop);
}

private long slotSizeOf(final long oop) {
Expand Down

0 comments on commit 0a657e2

Please sign in to comment.