Is there any way to change the calling convention programmatically?I found some C++ code in this repo but wasn't able to successfully update it to 6.8.static bool idaapi convert_to_usercall(void *ud){    vdui_t &vu = *(vdui_t *)ud;    if (!vu.cfunc)        return false;    if ( vu.cfunc->entry_ea == BADADDR )        return false;    tinfo_t type;    qtype fields;           if (!vu.cfunc->get_func_type(type, fields))        return false;    func_type_info_t fti;    int a = build_funcarg_info(idati, type.c_str(), fields.c_str(), &fti, 0);    if (!convert_cc_to_special(fti))        return false;    fields.clear();    type.clear();    build_func_type(&type, &fields, fti);    if ( !apply_tinfo(idati, vu.cfunc->entry_ea, type.c_str(), fields.c_str(), 1) )        return false;    vu.refresh_view(true);    return true;}The code seems to use apis that are now deprecated or changed up. Does anybody know a way to fix up this code or some other approach.Any help would be appreciated, whether it is C++ or Python.
IDA 6.8 SDK change calling convention
ida;idapython;idapro sdk
Ok, I found a solution in Python and it should work the same in C++. For anyone interested, here's the code. It changes the calling convention from __usercall to __fastcall:old_func_type = idaapi.tinfo_t()cfunc.get_func_type(old_func_type)fi = idaapi.func_type_data_t()if old_func_type.get_func_details(fi):    if (fi.cc == idaapi.CM_CC_SPECIAL) or (fi.cc == idaapi.CM_CC_SPECIALE) or (fi.cc == idaapi.CM_CC_SPECIALP):        fi.cc = idaapi.CM_CC_FASTCALL        new_func_type = idaapi.tinfo_t()        new_func_type.create_func(fi)        idaapi.apply_tinfo2(ea, new_func_type, idaapi.TINFO_DEFINITE)