Skip to content

Commit

Permalink
8286398: Address possibly lossy conversions in jdk.internal.le
Browse files Browse the repository at this point in the history
Backport-of: e534c133af9bcefb073a336f1fdc0dc226a9dd82
  • Loading branch information
GoeLin committed May 8, 2023
1 parent 8c54104 commit 05f1562
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -183,34 +183,34 @@ protected void processEraseLine(int eraseOption) throws IOException {
protected void processCursorUpLine(int count) throws IOException {
getConsoleInfo();
info.dwCursorPosition.X = 0;
info.dwCursorPosition.Y -= count;
info.dwCursorPosition.Y -= (short)count;
applyCursorPosition();
}

protected void processCursorDownLine(int count) throws IOException {
getConsoleInfo();
info.dwCursorPosition.X = 0;
info.dwCursorPosition.Y += count;
info.dwCursorPosition.Y += (short)count;
applyCursorPosition();
}

protected void processCursorLeft(int count) throws IOException {
getConsoleInfo();
info.dwCursorPosition.X -= count;
info.dwCursorPosition.X -= (short)count;
applyCursorPosition();
}

protected void processCursorRight(int count) throws IOException {
getConsoleInfo();
info.dwCursorPosition.X += count;
info.dwCursorPosition.X += (short)count;
applyCursorPosition();
}

protected void processCursorDown(int count) throws IOException {
getConsoleInfo();
int nb = Math.max(0, info.dwCursorPosition.Y + count - info.dwSize.Y + 1);
if (nb != count) {
info.dwCursorPosition.Y += count;
info.dwCursorPosition.Y += (short)count;
applyCursorPosition();
}
if (nb > 0) {
Expand All @@ -226,7 +226,7 @@ protected void processCursorDown(int count) throws IOException {

protected void processCursorUp(int count) throws IOException {
getConsoleInfo();
info.dwCursorPosition.Y -= count;
info.dwCursorPosition.Y -= (short)count;
applyCursorPosition();
}

Expand Down

1 comment on commit 05f1562

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.