diff --git a/bindgen/visitor/TreeVisitor.cpp b/bindgen/visitor/TreeVisitor.cpp index 9d4420b..6c6277d 100644 --- a/bindgen/visitor/TreeVisitor.cpp +++ b/bindgen/visitor/TreeVisitor.cpp @@ -18,7 +18,7 @@ bool TreeVisitor::VisitFunctionDecl(clang::FunctionDecl *func) { std::string pname = parm->getNameAsString(); if (pname.empty()) { - pname = "anonymous" + std::to_string(anonCounter++); + pname = "p" + std::to_string(anonCounter++); } std::shared_ptr ptype = typeTranslator.translate(parm->getType()); diff --git a/tests/samples/Function.scala b/tests/samples/Function.scala index 3f5f63c..1975567 100644 --- a/tests/samples/Function.scala +++ b/tests/samples/Function.scala @@ -13,9 +13,9 @@ object Function { def void_arg(): native.CFloat = native.extern def one_arg(a: native.CInt): native.CChar = native.extern def two_args(a: native.CFloat, b: native.CInt): native.Ptr[Byte] = native.extern - def anonymous_args(anonymous0: native.CFloat, anonymous1: native.CInt): native.CDouble = native.extern + def anonymous_args(p0: native.CFloat, p1: native.CInt): native.CDouble = native.extern def variadic_args(a: native.CDouble, varArgs: native.CString, varArgs0: native.CVararg*): native.CDouble = native.extern - def acceptsArray(anonymous0: native.Ptr[native.CInt]): Unit = native.extern + def acceptsArray(p0: native.Ptr[native.CInt]): Unit = native.extern } import Function._ @@ -34,4 +34,3 @@ object FunctionHelpers { def a_=(value: native.CInt): Unit = !p.cast[native.Ptr[native.CInt]] = value } } - diff --git a/tests/samples/OpaqueTypes.scala b/tests/samples/OpaqueTypes.scala index 5c181a8..03607e9 100644 --- a/tests/samples/OpaqueTypes.scala +++ b/tests/samples/OpaqueTypes.scala @@ -23,10 +23,10 @@ object OpaqueTypes { type functionPointerWithPointerToOpaqueType = native.CFunctionPtr1[native.Ptr[native.Ptr[struct_undefinedStruct]], native.Ptr[undefinedUnion]] def move(point: native.Ptr[struct_point], x: native.CInt, y: native.CInt): native.Ptr[struct_point] = native.extern def processPoints(p: native.Ptr[points]): native.Ptr[union_u] = native.extern - def usePointerToUndefinedStruct(anonymous0: native.Ptr[struct_undefinedStruct]): Unit = native.extern + def usePointerToUndefinedStruct(p0: native.Ptr[struct_undefinedStruct]): Unit = native.extern def fun(): native.Ptr[native.Ptr[undefinedUnion]] = native.extern def returnPointerToAliasOfUndefinedStruct(): native.Ptr[aliasForUndefinedStruct] = native.extern - def usePointerToUndefinedIncludedStruct(anonymous0: native.Ptr[undefinedIncludedStruct]): Unit = native.extern + def usePointerToUndefinedIncludedStruct(p0: native.Ptr[undefinedIncludedStruct]): Unit = native.extern } import OpaqueTypes._ diff --git a/tests/samples/PrivateMembers.scala b/tests/samples/PrivateMembers.scala index 1d488ac..3610061 100644 --- a/tests/samples/PrivateMembers.scala +++ b/tests/samples/PrivateMembers.scala @@ -19,9 +19,9 @@ object PrivateMembers { type privateStructWithTypedefPtr = native.Ptr[struct_privateStructWithTypedef] def getTypeThatUsesPrivateTypes(): pid_t = native.extern def getPrivateType(): native.Ptr[__private_type] = native.extern - def usesPrivateUnion(anonymous0: native.Ptr[union___unionWithPrivateName]): Unit = native.extern - def usesPrivateStruct(anonymous0: native.Ptr[struct_structWithPrivateType], anonymous1: native.Ptr[struct_normalStruct]): Unit = native.extern - def usesPrivateEnum(anonymous0: native.Ptr[enum___privateEnum]): Unit = native.extern + def usesPrivateUnion(p0: native.Ptr[union___unionWithPrivateName]): Unit = native.extern + def usesPrivateStruct(p0: native.Ptr[struct_structWithPrivateType], p1: native.Ptr[struct_normalStruct]): Unit = native.extern + def usesPrivateEnum(p0: native.Ptr[enum___privateEnum]): Unit = native.extern } import PrivateMembers._ diff --git a/tests/samples/ReuseBindings.scala b/tests/samples/ReuseBindings.scala index ceee2c4..e1f03e7 100644 --- a/tests/samples/ReuseBindings.scala +++ b/tests/samples/ReuseBindings.scala @@ -8,7 +8,7 @@ import scala.scalanative.native._ object ReuseBindings { type aliasForBigStruct = org.scalanative.bindgen.samples.Struct.struct_bigStruct type struct_usesImportedEnum = native.CStruct1[org.scalanative.bindgen.samples.Struct.enum_pointIndex] - def useStruct(anonymous0: native.Ptr[org.scalanative.bindgen.samples.Struct.struct_point]): Unit = native.extern + def useStruct(p0: native.Ptr[org.scalanative.bindgen.samples.Struct.struct_point]): Unit = native.extern def returnTypedef_point_s(): native.Ptr[org.scalanative.bindgen.samples.Struct.struct_point] = native.extern def returnTypedef_point(): native.Ptr[org.scalanative.bindgen.samples.Struct.point] = native.extern def readBook(book: native.Ptr[org.scalanative.bindgen.samples.CustomNames.book]): Unit = native.extern diff --git a/tests/samples/native.scala b/tests/samples/native.scala index 538bfdb..cc3cfe8 100644 --- a/tests/samples/native.scala +++ b/tests/samples/native.scala @@ -8,6 +8,6 @@ import scala.scalanative.native._ object nativeLib { type nativeFunc0 = native.CInt @native.link("native") - def nativeFunc0(anonymous0: native.CInt): Unit = native.extern - def nativeFunc(anonymous0: native.CFloat): Unit = native.extern + def nativeFunc0(p0: native.CInt): Unit = native.extern + def nativeFunc(p0: native.CFloat): Unit = native.extern }