Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,9 @@ public static FunctionSignature parseFunctionSignature(String functionName, CXTy
if (cursor != null) {
CXCursor paramCursor = clang_Cursor_getArgument(cursor, i);
String potentialName = clang_getCursorSpelling(paramCursor).getString();
if (!potentialName.isEmpty())
name = potentialName;
if (!potentialName.isEmpty()) {
name = JavaUtils.deduplicateArgumentName(potentialName);
}
}
TypeDefinition argTypeDefinition = registerCXType(argType, name, null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ public static String javarizeName(String cName) {
return cName;
}

public static String deduplicateArgumentName(String cName) {
switch (cName) {
case "env":
return "_env";
case "clazz":
return "_clazz";
case "object":
return "_object";
}
return cName;
}

public static Expression getOffsetAsExpression(int index, OffsetCalculator calculator) {
return getSizeAsExpression((target) -> calculator.getOffset(index, target));
}
Expand Down
Loading