Skip to content

Commit

Permalink
make get/setValue methods public on IntegerByRef types
Browse files Browse the repository at this point in the history
  • Loading branch information
fredszaq committed Jul 24, 2023
1 parent 2f48952 commit d8b3cfa
Show file tree
Hide file tree
Showing 31 changed files with 162 additions and 162 deletions.
4 changes: 2 additions & 2 deletions src/bindgen/language_backend/java_jna.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ fn write_integer_type<W: Write, F: FnOnce(&mut SourceWriter<W>)>(
out.close_brace(false);
out.new_line();
out.new_line();
write!(out, "{} getValue()", name);
write!(out, "public {} getValue()", name);
out.open_brace();
write!(
out,
Expand All @@ -221,7 +221,7 @@ fn write_integer_type<W: Write, F: FnOnce(&mut SourceWriter<W>)>(
out.close_brace(false);
out.new_line();
out.new_line();
write!(out, "void setValue({} value)", name);
write!(out, "public void setValue({} value)", name);
out.open_brace();
write!(out, "getPointer().{};", jna_underlying_type.set_method());
out.close_brace(false);
Expand Down
8 changes: 4 additions & 4 deletions tests/expectations/alias.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public StatusByReference(Pointer p) {
setPointer(p);
}

Status getValue() {
public Status getValue() {
return new Status(getPointer().getInt(0));
}

void setValue(Status value) {
public void setValue(Status value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -207,11 +207,11 @@ public UnitByReference(Pointer p) {
setPointer(p);
}

Unit getValue() {
public Unit getValue() {
return new Unit(getPointer().getInt(0));
}

void setValue(Unit value) {
public void setValue(Unit value) {
getPointer().setInt(0, value.intValue());
}

Expand Down
12 changes: 6 additions & 6 deletions tests/expectations/annotation.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public CByReference(Pointer p) {
setPointer(p);
}

C getValue() {
public C getValue() {
return new C(getPointer().getInt(0));
}

void setValue(C value) {
public void setValue(C value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -136,11 +136,11 @@ public FByReference(Pointer p) {
setPointer(p);
}

F getValue() {
public F getValue() {
return new F(getPointer().getInt(0));
}

void setValue(F value) {
public void setValue(F value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -174,11 +174,11 @@ public HByReference(Pointer p) {
setPointer(p);
}

H getValue() {
public H getValue() {
return new H(getPointer().getInt(0));
}

void setValue(H value) {
public void setValue(H value) {
getPointer().setInt(0, value.intValue());
}

Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/array.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public FooByReference(Pointer p) {
setPointer(p);
}

Foo getValue() {
public Foo getValue() {
return new Foo(getPointer().getInt(0));
}

void setValue(Foo value) {
public void setValue(Foo value) {
getPointer().setInt(0, value.intValue());
}

Expand Down
12 changes: 6 additions & 6 deletions tests/expectations/asserted_cast.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public HByReference(Pointer p) {
setPointer(p);
}

H getValue() {
public H getValue() {
return new H(getPointer().getInt(0));
}

void setValue(H value) {
public void setValue(H value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -93,11 +93,11 @@ public JByReference(Pointer p) {
setPointer(p);
}

J getValue() {
public J getValue() {
return new J(getPointer().getInt(0));
}

void setValue(J value) {
public void setValue(J value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -131,11 +131,11 @@ public KByReference(Pointer p) {
setPointer(p);
}

K getValue() {
public K getValue() {
return new K(getPointer().getInt(0));
}

void setValue(K value) {
public void setValue(K value) {
getPointer().setInt(0, value.intValue());
}

Expand Down
16 changes: 8 additions & 8 deletions tests/expectations/body.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public MyCLikeEnumByReference(Pointer p) {
setPointer(p);
}

MyCLikeEnum getValue() {
public MyCLikeEnum getValue() {
return new MyCLikeEnum(getPointer().getInt(0));
}

void setValue(MyCLikeEnum value) {
public void setValue(MyCLikeEnum value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -75,11 +75,11 @@ public MyCLikeEnum_PrependedByReference(Pointer p) {
setPointer(p);
}

MyCLikeEnum_Prepended getValue() {
public MyCLikeEnum_Prepended getValue() {
return new MyCLikeEnum_Prepended(getPointer().getInt(0));
}

void setValue(MyCLikeEnum_Prepended value) {
public void setValue(MyCLikeEnum_Prepended value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -143,11 +143,11 @@ public MyFancyEnumByReference(Pointer p) {
setPointer(p);
}

MyFancyEnum getValue() {
public MyFancyEnum getValue() {
return new MyFancyEnum(getPointer().getInt(0));
}

void setValue(MyFancyEnum value) {
public void setValue(MyFancyEnum value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -243,11 +243,11 @@ public MyFancyEnum_PrependedByReference(Pointer p) {
setPointer(p);
}

MyFancyEnum_Prepended getValue() {
public MyFancyEnum_Prepended getValue() {
return new MyFancyEnum_Prepended(getPointer().getInt(0));
}

void setValue(MyFancyEnum_Prepended value) {
public void setValue(MyFancyEnum_Prepended value) {
getPointer().setInt(0, value.intValue());
}

Expand Down
12 changes: 6 additions & 6 deletions tests/expectations/cfg.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public BarTypeByReference(Pointer p) {
setPointer(p);
}

BarType getValue() {
public BarType getValue() {
return new BarType(getPointer().getInt(0));
}

void setValue(BarType value) {
public void setValue(BarType value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -76,11 +76,11 @@ public FooTypeByReference(Pointer p) {
setPointer(p);
}

FooType getValue() {
public FooType getValue() {
return new FooType(getPointer().getInt(0));
}

void setValue(FooType value) {
public void setValue(FooType value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -149,11 +149,11 @@ public CByReference(Pointer p) {
setPointer(p);
}

C getValue() {
public C getValue() {
return new C(getPointer().getInt(0));
}

void setValue(C value) {
public void setValue(C value) {
getPointer().setInt(0, value.intValue());
}

Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/const_transparent.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public TransparentByReference(Pointer p) {
setPointer(p);
}

Transparent getValue() {
public Transparent getValue() {
return new Transparent(getPointer().getByte(0));
}

void setValue(Transparent value) {
public void setValue(Transparent value) {
getPointer().setByte(0, (byte)value.intValue());
}

Expand Down
8 changes: 4 additions & 4 deletions tests/expectations/constant_user_defined_type.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public EByReference(Pointer p) {
setPointer(p);
}

E getValue() {
public E getValue() {
return new E(getPointer().getInt(0));
}

void setValue(E value) {
public void setValue(E value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -100,11 +100,11 @@ public AByReference(Pointer p) {
setPointer(p);
}

A getValue() {
public A getValue() {
return new A(getPointer().getByte(0));
}

void setValue(A value) {
public void setValue(A value) {
getPointer().setByte(0, (byte)value.intValue());
}

Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/decl_name_conflicting.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public BindingTypeByReference(Pointer p) {
setPointer(p);
}

BindingType getValue() {
public BindingType getValue() {
return new BindingType(getPointer().getInt(0));
}

void setValue(BindingType value) {
public void setValue(BindingType value) {
getPointer().setInt(0, value.intValue());
}

Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/derive_eq.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ public BarByReference(Pointer p) {
setPointer(p);
}

Bar getValue() {
public Bar getValue() {
return new Bar(getPointer().getInt(0));
}

void setValue(Bar value) {
public void setValue(Bar value) {
getPointer().setInt(0, value.intValue());
}

Expand Down
16 changes: 8 additions & 8 deletions tests/expectations/derive_ostream.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public CByReference(Pointer p) {
setPointer(p);
}

C getValue() {
public C getValue() {
return new C(getPointer().getInt(0));
}

void setValue(C value) {
public void setValue(C value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -170,11 +170,11 @@ public FByReference(Pointer p) {
setPointer(p);
}

F getValue() {
public F getValue() {
return new F(getPointer().getInt(0));
}

void setValue(F value) {
public void setValue(F value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -208,11 +208,11 @@ public HByReference(Pointer p) {
setPointer(p);
}

H getValue() {
public H getValue() {
return new H(getPointer().getInt(0));
}

void setValue(H value) {
public void setValue(H value) {
getPointer().setInt(0, value.intValue());
}

Expand Down Expand Up @@ -245,11 +245,11 @@ public IByReference(Pointer p) {
setPointer(p);
}

I getValue() {
public I getValue() {
return new I(getPointer().getInt(0));
}

void setValue(I value) {
public void setValue(I value) {
getPointer().setInt(0, value.intValue());
}

Expand Down
Loading

0 comments on commit d8b3cfa

Please sign in to comment.