Skip to content

Commit

Permalink
Add final modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavo committed Sep 29, 2023
1 parent ac90491 commit edcde6b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
20 changes: 10 additions & 10 deletions src/main/java/org/fusesource/jansi/ffm/Kernel32.java
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) {
static final MethodHandle _get_osfhandle$MH =
downcallHandle("_get_osfhandle", FunctionDescriptor.of(C_POINTER$LAYOUT, C_INT$LAYOUT));

public static class INPUT_RECORD {
public static final class INPUT_RECORD {
static final MemoryLayout LAYOUT = MemoryLayout.structLayout(
ValueLayout.JAVA_SHORT.withName("EventType"),
MemoryLayout.unionLayout(
Expand Down Expand Up @@ -446,7 +446,7 @@ public FOCUS_EVENT_RECORD focusEvent() {
}
}

public static class MENU_EVENT_RECORD {
public static final class MENU_EVENT_RECORD {

static final GroupLayout LAYOUT = MemoryLayout.structLayout(C_DWORD$LAYOUT.withName("dwCommandId"));
static final VarHandle COMMAND_ID = varHandle(LAYOUT, "dwCommandId");
Expand All @@ -466,7 +466,7 @@ public void commandId(int commandId) {
}
}

public static class FOCUS_EVENT_RECORD {
public static final class FOCUS_EVENT_RECORD {

static final GroupLayout LAYOUT = MemoryLayout.structLayout(C_BOOL$LAYOUT.withName("bSetFocus"));
static final VarHandle SET_FOCUS = varHandle(LAYOUT, "bSetFocus");
Expand All @@ -490,7 +490,7 @@ public void setFocus(boolean setFocus) {
}
}

public static class WINDOW_BUFFER_SIZE_RECORD {
public static final class WINDOW_BUFFER_SIZE_RECORD {

static final GroupLayout LAYOUT = MemoryLayout.structLayout(COORD.LAYOUT.withName("size"));
static final long SIZE_OFFSET = byteOffset(LAYOUT, "size");
Expand All @@ -510,7 +510,7 @@ public String toString() {
}
}

public static class MOUSE_EVENT_RECORD {
public static final class MOUSE_EVENT_RECORD {

private static final MemoryLayout LAYOUT = MemoryLayout.structLayout(
COORD.LAYOUT.withName("dwMousePosition"),
Expand Down Expand Up @@ -554,7 +554,7 @@ public String toString() {
}
}

public static class KEY_EVENT_RECORD {
public static final class KEY_EVENT_RECORD {

static final MemoryLayout LAYOUT = MemoryLayout.structLayout(
JAVA_INT.withName("bKeyDown"),
Expand Down Expand Up @@ -616,7 +616,7 @@ public String toString() {
}
}

public static class CHAR_INFO {
public static final class CHAR_INFO {

static final GroupLayout LAYOUT = MemoryLayout.structLayout(
MemoryLayout.unionLayout(C_WCHAR$LAYOUT.withName("UnicodeChar"), C_CHAR$LAYOUT.withName("AsciiChar"))
Expand Down Expand Up @@ -646,7 +646,7 @@ public char unicodeChar() {
}
}

public static class CONSOLE_SCREEN_BUFFER_INFO {
public static final class CONSOLE_SCREEN_BUFFER_INFO {
static final GroupLayout LAYOUT = MemoryLayout.structLayout(
COORD.LAYOUT.withName("dwSize"),
COORD.LAYOUT.withName("dwCursorPosition"),
Expand Down Expand Up @@ -697,7 +697,7 @@ public void attributes(short attr) {
}
}

public static class COORD {
public static final class COORD {

static final GroupLayout LAYOUT =
MemoryLayout.structLayout(C_SHORT$LAYOUT.withName("x"), C_SHORT$LAYOUT.withName("y"));
Expand Down Expand Up @@ -745,7 +745,7 @@ public COORD copy(Arena arena) {
}
}

public static class SMALL_RECT {
public static final class SMALL_RECT {

static final GroupLayout LAYOUT = MemoryLayout.structLayout(
C_SHORT$LAYOUT.withName("Left"),
Expand Down
19 changes: 4 additions & 15 deletions src/main/java/org/fusesource/jansi/ffm/WindowsAnsiProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,8 @@ protected void processEraseScreen(int eraseOption) throws IOException {
(info.window().bottom() - info.cursorPosition().y())
* info.size().x()
+ (info.size().x() - info.cursorPosition().x());
FillConsoleOutputAttribute(
console,
info.attributes(),
lengthToEnd,
info.cursorPosition(),
written);
FillConsoleOutputCharacterW(
console, ' ', lengthToEnd, info.cursorPosition(), written);
FillConsoleOutputAttribute(console, info.attributes(), lengthToEnd, info.cursorPosition(), written);
FillConsoleOutputCharacterW(console, ' ', lengthToEnd, info.cursorPosition(), written);
break;
default:
break;
Expand Down Expand Up @@ -206,13 +200,8 @@ protected void processEraseLine(int eraseOption) throws IOException {
int lengthToLastCol =
info.size().x() - info.cursorPosition().x();
FillConsoleOutputAttribute(
console,
info.attributes(),
lengthToLastCol,
info.cursorPosition(),
written);
FillConsoleOutputCharacterW(
console, ' ', lengthToLastCol, info.cursorPosition(), written);
console, info.attributes(), lengthToLastCol, info.cursorPosition(), written);
FillConsoleOutputCharacterW(console, ' ', lengthToLastCol, info.cursorPosition(), written);
break;
default:
break;
Expand Down

0 comments on commit edcde6b

Please sign in to comment.