Skip to content

Commit

Permalink
updating convertion to std::size_t
Browse files Browse the repository at this point in the history
  • Loading branch information
lyskov committed May 17, 2023
1 parent cd1f345 commit ee2ecff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion source/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ string bind_member_functions_for_call_back(CXXRecordDecl const *C, string const
// (*m)->dump();
// }

string return_type = standard_name(m->getReturnType().getCanonicalType().getAsString());
string return_type = standard_name(m->getReturnType());
fix_boolean_types(return_type);

// check if we need to fix return class to be 'derived-class &' or 'derived-class *'
Expand Down
12 changes: 6 additions & 6 deletions source/function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ pair<string, string> function_arguments_for_lambda(clang::FunctionDecl const *re
string r, a;

for( uint i = 0; i < record->getNumParams() and i < n; ++i ) {
QualType qt = record->getParamDecl(i)->getOriginalType().getCanonicalType();
r += standard_name(qt.getAsString()) + ' ';
QualType qt = record->getParamDecl(i)->getOriginalType();
r += standard_name(qt) + ' ';
if( !qt->isReferenceType() and !qt->isPointerType() ) r += !qt.isConstQualified() ? "const & " : "& ";
r += "a" + std::to_string(i);
a += "a" + std::to_string(i);
Expand All @@ -138,8 +138,8 @@ tuple<string, string, string> function_arguments_for_py_overload(clang::Function
string r, a, p;

for( uint i = 0; i < record->getNumParams(); ++i ) {
QualType qt = record->getParamDecl(i)->getOriginalType().getCanonicalType();
r += standard_name(qt.getAsString()) + ' ' + "a" + std::to_string(i);
QualType qt = record->getParamDecl(i)->getOriginalType();
r += standard_name(qt) + ' ' + "a" + std::to_string(i);
a += "a" + std::to_string(i);
p += string(qt->isLValueReferenceType() ? "&" : "") + "a" + std::to_string(i);
if( i + 1 != record->getNumParams() ) {
Expand Down Expand Up @@ -274,7 +274,7 @@ string function_qualified_name(FunctionDecl const *F, bool omit_return_type)
string maybe_const;
if( auto m = dyn_cast<CXXMethodDecl>(F) ) maybe_const = m->isConst() ? " const" : "";

string r = (omit_return_type ? "" : F->getReturnType().getCanonicalType().getAsString() + " ") + standard_name(F->getQualifiedNameAsString() + template_specialization(F)) + "(" +
string r = (omit_return_type ? "" : standard_name(F->getReturnType()) + " ") + standard_name(F->getQualifiedNameAsString() + template_specialization(F)) + "(" +
function_arguments(F) + ")" + maybe_const;

fix_boolean_types(r);
Expand Down Expand Up @@ -388,7 +388,7 @@ string bind_function(FunctionDecl const *F, uint args_to_bind, bool request_bind
pair<string, string> args = function_arguments_for_lambda(F, args_to_bind);
// string args; for(uint i=0; i<args_to_bind; ++i) args += "a" + std::to_string(i) + ( i+1 == args_to_bind ? "" : ", " );

string return_type = standard_name(F->getReturnType().getCanonicalType().getAsString());
string return_type = standard_name(F->getReturnType());

// workaround of GCC bug during lambda specification: replace enum/struct/class/const_* from begining of the lambda return type with //const*
static vector< std::pair<string, string> > const name_map = {
Expand Down

0 comments on commit ee2ecff

Please sign in to comment.